Warning VolumeResizeFailed persistentvolumeclaim/… resize volume "<volume-id>" by resizer "csi.vsphere.vmware.com" failed: rpc error: code = FailedPrecondition desc = volume: <volume-id> with existing snapshots […] can’t be expanded. Please delete snapshots before expanding the volumekubectl get volumesnapshots -A, no volume snapshots are present. VMware Tanzu Kubernetes Grid (TKG) 2.x
VolumeSnapshot, creating a physical FCD snapshot on the vSphere datastore and a corresponding VolumeSnapshotContent object in Kubernetes. To protect the snapshot during active data movement, the backup controller may temporarily patch the VolumeSnapshotContent deletion policy to Retain.VolumeSnapshot object before the vCenter API receives the call to delete the physical backend snapshot.The orphaned snapshots must be manually removed from the vSphere datastore using the govc CLI.
Identify the CSI Volume Handle (UUID) for the affected PersistentVolume:
kubectl get pv <pv-name> -o jsonpath='{.spec.csi.volumeHandle}'
Authenticate the govc CLI tool with the underlying vCenter Server.
List the existing orphaned snapshots for the volume on the vSphere datastore to verify their presence:
govc disk.snapshot.ls -dc="<datacenter-name>" -ds="<datastore-name>" "<volume-id>"
Remove the orphaned snapshot(s) from the backend datastore: govc disk.snapshot.rm -dc="<datacenter-name>" -ds="<datastore-name>" "<volume-id>" "<snapshot-id>"
Note: To remove multiple snapshots at once, you can pipe the output:
govc disk.snapshot.ls -dc="<datacenter-name>" -ds="<datastore-name>" "<volume-id>" | awk '{print $1}' | while read snapShot ; do govc disk.snapshot.rm -dc "<datacenter-name>" -ds "<datastore-name>" "<volume-id>" $snapShot ; done
Once the vCenter backend confirms the snapshots are deleted, the vSphere CSI controller will detect the change, the precondition will pass, and the pending PVC expansion will automatically proceed. Verify the PVC status:
kubectl describe pvc <pvc-name>