Moving a vmnic from vDS to vSS at the host commandline

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.

Step 1:

Run

esxcli network vswitch dvs vmware list

and find the switch that vmnic0 was moved to.  Note the switch Name and Port ID.

one

Step 2:

Run

esxcfg-vswitch -Q vmnic -V dvPort_ID_of_vmnic dvSwitch

which drops the vmnic from the vDS

three

Step 3:

Now, add the nic back to vSwitch0 with:

esxcli network vswitch standard uplink add --uplink-name=vmnic --vswitch-name=vSwitch

 

five

This entry was posted in Network, Virtualization, VMware. Bookmark the permalink.

7 Responses to Moving a vmnic from vDS to vSS at the host commandline

        Leave a Reply

        This site uses Akismet to reduce spam. Learn how your comment data is processed.