While attempting to delete a logical port, that is you detached a VM from the segment, but the port is still present in the NSX-T UI.
In policy view, for the segment, the segment port shows as Admin Status Up and Status Success.
In manager view for the logical switch, Admin Status is Up, but Operational Status is Down.
VMware NSX-T
This is a known issue Impacting NSX-T.
Workaround:
In the NSX-T manager UI, under Policy view, find the port (Networking > Segments > click on blue number of Ports for Segment), click the ellipsis (3 vertical dots) of the port, and select the Delete option.
If this operation fails, you can use the below API call the with the HEADER x-allow-overwrite = true to remove the logical port:
DELETE /api/v1/logical-ports/<Logical-Port-UUID>?detach=true
Steps:
Login to the NSX-T manager as user admin.
Switch to root account using the command "st en"
Run the following command to delete the logical-port(s)
curl -l -k -u 'admin' -H 'Content-Type:application/json' -H 'X-Allow-Overwrite: true' -X DELETE "https://<nsx-manager-ip>/api/v1/logical-ports/<Logical Port UUID>?detach=true"
Where Logical Port UUID is the port id to be deleted.
For example the below highlighted is the port id for VM <VM-name>.
The port uuid we can be obtained from the Manager view in NSX
ie Networking ---> Logical Switches ---> Click on the Logical Switch
Alternatively, you can force delete the logical switch with the following API call directly, or in curl format:
DELETE /api/v1/logical-switches/<logical-switch-UUID>?detach=true&cascade=true
curl -l -k -u 'admin' -H 'Content-Type:application/json' -H 'X-Allow-Overwrite: true' -X DELETE "https://<nsx-manager-ip>/api/v1/logical-switches/<logical-switch-UUID>?detach=true&cascade=true"
Name |
Description |
Type | Notes |
---|---|---|---|
cascade | Delete a Logical Switch and all the logical ports in it, if none of the logical ports have any attachment. | boolean | Default: "False" |
detach | Force delete a logical switch If this is set to true, then logical switch is deleted regardless of whether or not it is added to NSGroup. If cascade is set to true in the meantime, then logical switch and all logical ports are deleted regardless of whether any logical port in this switch has attachments. |
boolean | Default: "False" |
For additional information on the API details: NSX-T Data Center REST API