Script for removing large number of stale transport nodes from NSX
search cancel

Script for removing large number of stale transport nodes from NSX

book

Article ID: 406768

calendar_today

Updated On:

Products

VMware NSX

Issue/Introduction

  • Unable to decommission NSX Transport Node hosts.
  • Hosts were already removed from vCenter.
  • The recommended way of decommissioning NSX-Prepared ESXi Hosts as per KB 403287 was not followed. 
  • In NSX > System > Fabric > Hosts : Hosts appear under the stand-alone tab.
  • Trying to "Delete NSX" in the Web UI with the "Force" box checked hangs the de-commission process at 20%
  • Trying deleting via REST API : DELETE https://<mgr-ip>/api/v1/transport-nodes/<Transport-Node-UUID>?force=true&unprepare_host=false
    returns a 200 OK, and the process also hangs at 20%
  • The following log-line with 404 error can be seen at localhost_access_log.txt log file on the NSX Manager after the host is hung at 20% and an API GET command is applied:

    localhost_access_log.txt.1:2025-07-22T12:58:34.639Z - "GET /nsxapi/api/v1/transport-nodes/e3###################/status HTTP/1.1" 404 181 52 51 +

  • As per nsxapi log file on the NSX Manager, DELETE operation is seen to be hung at 20 percent 

    nsxapi.5.log:900256:2025-07-22T23:05:39.249Z INFO L2HostConfigTaskExecutor5 DeploymentProgressServiceImpl FABRIC [nsx@6876 comp="nsx-manager" level="INFO" subcomp="manager"] Updating the DeploymentProgress from: DeploymentProgress [ deploymentType=HOST_TN, operationType=DELETE, progress=8, stateDescription=deployment.progress.tn.delete.waiting_for_host_config_reply, removeNsxFlag=false] to DeploymentProgress [ id=e36##########, deploymentType=HOST_TN, operationType=DELETE, progress=20, stateDescription=deployment.progress.tn.delete.waiting_for_host_config_reply, removeNsxFlag=false]

Environment

VMware NSX 4.x

Resolution

Broadcom has prepared two scripts which will detect and cleanup stale TransportNode entries, which is especially helpful for large data centers having 40 or more hosts per cluster.

If you believe these scripts are required for cleaning up stale TransportNode entries , please open a support case with Broadcom Support and refer to this KB article.

For more information, see Creating and managing Broadcom support cases.