A volume failed to create on vSphere CNS (Cloud Native Storage) with CSI plugin (Cloud Storage Interface). It failed with the following error:
"failed to create volume. Error: ServerFaultCode: CNS AuthZ: Non-vsan datastores type VMFS in createSpecs"
Product Version: 1.9
CNS on vSphere is used to provision volumes on vSphere. CSI has been verified as per the following doc and a Storage Class has been created using non-VSAN datastore:
Deploying CNS on vSphere
However when an attempt is made to create a PVC, it fails.
Creation of PVC fails with the following error:
Warning ProvisioningFailed 31m (x16 over 70m) csi.vsphere.vmware.com_vsphere-csi-controller-7f7c7b7d5-fqr6f_38b62106-c5fa-4330-a637-3b79bf788145 failed to provision volume with StorageClass "aaaaaaa": rpc error: code = Internal desc = failed to create volume. Error: ServerFaultCode: CNS AuthZ: Non-vsan datastores type VMFS in createSpecs
Check the Storage Class and PVC:
kubectl describe sc <Storage Class NAME> kubectl get pvc <Persistent Volume Claim Name>
For non-VSAN storage, if the PVC AccessMode is set to ReadWriteMany, the PVC will fail to provision with the error above. The PVC AccessMode should be ReadWriteOnce. Check the Compatibility Matrix in the link below for details on compatibility between vSphere Version, CSI version, Datastore stores, AccessModes etc.
vSphere CSI supported kubernetes functionality
Change the AccessMode to ReadWriteOnce for the PVC and recreate it.