VolumeSnapshot deletion behavior #6214
Replies: 5 comments 7 replies
-
In today's community call, it was agreed that VolumeSnapshot resources are expected to be removed at the end of the backup so the current behavior is a bug. We will work on a fix.
|
Beta Was this translation helpful? Give feedback.
-
Yes, it could be something on my system. I was testing with minikube. I did see the problem last evening but I need to check further to see if there is a finalizer blocking the deletion. |
Beta Was this translation helpful? Give feedback.
-
I tested on two different minikube clusters with 1.11 and see VolumeSnapshot still being left over. Since I enabled debug, I expected to see this message: "Deleting VolumeSnapshot ..." but I don't see it. More over, I don't see "deletionTimestamp" in VolumeSnapshot resource so both these facts point to the fact that Velero hasn't tried to delete the resource. I will debug this further by building main locally. |
Beta Was this translation helpful? Give feedback.
-
The mystery is finally resolved. I used the feature flag "enableCSI" while installing Velero but the actual value should be "EnableCSI". The code that deletes volume snapshots checks if CSI feature is enabled by comparing against "EnableCSI" which, in my case, returns false. So the deletion code is skipped. Once I used the right version of feature name, I could see that volume snapshots are deleted as expected. I can think of several improvements that can be made:
|
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
The page at https://velero.io/docs/v1.11/csi/ mentions this:
"The VolumeSnapshot objects will be removed from the cluster after the backup is uploaded to the object storage, so that the namespace that is backed up can be deleted without removing the snapshot in the storage provider if the DeletionPolicy is `Delete."
Also, the release notes of 1.9.0 at https://github.com/vmware-tanzu/velero/releases/tag/v1.9.0 has this:
"No VolumeSnapshot is left in the source namespace of the workload after a backup finishes."
But this doesn't seem to be the behavior based on my testing using Velero 1.11 and CSI plugin 0.5.0. I see that VolumeSnapshot resources remain in the source namespace after the backup is complete. This happens irrespective of how "deletionPolicy" is configured on the corresponding class.
I will check the code but wanted to post here if anyone else has some info in this regard.
Beta Was this translation helpful? Give feedback.
All reactions