Why can't I delete my Block Storage for VPC volume snapshot resources?
Infrastructure provider: VPC
When you try to remove your volumesnapshot
and volumesnapshotcontents
objects, the removal fails, but your volume snapshot object shows a ReadyToUse
status as false
.
There are finalizers preventing the resources from being removed.
Remove the finalizers and continue deleting the resources. Note that stale volumesnapshot
and volumesnapshotcontents
objects can cause unnecessary CreateSnapshot
requests, which can eventually lead to request
spamming.
If the volumesnapshot
and volumesnapshotcontent
objects are included as a single mapping, follow these steps.
- Delete the
volumesnapshot
andvolumesnapshotcontent
objects.kubectl delete volumesnapshot snapshot-csi-block-3
- Remove the
finalizers
section from thevolumesnapshot
resource.kubectl patch volumesnapshot/VOLUMESNAPSHOT --type json --patch='[ { "op": "remove", "path": "/metadata/finalizers" } ]'
- Remove the
finalizers
section from thevolumesnapshotcontents
resource.kubectl patch volumesnapshotcontent/snapcontent-VOLUMESNAPSHOTCONTENT --type json --patch='[ { "op": "remove", "path": "/metadata/finalizers" } ]'
If the volumesnapshot
object is deleted, but volumesnapshotcontent
object still exists, follow these steps to remove the volumesnapshotcontent
object.
- Find
volumesnapshotcontent
object that do not have aReadyToUse
status as empty orfalse
.kubectl get volumesnapshotcontents | egrep -v 'true'
- Delete the snapshot object.
kubectl delete volumesnapshotcontent snapcontent-011b11d1-1101-4b11-b1b1-011abcde11db
- Remove the finalizer.
kubectl patch volumesnapshotcontent/snapcontent-011b11d1-1101-4b11-b1b1-011abcde11db --type json --patch='[ { "op": "remove", "path": "/metadata/finalizers" } ]'
If the issue persists, contact support. Open a support case. In the case details, be sure to include any relevant log files, error messages, or command outputs.