Notification – The last operation failed for the entity with the following error message. The object <Logical Switch Name> is in use, this operation cannot be performed. Remove all configuration referring to this object and retry operation.
I recently working with a customer who was unable to remove or delete a logical switch that had been created. The first step was verify that no virtual machines were connected. To do so, I did the following:
Remove all Virtual Machines and NSX Edges from the Logical Switch
- Click the vSphere Web Client Home icon.
- On the vSphere Web Client Home tab, double-click on the Networking and Security icon.
- In the left navigation pane, select Logical Switches.
- Double-click on the Logical Switch you are attempting to delete.
- Select the Related Objects tab, then click on the Virtual Machines button.
- Note: If you have any remaining virtual machines connected to the Logical Switch you are attempting to delete, migrate them to another Logical Switch.
- Click on the Manage tab, then click on the NSX Edges button.
- Note: If you have any connections (interfaces) to an NSX Edge you will need to remove them.
In my case the customer had migrated the virtual machines, but had neglected to remove the connection to the NSX Edge. Once the NSX Edge was removed, we were able to successfully delete the logical switch.