When a vSphere Kubernetes Service (VKS), also known as TKGs, cluster is deleted, the associated Avi Load Balancer (ALB) objects, including Virtual Services (VS), Service Engines (SEs), Service Engine Groups (SEGs), and Logical Router/Logical Switch (LR/LS) entries, are not removed gracefully. This can lead to errors when creating subsequent TKGs clusters, specifically "LogicalSwitch could not be found.
An error occurred during host configuration: Failed to attach VIFMessage from NSX: The requested object : LogicalSwitch/xxxxxxxxxxx could not be found. Object identifiers are case sensitive
The Supervisor cluster deletion process contains a cleanup script that fails to properly remove the Avi ALB objects and stale LR/LS entries. This results in the Supervisor re-enablement to fail due to stale objects being present in Avi controller and conflict with subsequent cluster creations.
A permanent fix will be included in a future vCenter release (WCP + Avi Load Balancer integration).
Workaround:
Manually execute the avi_cleanup_in_wcp.py
script on the Avi Controller node after deleting the TKGs cluster. The script is located in the /opt/avi/scripts/
directory and requires root user access.
root@<controller-ip>:/opt/avi/scripts# python3 avi_cleanup_in_wcp.py -u admin -p <password> -c <wcp-cluster-name>