From 9a472c53f65c55337daed3e8d974958764e3b2d6 Mon Sep 17 00:00:00 2001 From: Komh Date: Sat, 2 May 2026 08:32:07 +0000 Subject: [PATCH 1/2] =?UTF-8?q?[storage]=20vSphere=20CSI=20provisioning=20?= =?UTF-8?q?fails=20with=20"empty=20list=20of=20node=20VMs"=20=E2=80=94=20w?= =?UTF-8?q?rong=20datastore=20path?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...y_list_of_node_VMs_wrong_datastore_path.md | 123 ++++++++++++++++++ 1 file changed, 123 insertions(+) create mode 100644 docs/en/solutions/vSphere_CSI_provisioning_fails_with_empty_list_of_node_VMs_wrong_datastore_path.md diff --git a/docs/en/solutions/vSphere_CSI_provisioning_fails_with_empty_list_of_node_VMs_wrong_datastore_path.md b/docs/en/solutions/vSphere_CSI_provisioning_fails_with_empty_list_of_node_VMs_wrong_datastore_path.md new file mode 100644 index 000000000..80a4a0b72 --- /dev/null +++ b/docs/en/solutions/vSphere_CSI_provisioning_fails_with_empty_list_of_node_VMs_wrong_datastore_path.md @@ -0,0 +1,123 @@ +--- +kind: + - Troubleshooting +products: + - Alauda Container Platform +ProductsVersion: + - 4.1.0,4.2.x +--- +## Issue + +The cluster's storage operator goes `Degraded` and every PVC that targets the vSphere CSI StorageClass stays in `Pending`. The provisioner sidecar logs an `empty List of Node VMs returned from nodeManager` error: + +```text +csi.vsphere.vmware.com_vsphere-csi-controller-... + failed to provision volume with StorageClass "csi": + rpc error: code = Internal desc = failed to get shared datastores + in kubernetes cluster. + Error: empty List of Node VMs returned from nodeManager +``` + +A `kubectl describe pvc` on any pending claim adds the smoking gun: + +```text +failed: unable to fetch default datastore url: + failed to access datastore //datastore/: + datastore '//datastore/' not found +``` + +## Root Cause + +The vSphere CSI driver discovers the cluster's nodes by walking the configured datacenter and finding the VMs that share a datastore. If the datastore path it is told to use does not actually exist in vCenter (typo, datastore renamed, datastore moved into a folder), the driver cannot enumerate any node VMs against it. With zero node VMs the provisioner has nothing to schedule the volume to and fails with `empty List of Node VMs`. + +The path the driver believes is the truth comes from two places — they have to agree, and they have to match what vCenter actually shows: + +- The `cloud-provider-config` ConfigMap that the storage operator mounts into the vSphere CSI controller. +- The cluster-level Infrastructure CR's `spec.platformSpec.vsphere` (or equivalent platform CR), where the datastore is recorded for the platform as a whole. + +When the path is wrong, every CSI provisioning attempt fails the same way — the symptom is a bound, healthy CSI driver pod producing identical errors for every claim. + +## Resolution + +Correct the datastore path on the configuration that the CSI driver reads, then restart the driver pods so they pick it up. + +### 1. Read the current configuration + +```bash +kubectl get cm -n cloud-provider-config -o yaml +kubectl get infrastructure cluster -o yaml +``` + +Compare the `datastore` (or `defaultDatastore`) entry against what vCenter reports. The path is `//datastore/` — including any folder a vSphere admin may have moved the datastore into. A datastore that lives under `Datacenter/datastore/Cluster-A/ds01` resolves to `/Datacenter/datastore/Cluster-A/ds01`, not `/Datacenter/datastore/ds01`. + +### 2. Fix the path + +Patch the ConfigMap in place: + +```bash +kubectl edit cm -n cloud-provider-config +# or, scripted: +kubectl get cm -n cloud-provider-config -o yaml \ + | sed 's|||g' \ + | kubectl apply -f - +``` + +If your platform exposes vSphere settings through the platform CR, update both — the operator may overwrite the ConfigMap from the CR on the next reconcile. The exact CR name depends on the cluster, but the field is the datastore path: + +```yaml +spec: + platformSpec: + vsphere: + vcenters: + - datacenters: [] + failureDomains: + - topology: + datastore: //datastore/ +``` + +### 3. Restart the CSI driver + +The driver caches the datastore lookup at startup. After the path is corrected, bounce the controller and node DaemonSet pods so they re-read it: + +```bash +kubectl -n rollout restart deploy/vsphere-csi-controller +kubectl -n rollout restart ds/vsphere-csi-node +kubectl -n rollout status deploy/vsphere-csi-controller +``` + +### 4. Verify + +```bash +kubectl get pvc -A | grep -v Bound # no more Pending claims on the vSphere SC +kubectl get co/storage 2>/dev/null # if a storage cluster operator is present +kubectl logs -n deploy/vsphere-csi-controller \ + -c csi-provisioner --tail=50 | grep -iE 'empty list|provision' +``` + +A clean controller log and a fresh PVC binding within seconds is the signal the path resolves. + +## Diagnostic Steps + +1. Capture the failure on the PVC itself — the datastore path it could not access is printed verbatim: + + ```bash + kubectl describe pvc -n | sed -n '/Events/,$p' + ``` + +2. Verify the path on the ConfigMap and the infrastructure CR are identical (a mismatch means an operator will overwrite your fix on its next reconcile): + + ```bash + kubectl get cm -n cloud-provider-config \ + -o jsonpath='{.data.config}' | grep -i datastore + kubectl get infrastructure cluster -o yaml | yq '.spec.platformSpec.vsphere' + ``` + +3. From a node or jumphost with vCenter access, list the datastores under the datacenter and confirm the spelling and folder path are exactly what the cluster has configured. If the datastore was renamed or moved, both ends of that change have to be reflected in the cluster config. + +4. If the driver still complains after the path is fixed and the pods are restarted, look for stale `CSINode` objects pointing at hosts that no longer exist: + + ```bash + kubectl get csinodes -o yaml | yq '.items[] | {name: .metadata.name, drivers: .spec.drivers[].name}' + ``` + + Any `csinode` for a removed host can be deleted manually; the driver re-registers live nodes automatically. From 4db364b908595b8426b5cc932c03ae7e22bd09c5 Mon Sep 17 00:00:00 2001 From: Komh Date: Sat, 2 May 2026 13:46:43 +0000 Subject: [PATCH 2/2] =?UTF-8?q?[storage]=20vSphere=20CSI=20provisioning=20?= =?UTF-8?q?fails=20with=20"empty=20list=20of=20node=20VMs"=20=E2=80=94=20w?= =?UTF-8?q?rong=20datastore=20path?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ng_fails_with_empty_list_of_node_VMs_wrong_datastore_path.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/en/solutions/vSphere_CSI_provisioning_fails_with_empty_list_of_node_VMs_wrong_datastore_path.md b/docs/en/solutions/vSphere_CSI_provisioning_fails_with_empty_list_of_node_VMs_wrong_datastore_path.md index 80a4a0b72..c1a6e0d6c 100644 --- a/docs/en/solutions/vSphere_CSI_provisioning_fails_with_empty_list_of_node_VMs_wrong_datastore_path.md +++ b/docs/en/solutions/vSphere_CSI_provisioning_fails_with_empty_list_of_node_VMs_wrong_datastore_path.md @@ -6,6 +6,8 @@ products: ProductsVersion: - 4.1.0,4.2.x --- + +# vSphere CSI provisioning fails with "empty list of node VMs" — wrong datastore path ## Issue The cluster's storage operator goes `Degraded` and every PVC that targets the vSphere CSI StorageClass stays in `Pending`. The provisioner sidecar logs an `empty List of Node VMs returned from nodeManager` error: