ProvisioningFailed observed in PVC events.kubectl describe pvc revealed the following error from the vSphere CSI driver:Type Reason Message---- ------ -------Warning ProvisioningFailed failed to provision volume with StorageClass "<##########>": rpc error: code = Internal desc = failed to create volume. Errors encountered: [Datastore: ds:///vmfs/volumes/##########/ specified in the storage class is not accessible to all nodes in vCenter.
LogsE0107 02:24:45.512865 1 controller.go:957] error syncing claim "#########################": failed to provision volume with StorageClass "########": rpc error: code = Internal desc = failed to create volume. Errors encountered: [Datastore: ds:///vmfs/volumes/#########################/ specified in the storage class is not accessible to all nodes in vCenter "#########################"]
I0107 02:24:45.512877 1 event.go:364] Event(v1.ObjectReference{Kind:"PersistentVolumeClaim", Namespace:"############", Name:"#########################", UID:"#########################", APIVersion:"v1", ResourceVersion:"380544", FieldPath:""}): type: 'Warning' reason: 'ProvisioningFailed' failed to provision volume with StorageClass "######": rpc error: code = Internal desc = failed to create volume. Errors encountered: [Datastore: ds:///vmfs/volumes/#########################/ specified in the storage class is not accessible to all nodes in vCenter "#########################".]
2.x
The datastore specified in the Storage Class is not mounted on the ESXi host where the worker node resides.
kubectl get sc -o wideIf the datastore is permanently decommissioned or cannot be mounted to the ESXi host for any reason, then follow the below steps to update the storage class with a new datastore UUID that is accessible to the ESXi host.
kubectl get sc vsphere-sc -o yaml > vsphere-sc-backup.yamlkubectl delete sc vsphere-sckubectl patch pvc <PVC name> -n <name space> -p '{"metadata":{"finalizers":null}}' --type mergekubectl patch sc <storage class name >-p '{"metadata":{"finalizers":null}}' --type mergeat <<EOF | kubectl apply -f -
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: <Storage Class name>
annotations:
storageclass.kubernetes.io/is-default-class: "true"
parameters:
datastoreurl: ds:///vmfs/volumes/<New Datastore UUID>/
provisioner: csi.vsphere.vmware.com
reclaimPolicy: Delete
volumeBindingMode: WaitForFirstConsumer
allowVolumeExpansion: true
EOF
kubectl delete pvc <PVC name> -n <namespace>