I have a powercli script to configure additional VMK's during a host build and I need to configure the vMo network with it's own default gateway but I am struggling to find a method that sets just the default gateway on a specific VMK. Can anyone provide any assistance please.
Do you happen to have multiple VMK on the same network stack?
There is only 1 default gateway per stack afaik
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Online research seems to suggest the same, only 1 DG per stack. However if I edit the VMK and choose the "Override default gateway for this adapter" option I can manually set an alternate IP address for that VMK and it all works fine. I would just like to try and script this instead of having to remember to add it manually each time.
Surely there must be a way to set a DG on a specific VMK using Powercli...
Yes, there is, but the end effect might not be what you expect from it.
For the method see Solved: override default gateway for vmkernel adapter (vsp... - VMware Technology Network VMTN
but read that thread till the end to see what to expect
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
It's a dedicated vMo VMK so I don't think it's an issue and I currently have 8 hosts configured this way and it's working. Never the less, I should probably reconfigure them to start using the vMotion stack.
Then you should be able to use the snippet I posted in that thread
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
