openebs / zfs-localpv

Dynamically provision Stateful Persistent Node-Local Volumes & Filesystems for Kubernetes that is integrated with a backend ZFS data storage stack.
https://openebs.io
Apache License 2.0
422 stars 102 forks source link

do not attempt to delete the ZFSVolume CR if there is a snapshot holding it. #123

Open pawanpraka1 opened 4 years ago

pawanpraka1 commented 4 years ago

ZFSPV allows to delete the volume if snapshot exist for that volume.In this case the node agent keeps on trying to delete the volume and fails to do so since there is a snapshot for the volume, but the PVC and PV get deleted.

Here, we can fail the ZFSVolume deletion, if there is a snapshot on it. PVC will still be deleted and in background the CSI Provisioner will keep on trying to delete the volume and we keep on failing that request until there is a snapshot on it.

Before attempting the delete here :

https://github.com/openebs/zfs-localpv/blob/d47ec3ba01ab9434629239b9a98413ad8a7a2b27/pkg/driver/controller.go#L271

We should check for snapshot and if it exist, fail the deletion.

ghost commented 4 years ago

Also an issue with deleting snapshots that are in use by clones.

pawanpraka1 commented 4 years ago

Thanks @chornlgscout for adding the issue related to snapshot deletion when it is in use by clone. Are you already using ZFS-LoclaPV? Could you please let us know your use case and what features you are specifically looking for?

sinhaashish commented 3 months ago

There is a PR to close this issue, but that needs some refactoring, its under review.

avishnu commented 1 week ago

The comment on the fix PR https://github.com/openebs/zfs-localpv/pull/350#issuecomment-1734502664 indicates a possible way to successfully delete the volume by promoting the clone on the oldest snapshot. This functionality will be considered as a future enhancement.

avishnu commented 1 week ago

Tentatively targeting for v4.2