Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Volumesnapshots component missing? #33

Closed
ishioni opened this issue Oct 14, 2022 · 8 comments
Closed

Volumesnapshots component missing? #33

ishioni opened this issue Oct 14, 2022 · 8 comments
Labels
documentation Improvements or additions to documentation question Further information is requested

Comments

@ishioni
Copy link

ishioni commented Oct 14, 2022

I wanted to roll out velero for backups which seems to require volumesnapshots

However, if I try to test it out with an example volumesnapshot from the link above I get

no matches for kind "VolumeSnapshot" in version "snapshot.storage.k8s.io/v1beta1"

This is on k3s 1.23.12. I see in your e2e test you have a volumesnapshotclass, and I see democratic-csi deploys the snapshot-controller as a component for this to work. I know this is not strictly truenas-csp related, but which component am I missing for snapshots here?

@datamattsson
Copy link
Collaborator

Where did you find the example VolumeSnapshot stanza? You need to call out "snapshot.storage.k8s.io/v1" since Kubernetes 1.20 (well, I'm not sure when "v1beta1" got fully removed). Check example here: https://kubernetes.io/docs/concepts/storage/volume-snapshots/#volumesnapshots

(I also noticed my error in the e2e test suite that calls out the wrong API version)

Anyhow, it's supposed to be up to the Kubernetes distribution vendor to install the external snapshot controller. Not many distributions actually provide this. So, if you want to enable volume snapshots for the TrueNAS CSP you may follow the instructions found with the HPE CSI Driver.

@datamattsson datamattsson added the question Further information is requested label Oct 14, 2022
@ishioni
Copy link
Author

ishioni commented Oct 14, 2022

Where did you find the example VolumeSnapshot stanza?

Exactly the same link from the one you posted :)

So, if you want to enable volume snapshots for the TrueNAS CSP you may follow the instructions found with the HPE CSI Driver.

Ah, so as I suspected, I need external-snapshot-controller. Could you maybe link that info in the Readme somewhere?

Thanks for the support!

@ishioni ishioni closed this as completed Oct 14, 2022
@datamattsson
Copy link
Collaborator

Thanks for the suggestion. I'll have a look to have this outlined on the INSTALL to ensure there are pointers to enable and use VolumeSnapshots.

@datamattsson datamattsson reopened this Oct 14, 2022
@datamattsson datamattsson added the documentation Improvements or additions to documentation label Oct 14, 2022
@ishioni
Copy link
Author

ishioni commented Oct 14, 2022

@datamattsson I'm playing around with this now, snapshot-controller in tow. However, I think that's not how it's supposed to work

Consider this scenario
I create a pvc - my-pv
I create a volumesnapshot out of it - my-pv-snapshot -
I delete the original pvc
I create a new pvc out of the snapshot - It now references (in my case) SSD_k3s_pvc-f72e0ff5-33cf-40fb-b488-6b960928f53b@snapshot-2f5d1c03-9dba-448b-b426-c71ac2f1c3f9, which is a zfs snapshot of a zvol that doesn't exist anymore, and subsequently fails

Hence all snapshots are bound to a backing zvol. If that zvol were to be deleted by for example killing the underlying pv, then those snapshots are dead, providing no protection

@datamattsson
Copy link
Collaborator

Would we like zvols which has snapshots created by the CSI driver to be retained on the backend? I'm not sure why PVs with snapshotcontent derived from them aren't protected. It's odd.

@ishioni
Copy link
Author

ishioni commented May 6, 2023

Yeah, it's a quirk of how snapshots are handled by zfs, where the snapshots are bound to the originating zvol/dataset. Democratic CSI has an option to clone the zvol/dataset outright.

That being said, you should know i've moved on to using nvmeof, so if you do change the handling I won't be able to test it out

@datamattsson
Copy link
Collaborator

Democratic CSI has an option to clone the zvol/dataset outright.

Interesting, like doing a send/recv asynchronously within the same pool?

@datamattsson
Copy link
Collaborator

Add hints to INSTALL.md.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants