Open jmccormick2001 opened 2 months ago
We need to discuss more about this as this would require a CSI spec change.
cc @bswartz
@jmccormick2001 Can you please provide logs? DeleteVolumeGroupSnapshot should not cause ControllerDeleteSnapshot() to really delete the individual snapshot. It should be skipped quickly. If not, there is a bug that we need to fix.
sure, attached is the driver log that shows the calls to ControllerDeleteSnapshot(). Here is how I'm recreating this:
That all works as expected, I see the snapshots on our storage device as planned. Then I delete the VolumeGroupSnapshot to trigger the deletion. The delete of the VolumeGroupSnapshot works as expected, but notice what is going on in the driver log, it calls ControllerDeleteSnapshot() twice, one for each PVC/volume.
I suspect this is by design, but we have a feature on the storage device that is a single call, that essentially says, delete the entire snap group in an atomic fashion instead of individually deleting snapshots one-by-one that are included in the group.
We are supposed to skip the CSI driver call to delete individual snapshots in this PR but I think we missed it: https://github.com/kubernetes-csi/external-snapshotter/pull/972. We can add a check in syncContent() not to call the CSI driver if VolumeSnapshotContent status has a VolumeGroupSnapshotHandle: https://github.com/kubernetes-csi/external-snapshotter/blob/v8.1.0/pkg/sidecar-controller/snapshot_controller.go#L63
/assign
We also encountered this problem when we verified GroupVolumeSnapshot, looking forward this to be resolved~
Is your feature request related to a problem?/Why is this needed I notice that when I delete a volume group snapshot, and DeleteVolumeGroupSnapshot() is called, that the snapshotter calls ControllerDeleteSnapshot() for each snapshot belonging to the volume group. For some storage devices, removing a volume group causes the underlying/associated snapshots to be removed in an atomic fashion without having to remove each snapshot individually.
Describe the solution you'd like in detail I would like some way to turn off the default behavior of having calls to ControllerDeleteSnapshot() for each snapshot when DeleteVolumeGroupSnapshot() is invoked. This way, I can have our storage device be responsible for removing each associated snapshot.
Describe alternatives you've considered One alternative is to make our storage device APi call specify that we do not want the storage device to cleanup or remove the dependent snapshots.
Additional context