Skip to content

Commit 71e2f75

Browse files
committed
update readme - troubleshooting steps for stuck volume snap deletion operation
1 parent a104d84 commit 71e2f75

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

README.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,31 @@ One can simlpy delete the volume snapshot created in kubernetes using
178178
kubectl delete volumesnapshot snapshot-1 # here, snapshot-1 is the name of the snapshot created
179179
```
180180

181+
If for whatever reason, snapshot deletion gets stuck, one can troubleshoot the issue doing the following:
182+
183+
* Inspect the snapshot
184+
185+
```
186+
kubectl get volumesnapshot <snapshot-name> [-n <namespace>] -o yaml
187+
```
188+
189+
Look for the following section:
190+
```
191+
metadata:
192+
finalizers:
193+
- snapshot.storage.kubernetes.io/volumesnapshot-as-source
194+
```
195+
196+
If finalizers are present, Kubernetes will not delete the resource until they are removed or resolved.
197+
198+
* Patch to Remove Finalizers
199+
200+
```
201+
kubectl patch volumesnapshot <snapshot-name> [-n <namespace>] --type=merge -p '{"metadata":{"finalizers":[]}}'
202+
```
203+
204+
**NOTE:** This bypasses cleanup logic. Use only if you're certain the snapshot is no longer needed at the CSI/backend level
205+
181206
### What happens when you restore a volume from a snapshot
182207
* The CSI external-provisioner (a container in the cloudstack-csi-controller pod) sees the new PVC and notices it references a snapshot
183208
* The CSI driver's `CreateVolume` method is called with a `VolumeContentSource` that contains the snapshot ID

0 commit comments

Comments
 (0)