File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -178,6 +178,31 @@ One can simlpy delete the volume snapshot created in kubernetes using
178178kubectl 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
You can’t perform that action at this time.
0 commit comments