vKS Cluster creation stuck on creating virtual machine object in vCentrer for the cluster nodes
search cancel

vKS Cluster creation stuck on creating virtual machine object in vCentrer for the cluster nodes

book

Article ID: 402985

calendar_today

Updated On:

Products

VMware vSphere Kubernetes Service

Issue/Introduction

  • The workload clsuter  machine,vspheremachine,and vm k8s object are not getting created

    kubect get cluster,vm,ma,vspheremachine -n namespace01

    NAME                                   CLUSTERCLASS             PHASE         AGE    VERSION
    cluster.cluster.x-k8s.io/new-cluster   tanzukubernetescluster   Provisioned   36h    v1.29.4+vmware.3-fips.1

    NAME                                                                       POWER-STATE   AGE
    virtualmachine.vmoperator.vmware.com/new-cluster-9jd7q-gmmtk                             49m

    NAME                                                           CLUSTER       NODENAME                              PROVIDERID                                       PHASE          AGE     VERSION
    machine.cluster.x-k8s.io/new-cluster-9jd7q-gmmtk               new-cluster                                                                                          Provisioning   49m     v1.29.4+vmware.3-fips.1

    NAME                                                                                  ZONE                  PROVIDERID                                       IPADDR
    vspheremachine.vmware.infrastructure.cluster.x-k8s.io/new-cluster-7kdqd-fnnll         clusters-vsphere-zone

  • The vmware-system-vmop-controller-manager pods logs on the supervisor cluster show error similer to the following:

    E0702 04:21:22.132493       1 virtualmachine_controller.go:243] "Failed to reconcile VirtualMachine" err="VirtualMachineClass.vmoperator.vmware.com \"guaranteed-medium\" not found" logger="VirtualMachine" name="namespace01/new-cluster-9jd7q-dc867"

    E0702 04:21:22.132953       1 controller.go:329] "Reconciler error" err="VirtualMachineClass.vmoperator.vmware.com \"guaranteed-medium\" not found" controller="virtualmachine" controllerGroup="vmoperator.vmware.com" controllerKind="VirtualMachine" VirtualMachine="namespace01/new-cluster-9jd7q-dc867" namespace="namespace01" name="new-cluster-9jd7q-dc867" reconcileID="0879b032-0f79-49bd-8a00-124c77529f22"



  • The  workload cluster k8s cluster object showing  clsuter  showing that cluster node creation is faling since the VirtualMachineClass Not Found
    kubectl get cluster  new-cluster -n namespace01 -o jsonpath={'.status'} | jq
    {
      "conditions": [
        {
          "lastTransitionTime": "2025-07-02T17:21:04Z",
          "message": "1 of 2 completed",
          "reason": "VirtualMachineClassNotFound @ /new-cluster-9jd7q-gmmtk",
          "severity": "Error",
          "status": "False",
          "type": "Ready"
        },
        {
          "lastTransitionTime": "2025-07-01T05:16:37Z",
          "message": "Waiting for control plane provider to indicate the control plane has been initialized",
          "reason": "WaitingForControlPlaneProviderInitialized",
          "severity": "Info",
          "status": "False",
          "type": "ControlPlaneInitialized"
        },
        {
          "lastTransitionTime": "2025-07-02T17:21:04Z",
          "message": "1 of 2 completed",
          "reason": "VirtualMachineClassNotFound @ /new-cluster-9jd7q-gmmtk",
          "severity": "Error",
          "status": "False",
          "type": "ControlPlaneReady"
        },
  • The workload cluster is created using a vmClass EX: "guaranteed-medium"

    kubectl get cluster  new-cluster -n namespace01 -o jsonpath={'.spec.topology.variables'} | jq | grep vmClass -A1
        "name": "vmClass",
        "value": "guaranteed-medium"

  • The "vmClass"  "guaranteed-medium" is not added to the namespce where the cluster is getting created.

    get virtualmachineclasses.vmoperator.vmware.com -n namespace01

    NAME                  CPU   MEMORY
    best-effort-2xlarge   8     64Gi
    best-effort-4xlarge   16    128Gi
    best-effort-8xlarge   32    128Gi
    best-effort-large     4     16Gi
    best-effort-medium    2     8Gi
    best-effort-small     2     4Gi
    best-effort-xlarge    4     32Gi
    best-effort-xsmall    2     2Gi
    guaranteed-2xlarge    8     64Gi
    guaranteed-4xlarge    16    128Gi
    guaranteed-xsmall     2     2Gi

  • The Workload Management  >> The cluster namespace >> VM Service  >> Manage VM Classes tab not showing the vmClass name which the cluster node used to get created is not selected

Environment

VMware vSphere Kubernetes Service (vKS)

Cause

The vKS workload load cluster is stuck on creating the cluster node virtual machine since the vmClass name which used to create the  cluster nodes is not selected under Workload Management  >> The cluster namespace >> VM Service  >> Manage VM Classes tab.

Resolution

Add the  missing vmClass to the workload cluster namespce using the following steps:

  1. From the vSphere Client home menu, select "Workload Management".
  2. Click on the "workload cluster namespace".
  3. On the "VM Service" section, click "Manage VM Classes".
  4. Find the vmClass needed to create the cluster node.
  5. Select the vmClass and click "OK".
  6. The the required vmClass now will show up as available.

    kubectl get virtualmachineclasses -n namespace01

    NAME                  CPU   MEMORY
    best-effort-2xlarge   8     64Gi
    best-effort-4xlarge   16    128Gi
    best-effort-8xlarge   32    128Gi
    best-effort-large     4     16Gi
    best-effort-medium    2     8Gi
    best-effort-small     2     4Gi
    best-effort-xlarge    4     32Gi
    best-effort-xsmall    2     2Gi
    guaranteed-2xlarge    8     64Gi
    guaranteed-4xlarge    16    128Gi
    guaranteed-medium     2     8Gi
    guaranteed-xsmall     2     2Gi