Operation failed! Cannot complete operation due to concurrent modification by another operation.
search cancel

Operation failed! Cannot complete operation due to concurrent modification by another operation.

book

Article ID: 412494

calendar_today

Updated On:

Products

VMware vSphere ESXi VMware NSX for vSphere VMware vCenter Server

Issue/Introduction

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"



Environment

VMware vSphere ESXi
VMware vCenter Server
vSphere Distributed Switch  (VDS)
VMware NSX-V

Cause

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.

Command to list NSX VIBs:

esxcli software vib list | grep -i "nsx" 

Command to list VDS/VSS switch info:

esxcfg-vswitch -l 

Resolution

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).

1. Log in to the problematic ESXi host via SSH.

Note: You may need to enable SSH for the host in the vCenter client.

2. 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

3.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:

Go to the vCenter UI > Networking > VDS > Add and Manage hosts > Add hosts > Select Host > Manage Physical Adapters > Manage VMkernel adapters > Migrate VM Networking > Complete > Save.