vSphere with Tanzu 7.0U2a – TKC Deployment fails with VirtualMachineClassBindingNotFound

Since the latest update of vSphere with Tanzu to version 7.0 U2a, the deployment of Tanzu Kubernetes Clusters fails with the following condition:

 Conditions: Last Transition Time: 2021-05-05T18:19:10Z Message: 1 of 2 completed Reason: VirtualMachineClassBindingNotFound @ Machine/tkc-dev-control-plane-wxd57 Severity: Error Status: False Message: 0/1 Control Plane Node(s) healthy. 0/2 Worker Node(s) healthy
Events: Type Reason Age From Message ---- ------ ---- ---- ------- Normal PhaseChanged 7m22s vmware-system-tkg/vmware-system-tkg-controller-manager/tanzukubernetescluster-status-controller cluster changes from creating phase to failed phase

The problem seems to be related to the newly introduced VM Service. In previous versions, all Virtual Machine classes were automatically available for all namespaces. With the new VM Service, you can now create custom classes and assign them to namespaces. When a VirtualMachineClass is added to a namespace (Using the VM Service Card), a VirtualMachineClassBinding is created in the developer’s namespace. This binding is not only required for Virtual Machines created by VM Service but also to deploy TKC Clusters.

When you create a new Namespace in vSphere 7.0 U2a, the namespace is created with no VirtualMachineClassBindings.

# k get virtualmachineclasses No resources found in biernot namespace. 

After adding a VM Class to the Namespace using the vSphere Client, the binding is created and you can deploy TKG Clusters.

# kubectl get virtualmachineclassbindings
best-effort-xsmall best-effort-xsmall 15m # k get virtualmachineclasses
best-effort-2xlarge 8 64Gi 10d
best-effort-4xlarge 16 128Gi 10d
best-effort-8xlarge 32 128Gi 10d
best-effort-large 4 16Gi 10d
best-effort-medium 2 8Gi 10d
best-effort-small 2 4Gi 10d
best-effort-xlarge 4 32Gi 10d
best-effort-xsmall 2 2Gi 10d
guaranteed-2xlarge 8 64Gi 10d
guaranteed-4xlarge 16 128Gi 10d
guaranteed-8xlarge 32 128Gi 10d
guaranteed-large 4 16Gi 10d
guaranteed-medium 2 8Gi 10d
guaranteed-small 2 4Gi 10d
guaranteed-xlarge 4 32Gi 10d
guaranteed-xsmall 2 2Gi 10d 

Posted by Editor