I have created a 2 node vsan cluster with a witness. The two physical hosts are interconnected with 10gb links and the vsan vmkernel resides on that particular vswitch. I leave the mgmt on the default vSwitch0 which uses vmk0.
I'm looking for a way to script in powercli/powershell adding a route to the esxi hosts so that it can communicate with the witness.
$HostNameFQDN = xyz.domain.com
This outputs nothing on my system currently but it seems like i'm really close.
$Host_Gateway = Get-VMHost -Name $HostNameFQDN | Get-VMHostNetworkAdapter | select VMKernelGatway
New-VMHostRoute -VMHost $HostNameFQDN -Destination 172.23.0.0 -Gateway $Host_Gateway -PrefixLength 20
Would somebody be able to assist with getting this to work, correctly? I've also noticed that the Get-network commands do not work in Powershell ISE but they do in the regular powershell window.
Thanks in advance.