PVC creations fails with error "CnsFault error: No compatible datastore found for storagePolicy"
In the vCenter logs in /var/log/vmware/vsan-health/vsanvcmgmtd.log, the following error is logged:
CNS: Workflow current action has fault (vim.fault.CnsFault) {--> faultCause = (vmodl.MethodFault) null,--> faultMessage = <unset>,--> reason = "No compatible datastore found for storagePolicy: xxxxx-xxxxxxx-xxxx-xxxxxxx"--> msg = ""
Checking the CSI Controller logs on the Supervisor you will see the same error as above: k logs -n vmware-system-csi vsphere-csi-controller-xxxxxxxxx-xxxx-xxx -c vsphere-csi-controller | less
No compatible datastore found for storagePolicy
Check the datastore that the affected storage policies are using, get the MOID of that datastore and check the CSI controller log file from the command above. Search for "Found shared datastores". The required datastore MOID is not listed under "Found shared datastores":
"Found shared datastores: [Datastore: Datastore:
vCenter 7.0
vCenter 8.0
vSphere with Tanzu
This issue will occur if the datastore that storage policy is using is not shared across all hosts.
For example the datastore may not be shared with one host which might be in maintenance mode.
By right clicking the datastore, select the option to "Mount Datastore on Additional Hosts".
Then select any ESXI host that is listed so that the datastore gets shared to this ESXI host.
Once the datastore has been shared across all ESXI hosts, confirm the PVC creation is successful.
Refer to this document: https://techdocs.broadcom.com/us/en/vmware-cis/vsphere/vsphere-supervisor/8-0/installing-and-configuring-vsphere-supervisor/create-storage-policies-for-vsphere-iaas-control-plane.html
Make sure that the datastore you reference in the storage policy is shared between all ESXi hosts in the cluster. Any shared datastores in your environment are supported, including VMFS, NFS, vSAN, or vVols.