PVC creation fails with "failed to provision volume with StorageClass "<storage class name>": rpc error: code = Internal desc = failed to create volume. Error: failed to add task to list view. err: failure to add task to listview. task: Task:task-<task id>, err: ServerFaultCode: The session is not authenticated."
root@42181db5080a1686496fb4fe000faa8d [ ~ ]# kubectl describe pvc <pvc name> -n <namespace>
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Normal Provisioning 35s (x9 over 4m48s) csi.vsphere.vmware.com_42<> External provisioner is provisioning volume for claim <namespace>/<pvc name>"
Warning ProvisioningFailed 35s (x9 over 4m48s) csi.vsphere.vmware.com_<> failed to provision volume with StorageClass "wcp-policy": rpc error: code = Internal desc = failed to create volume. Error: failed to add task to list view. err: failure to add task to listview. task: Task:task-<task>, err: ServerFaultCode: The session is not authenticated.
Normal ExternalProvisioning 2s (x21 over 4m48s) persistentvolume-controller Waiting for a volume to be created either by the external provisioner 'csi.vsphere.vmware.com' or manually by the system administrator. If volume creation is delayed, please verify that the provisioner is running and correctly registered.
vSphere 7.0
vSphere 8.0
After a vCenter reboot or restart of vsan-health the session is no longer valid.
This situation may also occur after upgrading/patching ESXI hosts.
CSI controller needs to be restarted in order for a new session to be created.
kubectl rollout restart deployment -n vmware-system-csi vsphere-csi-controller
Details on the issue in https://github.com/kubernetes-sigs/vsphere-csi-driver/pull/3064