Unable to delete logical port with attachments of LogicalPort InternalLogicalPort/########-####-####-######## in the UI.
2025-06-05T07:15:00.187Z NSXmanager.com NSX 1066039 POLICY [nsx@6876 comp="nsx-manager" errorCode="PM0" level="ERROR" subcomp="manager"] Created alarm Alarm [policyPath=/infra/realized-state/enforcement-points/default/logical-switches/<Segment-name>/alarms/########-####-####-########, message=Unable to delete logical port with attachments of LogicalPort InternalLogicalPort/########-####-####-########.,errorId=PROVIDER_INVOCATION_FAILURE, path=null, apiError=error_code=8402, module_name=NsxSwitching service, error_message='Unable to delete logical port with attachments of LogicalPort InternalLogicalPort/########-####-####-########.', sourceSiteId=null].
VMware NSX
NSX is unable to delete the segment as it has a stale logical port attached. This is a known issue in older releases.
This issue is resolved in VMware NSX 4.2.2 available at Broadcom downloads.
If you are having difficulty finding and downloading software, please review the Download Broadcom products and software KB.
Workaround:
Force delete stale logical port using below API:
curl -k -X -H "Content-Type: application/json" -H "X-Allow-Overwrite: true" DELETE https://<NSX-Manager-FQDN-or-IP>/api/v1/logical-ports/<logical-portid>?detach=true
Delete the segment which is stuck using below API:
DELETE https://{mgrIP}/policy/api/v1/infra/segments/<segment-id>
Note: You can use below API to get the segment Id which is stuck in-progress state:
GET https://{mgrIP}/policy/api/v1/infra/segments?include_mark_for_delete_objects=true