This article addresses a scenario where an ESXi host is removed from vCenter and then re-added to resolve a "The vSphere Distributed Switch configuration on some hosts differed from that of the vCenter Server" error.
After re-adding the host, attempts to add it back to an existing vSphere Distributed Switch (VDS), fails with the error:
Operation failed!
Cannot complete operation due to concurrent modification by another operation.
Furthermore, attempts to remove the VDS from the ESXi host result in a "The resource 'Port-ID' is in use"
VMware vSphere ESXi
VMware vCenter Server
vSphere Distributed Switch - VDS)
VMware NSX-V
The ESXi host was previously configured with NSX-V VIBs, and the vmkernel ports involved belong to the VXLAN netstack, which was created during NSX-V preparation.
The primary cause of the issue is the persistent presence of these active uplinks and vmkernel ports on the ESXi host, which are still associated with the vSphere Distributed Switch.
Due to these active ports, the VDS cannot be properly re-attached or completely removed from the host. This behavior is expected when ports are actively in use or perceived as in use by the ESXi host's networking stack under a VDS.
Commands used to validate:
esxcli software vib list | grep -i "nsx" >> To list nsx vibs
esxcfg-vswitch -l >> To list the vds/vss switch info
To resolve this issue, the residual uplinks and vmkernel ports, including those associated with the NSX-V VXLAN netstack, must be manually removed from the ESXi host via the command-line interface (CLI).
Connect to the ESXi host:
Log in to the problematic ESXi host via SSH.
1. Remove the identified uplink from the VDS. For example, if vmnic2 is attached to the VDS which should be removed.
esxcfg-vswitch -Q <vmnic-id> -V <VDS_Port_ID> dvs-name
Note: Replace <VDS_Port_ID> with the correct port ID associated with the uplink as found in the esxcfg-vswitch -l output for the specific VDS
2.Remove the identified vmkernel interfaces. For example, if vmk5 and vmk6 are still present:
esxcli network ip interface remove -i vmk5
esxcli network ip interface remove -i vmk6
Now the VDS is expected to be gone from ESXi UI.
Attempt to Add Host to VDS Again:
Vcenter UI --> Networking --> VDS --> Add and Manage hosts --> Add hosts --> Select Host --> Manage Physical Adapters --> Manage VMkernel adapters --> Migrate VM Networking --> Complete --> Save.