I accidentally used the wrong VLAN on a portgroup in vDS while playing with NSX-T.(long story) This caused vCenter to lose access to all the hosts in a cluster.
There is a KB article that goes through a few hoops before we can get the hosts back into vCenter Server, Recovering from a management portgroup VLAN misconfiguration on a vNetwork Distributed Switch (vDS)
To resolve the issue,
As i still had access to vCenter, after configuring the right vlan in vCenter I used net-dvs to manually change the vlan on each vmkernel interface.
Note: net-dvs is not a supported command and can cause the dvswitch to go out of sync.
First, get the port number that the vmkernel interface is connected to, using the command
From the above command, I wanted to change the vlan for vmk1.
vmk1 is connected to port 21 on the dvswitch.
To change the VLAN of the vmkernel interface, use the command.
net-dvs -v -p vDS_Name
net-dvs -v 100 -p 21 MgmtDVS