Make sure the target edge to be deleted is not consumed in any edge cluster. If the edge is in use, please remove it from the edge cluster, using the steps mentioned in the document. Below mentioned are the generic steps for deleting an edge VM/BM.
DELETE https://<manager-ip>/api/v1/transport-nodes/<tn-id> API. This can be run using curl or using tools like Postman please see NSX API guide.GET api/v1/transport-nodes/<tn-id>/state. Refer "node_deployment_state" is set to "DELETE_IN_PROGRESS" and "state" is set to "orphaned"DELETE https://<manager-ip>/api/v1/transport-nodes/<tn-id> API. This can be run using curl or using tools like Postman please see NSX API guide.In cases where, you've already attempted edge deletion from NSX-T manager but the deletion is stuck for a long time, the edge VM is deleted from vCenter or the edge is unreachable you can proceed with calling the below API, to cleanup a specific stale edge VM:
DELETE https://<manager-ip>/api/v1/polilcy/api/v1/infra/sites/<site-id>/enforcement-points/<enforcementpoint-id>/edge-transport-nodes/<edge-transport-node-id>?force=trueSteps mentioned below give a generic way to follow and troubleshoot the edge deletion:
DELETE https://<manager-ip>/api/v1/polilcy/api/v1/infra/sites/<site-id>/enforcement-points/<enforcementpoint-id>/edge-transport-nodes/<edge-transport-node-id> APIhttps://<manager-ip>/api/v1/policy/api/v1/infra/sites/<site-id>/enforcement-points/<enforcementpoint-id>/edge-transport-nodes/<edge-transport-node-id> /state API and check for the "state" is set to "orphaned""del nsx" nsxcli command for BME.
DELETE https://<manager-ip>/api/v1/polilcy/api/v1/infra/sites/<site-id>/enforcement-points/<enforcementpoint-id>/edge-transport-nodes/<edge-transport-node-id>?force=trueNotes:
{ "httpStatus": "BAD_REQUEST", "error_code": 16077, "module_name": "FABRIC", "error_message": "[Fabric] Refresh <#Edge_UUID#> placement references failed." }
If the Edge VM is still existing in NSX UI inventory after following the workaround, restart nsx-proxy service on the host which was hosting the Edge VM/etc/init.d/nsx-proxy status | restart
Enhancements in Versions 3.2.1.1 and 4.0.0.1
This KB article addresses challenges related to deleting powered-off, orphaned, or disconnected edge VMs, specifically those auto-deployed through NSX Manager.
Previously, as described in the "Symptoms" section, the process did not delete the edge if it was unreachable, due to concerns over potential duplicate VTEP issues. With the latest enhancements, the updated behavior is as follows:
1. Standard Deletion Workflow: If the edge is reachable and the host switch config is cleared from the edge, it's safe to delete the edge VM from NSX and VC.
2. However, if issues arise during the first step, primarily caused by connectivity problems between the edge and the manager, we examine the NSX inventory for the edge VM's presence:
a. If the Edge VM is in the NSX Inventory:
b. If the Edge VM isn't in the NSX Inventory: This might be due to NSX inventory discrepancies or the VM's deletion from VC. Users should refer to the workaround to delete the edge from NSX.
Important Note
Should a network disconnection occur between the manager and edges, and if the host switch configuration along with the edge gets deleted from the manager, VTEP resources will be freed. The subsequently released IP might be allocated to a new edge from the IP pool. Such actions can produce duplicate edge IP addresses, creating serious datapath disruptions.
To avoid such scenarios, NSX Manager attempts to establish connectivity with the edge/VC prior to the edge VM's deletion. It's imperative to understand that if the manager can't access the Edge or VC, it can't deduce that the edge has been deleted, warranting user intervention.
Further, with these improvements, even if the edge turns unreachable for NSX Manager, it remains trackable through VC and NSX inventory due to its auto-deployment on VC. This facilitates edge identification and cleanup from VC when needed.
Impact/Risks:
Leaving behind stale EDGE VM entries in the VC Inventory can disrupt the datapath.