Occasionally when I’m proctoring my Test Track environment users will “accidentally” move vmnic0 on a host from the default vSwitch0 over to a Distributed switch. As management traffic only runs across vSwitch0 I lose access to the host until I fix it from the command line.
I’m mostly posting this so I can quit looking up the command sequence each time.
esxcli network vswitch dvs vmware list
and find the switch that vmnic0 was moved to. Note the switch Name and Port ID.
esxcfg-vswitch -Q vmnic -V dvPort_ID_of_vmnic dvSwitch
which drops the vmnic from the vDS
Now, add the nic back to vSwitch0 with:
esxcli network vswitch standard uplink add --uplink-name=vmnic --vswitch-name=vSwitch
8 Responses to Moving a vmnic from vDS to vSS at the host commandline