nsx_cleanup.py script to remove manager objects as you no longer have access to the containerERROR: Failed to delete <Virtual Server Name> , error { "httpStatus" : "BAD_REQUEST", "error_code" : 23803, "module_name" : "LOAD-BALANCER", "error_message" : "Entity id LoadBalancerVirtualServer/<Virtual Server UUID> can not be deleted as it is being referenced by entity LoadBalancerService/<Load Balancer UUID>."
nsx_cleanup.py script should only be used to clean up old TKGi (PKS) objects created by NCP. VMware don't support using this script to clean up TKGi.VMware NSX
The nsx_cleanup.py script is unable to automatically delete the Virtual Servers because the Load Balancer Service remains active, creating a dependency that blocks the deletion of associated objects.
You must manually remove the Load Balancer service with the API call:DELETE /api/v1/loadbalancer/services/<LB UUID>
As it's a protected object, add the additional API header "X-Allow-Overwrite: true" to allow you to overwrite.
Example with curl:curl -k -u admin -H "Content-Type: application/json" -H "X-Allow-Overwrite: true" -X DELETE https://<NSX Manager IP>/api/v1/loadbalancer/services/<LB UUID>
You can now run the cleanup script again to remove the remaining objects.