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:


esxcli network vswitch dvs vmware list

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


Step 2:


esxcfg-vswitch -Q vmnic -V dvPort_ID_of_vmnic dvSwitch

which drops the vmnic from the vDS


Step 3:

Now, add the nic back to vSwitch0 with:

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



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

  1. Chris Nenzel says:

    The first time I made this oops I used the console to reset the management networks. It undid the change but there weren’t any production distributed switches.

    Does beg the question – Will VMware ever support a vCenter cluster with all of the nics assigned to distributed switches?

  2. Amit says:

    How to do the reverse, I mean move a vmnic from vSS to vDS ?

  3. Salko says:

    My question as well, old thread but still.. valid question.

  4. diego says:

    really thank you.

Leave a Reply to Cancel reply

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