Orphaned Objects After vSphere Kubernetes Service (TKGs) Cluster Deletion
search cancel

Orphaned Objects After vSphere Kubernetes Service (TKGs) Cluster Deletion

book

Article ID: 384871

calendar_today

Updated On:

Products

VMware Avi Load Balancer

Issue/Introduction

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

Environment

 

  • vSphere Kubernetes Service (TKGs) deployments.
  • Avi ALB integrated with vSphere Workload Control Plane (WCP).

 

Cause

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.

Resolution

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>

Additional Information

 

  • This issue is related to the cleanup process during Supervisor cluster deletion.
  • The permanent fix will be delivered as part of a vCenter future release.
  • The manual cleanup script provides a temporary solution until the fixed vCenter version is available.