Attempts to create or update a cluster via YAML fail with a webhook denial:
Error from server: error when creating "example.yaml": admission webhook "capi.validating.tanzukubernetescluster.run.tanzu.vmware.com" denied the request: vm class(es): [class-name] not found
When attempting to list available VM classes from the Supervisor command line using kubectl, the output returns no resources. The command kubectl get virtualmachineclasses -A returns "No resources found".
Global VM classes defined at the Supervisor level are not automatically inherited by namespaces. They must be explicitly associated (bound) to each target vSphere Namespace to be visible to the VM Operator and accessible for VKS cluster deployment.
To associate a VM class with a namespace, follow the steps below:
Log in to the vSphere Client.
Navigate to Supervisor Management > Namespaces.
Select the target Namespace.
On the Summary tab, locate the VM Service tile.
Click Manage VM Classes.
Select the checkbox for the required class (e.g., best-effort-large).
Click OK to save the changes.
Verification: Run kubectl get virtualmachineclasses again to confirm the class is now visible within the namespace.
Operational Impact
Safe Association: Adding or reattaching a VM class to a namespace is a metadata update and does not trigger a rollout of existing clusters.
Cluster Updates: A rolling update of cluster nodes only occurs if you manually update an existing cluster's specification (YAML) to utilize a newly assigned VM class.