When attempting to move a workload cluster from a source management cluster to a target cluster after an upgrade (e.g., from v1.24 to v1.27.15), the re-home process fails with the following
Error: [CAS111505] failed to get object graph: failed to check virtual node: Missing Machine [Namespace]/[Machine_Name] in source management cluster which listed in ownerReferences of object VSphereMachine [VSphereMachine_Name]
TCA: 3.x, TCP: 5.x
The failure is caused by stale Machine and VSphereVM objects remaining in the management cluster. The VSphereMachine object incorrectly references a Machine object that was deleted during the upgrade or previous cluster operations. This reference mismatch prevents the object graph from being validated during the re-home process.
To resolve this issue, manually clean up the leftover references in the management cluster:
Identify Stale Objects: Connect to the management cluster and check for orphaned resources associated with the stuck workload cluster:
kubectl get ma,vspheremachine,vspherevms -A | grep <workload-cluster-name>Remove Finalizers (if necessary): If the objects are stuck in a deleting state, remove their finalizers to allow garbage collection:
kubectl patch vspheremachine <name> -n <namespace> --type merge -p '{"metadata":{"finalizers":[]}}'kubectl patch vspherevm <name> -n <namespace> --type merge -p '{"metadata":{"finalizers":[]}}'kubectl patch machine <name> -n <namespace> --type merge -p '{"metadata":{"finalizers":[]}}'Delete Orphaned Objects: Manually delete the identified stale objects:
kubectl delete vspheremachine <name> -n <namespace>kubectl delete vspherevm <name> -n <namespace>kubectl delete machine <name> -n <namespace>Verify Cleanup: Ensure no stale references remain:
kubectl get ma,vspheremachine,vspherevms -A | grep <workload-cluster-name>Retry Re-home if it doesn't auto-reconcile: Restart the re-home operation from the Telco Cloud Automation (TCA) UI or Workflow Hub.