PV creation fails with "no datastores found to create file volume"
search cancel

PV creation fails with "no datastores found to create file volume"

book

Article ID: 320800

calendar_today

Updated On:

Products

VMware VMware vCenter Server

Issue/Introduction

Symptoms:

Persistent volume creation fails and csi-provisioner container in CSI Controller Pod reports the following error:

ProvisioningFailed failed to provision volume with StorageClass "storage-class-name": rpc error: code = Internal desc = no datastores found to create file volume.

 

 

 

Environment

VMware vCenter Server 7.0.x
VMware Tanzu Kubernetes Grid Integrated Edition 1.x

Cause

The PVC has specified an access mode of ReadWriteMany and this is not supported by the datastore.
In CSI v2.0, ReadWriteMany is only supported through the use of vSAN File Services on vSAN datastore. https://docs.vmware.com/en/VMware-vSphere-Container-Storage-Plug-in/2.0/vmware-vsphere-csp-getting-started/GUID-D4AAD99E-9128-40CE-B89C-AD451DA8379D.html#GUID-E59B13F5-6F49-4619-9877-DF710C365A1E__GUID-ADF6F066-9A96-4E54-8154-66519AA65B39

Resolution

Recreate PVC with accessModes set to ReadWriteOnce.
Or create a Storage Class that uses vSAN File Service to access vSAN datastore https://docs.vmware.com/en/VMware-vSphere/7.0/com.vmware.vsphere.vsan.doc/GUID-82565B82-C911-42F7-85B1-E9EF973EE90C.html

If the no datastores found to create file volume error persists after correctly configuring vSAN File Services and an appropriate storage class please ensure to also check that the correct privileges have been assigned to the CSI driver user in vSphere. For more information, see the Preparing for Installation of vSphere Container Storage Plug-in section in the VMware vSphere Container Storage Plug-in Documentation
(In particular this additional privilege required for file volumes Host > Configuration > Storage partition configuration)