Follow this Step-by-Step guide:
- Remove a vmnic located in the DVS connected to the Management Network
- Create a Standard Switch, a Portgroup, add the vmnic to the Standard Switch
- Recover vCenter’s Virtual Machine network connectivity
- Migrate the vmnic and vmk back to the DVS
- Delete the Standard Switch.
Step 1: Remove a vmnic located in the DVS connected to the Management Network
- Identify the Port ID where the vmnic that you want to remove is connected to the DVS
# esxcli network vswitch dvs vmware list | egrep "Client: vmnic#" -A3
Output is similar to:
# esxcli network vswitch dvs vmware list | egrep "Client: vmnic1" -A3
Client: vmnic1
DVPortgroup ID: dvportgroup-5008
In Use: true
Port ID: 12
- Remove the vmnic
# esxcfg-vswitch -Q vmnic# -V PortID DVSName
Example using
vmnic1, Port ID
12 and DVS Name
ProdSwitchDVS:
# esxcfg-vswitch -Q vmnic1 -V 12 ProdSwitchDVS
Step 2: Create a Standard Switch, a Portgroup, add the vmnic to the Standard Switch
- Create a Standard switch
# esxcli network vswitch standard add --vswitch-name=vSwitchName
- Create a Portgroup
# esxcli network vswitch standard portgroup add --portgroup-name=PortgroupName --vswitch-name=vSwitchName
- Add a vmnic to the Standard Switch
# esxcli network vswitch standard uplink add --uplink-name=vmnic --vswitch-name=vSwitchName
Step 3: Recover vCenter’s Virtual Machine network connectivityFirst, we will connect vCenter’s virtual machine to the new Standard Switch Portgroup. This will help to regain network access to vCenter. This will also allow the ESXis to connect back to vCenter Server too and you will be able to manage your infrastructure again.
- Login to the ESXi vSphere Client with administrator credentials
- Go to “Virtual Machines”
- Check vCenter’s Virtual Machine
- Click in “Actions” > “Edit Settings”
- Connect Network Adapter 1 to the newly created Standard Switch Portgroup
- Click Save
Note: Up until now you should have recovered vCenter’s network connectivity and now you should be able to connect to its vSphere Client. If you still can’t, make sure the Standard Switch Portgroup has the correct VLAN and MTU configuration.
Once you have reviewed that you can see everything is ok in your vCenter Inventory, let’s now migrate vCenter back to the DVS so that we can have the same configuration before the outage.
- If you are not logged in the vCenter vSphere Client already, login to vCenter with Administrator credentials.
- Go to the vCenter’s virtual machine, right click it and select “Edit Settings”.
- Connect Network Adapter 1 to the Management Distributed Switch Portgroup
- Click OK
Make sure you do not lose network access again. If everything is ok after a couple of minutes, continue to the next steps.
Step 4: Migrate vmnic back to the DVSLet’s put the vmnic back to the DVS by following these steps:
- If you are not logged in the vCenter vSphere Client already, login to vCenter with Administrator credentials.
- Go to the “Networking” tab.
- Right click the DVS and select “Add and Manage Hosts”
- Select “Manage host networking” and click Next
- Click “Attached hosts…”
- Check the ESXi with the vmk and vmnic that you want to add back to the DVS and click OK
- Click Next
- On the "Manage physical adapters" list, select the vmnic and click “Assign uplink”
- Select an Uplink with empty “Assigned Adapter” and click OK
- Click Next
- Click Next in "Manage VMkernel adapters"
- Click Next in "Migrate VM networking"
- Click Finish
Step 5: Delete the Standard SwitchYou are now able to delete the temporary Standard Switch we created to recover vCenter’s network connectivity.
- If you are not logged in the vCenter vSphere Client already, login to vCenter with Administrator credentials.
- Go to the “Hosts and Clusters” Tab
- Select the ESXi used during this process
- Click in the “Configure” tab
- Click on “Virtual Switches” under “Networking”
- Look for the temporary Standard Switch you created and click the ellipsis “…”
- Click “Remove”
- Click “Yes” in the warning that pops up
You have now successfully recovered vCenter’s network connectivity and the environment should be up and running.