Can not delete an NSX segment for an error "Disconnect all VMs and VIFs before deleting a segment." even though no VMs are connected
book
Article ID: 371939
calendar_today
Updated On: 11-20-2024
Products
VMware NSX
Issue/Introduction
- You tried deleting an NSX segment but it failed for an error.
Segment path=*** has N VMs or VIFs attached. Disconnect all VMs and VIFs before deleting a segment.
- On NSX Manager GUI [Networking] - [Segments], [Ports / Interfaces] column of the segment is not zero.
- No VMs are found to be connected to the segment in vSphere client.
- You find the error message in policy.log
Segment /infra/segments/[segment] has VMs attached. Please disconnect all VMs before deleting a segment.
Cause
There might be stale ports on the segment.
Resolution
You can manually delete the stale ports:
- Check the ports by clicking the non-zero number of [Ports / Interfaces] column of the segment.
- Make sure the VMs are not connected to the segment.
If connected, connect the VMs to another NSX segment or portgroup.
- Switch to Manager mode.
- Navigate to [Networking] - [Logical Switches] - [Ports].
- Find the ports of step 1. and manually delete the ports.
- Go back to Policy mode [Networking] - [Segments], and make sure [Ports / Interfaces] column of the segment is zero.
It might take a few minutes.
- Once [Ports / Interfaces] column of the segment is zero, you can delete the segment.
Or following the steps in this KB 91546 "Steps to remove stale logical-port(s) in NSX-T after attempted delete".
Feedback
Was this article helpful?
thumb_up
Yes
thumb_down
No