When deploying a Kubernetes cluster with DKP vSphere provider the first machine object is shown as Ready but the corresponding VM is not spawn. At describing the cluster can be seen the Machine/dkp240-rhel84-vsphere-control-plallprt is in Ready status:
./dkp describe cluster -c dkp240-rhel84-vsphere
NAME READY SEVERITY REASON SINCE MESSAGE
Cluster/dkp240-rhel84-vsphere-airgap False Warning ScalingUp 6m4s Scaling up control plane to 3 replicas (actual 1)
├─ClusterInfrastructure - VSphereCluster/dkp240-rhel84-vsphere True 6m11s
├─ControlPlane - KubeadmControlPlane/dkp240-rhel84-vsphere-control-plane False Warning ScalingUp 6m4s Scaling up control plane to 3 replicas (actual 1)
│ └─Machine/dkp240-rhel84-vsphere-control-plallprt True 6m7s
└─Workers
└─MachineDeployment/dkp240-rhel84-vsphere-md-0 False Warning WaitingForAvailableMachines 6m13s Minimum availability requires 4 replicas, current 0 available
├─Machine/dkp240-rhel84-vsphere-md-0-5dc458b54zw False Info WaitingForControlPlaneAvailable 6m10s 0 of 2 completed
├─Machine/dkp240-rhel84-vsphere-md-0-5dc458bdlfg False Info WaitingForControlPlaneAvailable 6m10s 0 of 2 completed
├─Machine/dkp240-rhel84-vsphere-md-0-5dc458lq4tv False Info WaitingForControlPlaneAvailable 6m10s 0 of 2 completed
└─Machine/dkp240-rhel84-vsphere-md-0-5dc458rrqp8 False Info WaitingForControlPlaneAvailable 6m10s 0 of 2 completed
The cluster-api vsphere controller logs shows that the VM folder is not be found:
kubectl -n capv-system -l=cluster.x-k8s.io/provider=infrastructure-vsphere logs
E0510 15:23:04.035265 1 controller.go:317] controller/vspherevm "msg"="Reconciler error"
"error"="failed to reconcile VM: folder 'sortega/dkp240' not found" "name"="dkp240-rhel84-vsphere-control-plallprt" "namespace"="default" "reconciler group"="infrastructure.cluster.x-k8s.io" "reconciler kind"="VSphereVM"
The folder is specified in the vspheremachinetemplate objects and 2 of these objects exists on each cluster:
kubectl get vspheremachinetemplate NAME AGE
dkp240-rhel84-vsphere-control-plane 10m
dkp240-rhel84-vsphere-md-0 10m
As the vspheremachinetemplate is immutable cannot be edited and therefore a new object must be created with the correct VM folder.
kubectl edit vspheremachinetemplate dkp240-rhel84-vsphere-control-plane
error: vspheremachinetemplates.infrastructure.cluster.x-k8s.io
"dkp240-rhel84-vsphere-control-plane" could not be patched: admission webhook
"validation.vspheremachinetemplate.infrastructure.x-k8s.io" denied the request:
spec: Forbidden: VSphereMachineTemplateSpec is immutable