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

Feature request: Support CSI PV Cloning #439

Open
sandrotanner opened this issue Jun 21, 2022 · 5 comments
Open

Feature request: Support CSI PV Cloning #439

sandrotanner opened this issue Jun 21, 2022 · 5 comments

Comments

@sandrotanner
Copy link

sandrotanner commented Jun 21, 2022

What did you do? (required. The issue will be closed when not provided.)

Try to clone a volume snapshot (CSI PV Cloning, see https://kubernetes-csi.github.io/docs/volume-cloning.html

What did you expect to happen?

That it was possible.
Thanks in advance (see https://ideas.digitalocean.com/app-framework-services/p/doks-support-csi-pv-cloning for more info)

Configuration (MUST fill this out):

  • CSI Version: 4.0.0
@sandrotanner sandrotanner changed the title Feture request: Support CSI PV Cloning Feature request: Support CSI PV Cloning Jun 21, 2022
@timoreimann
Copy link
Collaborator

I think this is a reasonable request and something that could also be contributed externally.

@sandrotanner
Copy link
Author

sandrotanner commented Jul 12, 2022

Thanks @timoreimann

I am not sure if it would be possible to contribute this externally. The reason for this is, that AFAIK we have no possibility to get information about the volume snapshot state/completion/progress (with droplet snapshots this was made possible a couple of years back, but the volume snapshots never followed). And I don't know if a implementation without first creating a snapshot and then basically doing

if contentSource != nil && contentSource.GetSnapshot() != nil {
is possible.

Or maybe I am looking at it from the wrong angle (didn't do a whole lot of research yet tbh)? If it is possible I am gladly willing to contribute of course :)

@timoreimann
Copy link
Collaborator

timoreimann commented Jul 25, 2022

To be on the same page terminology-wise, what I think CSI cloning is about is the ability to create a volume from another volume. What DigitalOcean's CSI driver supports today already is creating a volume from an existing snapshot (which is called snapshot backup & restore). IMHO the CSI spec for CreateVolume makes the distinction more clear.

Looking at the Block Storage API, I think you're right that there is currently no support for copying/cloning a volume directly, and one would need to go via snapshotting a volume first. I don't think we'd need any progress indicator though as snapshots seem to be available immediately. (At least, there is no snapshot action available to be polled as we do on volumes.) This might be because snapshotting is done technically different than most volume actions unless the latency is not exposed and comes back as some kind of error. That's something to verify.

The perhaps bigger concern to me is the added complexity of having to create and restore from a snapshot, especially when considering what could go wrong and how to recover the right state. I'm thinking of things like the clone flow breaking in-between, and the CSI driver subsequently having to recover what needs to be done on a retry (i.e., determine if a snapshot has been created already or not). This is probably doable, but some effort would be required to get it right.

I'll talk to our Storage team to ensure my understanding of the level of cloning support is correct and get feedback on how this could be done with the current API.

@timoreimann
Copy link
Collaborator

It looks like implementing this through snapshotting is the way to go for us.

@nielsvanoosterom-varias
Copy link

Would love to see this supported. I was hoping to use Kubernetes Stash's interimVolumeTemplate feature to clone a PVC
by referencing it in the dataSource field, and then using the clone to create an off-site backup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants