This guide explains how to build a temporary Standard Switch (vSS) to connect the vCenter VM for recovery from a port disconnection or network outage.
Once vCenter is back online, necessary changes can be made in the distributed switch (vDS) to reconnect vCenter.
Most of the steps are only possible via command line.
Addition or reconfiguration of network adapters attached to non-ephemeral distributed virtual port groups is not supported.
VMware vSphere ESXi
VMware vCenter Server
If vCenter to host communication is lost, VMs will not be able to be reconfigured to static (also known as non-ephemeral) port groups on the vDS because vCenter is unavailable to give the VM a port binding.
VMware recommends to configure an Ephemeral Port Binding dvportgroup for the VC's management network in the environment to avoid this issue from happening again.
For more information, see: Static (non-ephemeral) or ephemeral port binding on a vSphere Distributed Switch.
Please note: if LACP is configured on the physical switch, the LACP configuration will need to be temporarily broken to remove a NIC from the vDS; in order to be available for the vCenter VM to use on the standard switch (unless non-LACP NICs are available and configured to pass the traffic). If the LACP configuration is not broken before moving the NIC off the vDS, this can cause further issues to the environment's connectivity.
This will require engagement from network team managing upstream switches to change the port config.
Before proceeding, please also ensure access to the DCUI/iLO/iDRAC for the host where the below steps will be performed.
# esxcli network vswitch dvs vmware list
Sample output:
Name: vDSName
VDS ID: ######## Class: vswitch Num Ports: #### Used Ports: ##
Configured Ports: ##
MTU: 9000/1500
CDP Status: listen
Beacon Timeout: -/+#
Uplinks: vmnicX, vmnicX
VMware Branded: true
DVPort:
Client: vmnicX
DVPortgroup ID: dvportgroup-###
In Use: true
Port ID: ##
esxcfg-vswitch -Q <vmnicX> -V <PortIDX> <vDSName>
# esxcfg-vswitch -Q vmnic1 -V 12 ProdSwitchvDS
#esxcli network vswitch standard add --vswitch-name=<vSwitchName>
#esxcli network vswitch standard portgroup add --portgroup-name=<PortgroupName> --vswitch-name=<vSwitchName>
#esxcli network vswitch standard uplink add --uplink-name=<vmnic#> --vswitch-name=<vSwitchName>
#esxcli network vswitch standard portgroup set --portgroup-name=<PortgroupName> --vlan-id <VLAN>
Confirm that everything appears correct in the vCenter Inventory, navigate to the VDS and utilize the add manage hosts wizard to migrate vCenter and uplink/s back to the vDS and restore the configuration to its state prior to the outage.
4. Migrate uplink/vmnic back to the original vDS.
Restore the vmnic back to the vDS by following these steps:
5. Delete the Standard Switch.
The temporary Standard Switch created to recover vCenter's network connectivity can now be deleted.
Static (non-ephemeral) or ephemeral port binding on a vSphere Distributed Switch
Configuring vSwitch or vNetwork Distributed Switch from the command line in ESXi
Impact/Risks:
There should be at least 2 vmnics used for the Management Network because in one of the steps we will remove one vmnic from the vDS Management Portgroup so that we can use it for the Standard Switch that will be create temporarily.
NOTE: If the vmnics are in an LACP configuration, it will be required to remove at least one uplink from LACP port channel from physical switch end. The same vmnic can be then removed from DVS using CLI command. Follow this KB Enable EtherChannel / Link Aggregation Control Protocol (LACP) in ESXi/vCenter for steps on how to work with an LACP configuration.
If there are fewer than 2 vmnics in the vDS, it is recommended to follow these steps via the DCUI Shell. Otherwise, access to SSH will be lost when running the remove vmnic command, preventing continuation of the process.