Orphaned logical routers and stale objects remain in NSX-T after a non-graceful removal of the Tanzu Kubernetes Grid Integrated (TKGi) Control Plane. These stale objects continue to consume IP addresses from IP Pools, leading to IP pool exhaustion, "BGP down" errors, and "EDGE exceeded" deployment failures. This article provides the procedure to identify and clean up these orphaned resources using the nsx-cluster-cleanup.py script.
TKGI logical routers and associated objects remain in NSX-T if the TKGi Control Plane VMs are removed non-gracefully without running standard cleanup procedures. These stale objects continue to consume IP addresses from IP Pools, leading to resource exhaustion.
Warning: Ensure you identify the correct cluster UUID before running the deletion script to avoid impacting production services.
pks-****-cluster-router. Where **** is the cluster UUIDnsx-cluster-cleanup.py script attached to this KB.enterprise_admin role in NSX Manager.python3 nsx-cluster-cleanup.py list --nsx-host <nsx host ip> --instance-id <cluster UUID> --api-type <policy/mp> --client-cert-path <nsx.pem> --client-key-path <nsx.key> --nsx-ca-cert-path <nsx-ca.pem>
python3 nsx-cluster-cleanup.py delete --nsx-host <nsx host ip> --instance-id <cluster UUID> --api-type <policy/mp> --client-cert-path <nsx.pem> --client-key-path <nsx.key> --nsx-ca-cert-path <nsx-ca.pem> --yes
NOTE:
--client-cert-path and --client-key-path with --username and --password parameters.--insecure flag
python3 nsx-cluster-cleanup.py list --nsx-host <nsx host ip> --instance-id <cluster-uuid> --insecure --username <username> --password '<password>'python3 nsx-cluster-cleanup.py delete --nsx-host <nsx host ip> --instance-id <cluster-uuid> --insecure --username <username> --password '<password>' --yes