-
Notifications
You must be signed in to change notification settings - Fork 554
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
How to migrate from csi-driver 0.3 -> csi-driver csi-1.0 #296
Comments
@ShyamsundarR @humblec do we support migration? |
@sbskas Currently the PV naming scheme in 1.0 is undergoing more changes, thus the naming would be different than what was present in v0.3 of the Ceph-CSI implementation. As this is immutable post creation, a direct upgrade to the v1.0 version from v0.3 version is not feasible. We also have to analyze the breaking changes from the perspective of the CSI spec itself to understand what else may break on such upgrades. As of now we do not have any migration steps to move from 0.3 to 1.0. Possibilities are,
|
@ShyamsundarR, naming is not an issue. PV has all information to work by itself, even after storageclass deletion as long as finalizer,provisioner, and attacher are able to process it. My main point is indeed the PV are immutable so are the pvc. |
The mentioned repository is now updated to point to this one instead: https://github.com/kubernetes/kubernetes/tree/master/staging/src/k8s.io/csi-translation-lib |
Question: Supposing we state the following support statement for volumes (and snapshots) created using existing 0.3 and 1.0 versions of the Ceph-CSI drivers (rbd and CephFS), is it sufficient to address any concerns with already in use plugins? For volumes created using 0.3 and existing 1.0 versions of the Ceph-CSI plugins the following actions would be supported by a future version of the plugin,
And, the following would be unsupported:
|
I think there's multiple things maybe here.... This issue is talking about specifically 0.3 -> 1.0 ? The driver rename happend post 1.0. as I got hit by that and I manually burned down all my 0.3 volumes and deployed 1.0 fresh and then the driver rename happened. Then there's the issue where they want to drop configmaps and push that info into ceph directly (I support this) But thats already potentially 2 issues, post 1.0 where things are breaking or close to breaking. I'm kind of ok not having a migration path from 0.3 to 1.0 as it doesn't effect me anymore. I already took that hit. but post 1.0 that is a problem. we guarantee some stability so should provide some kind of migration path or ongoing support. For the configmap -> ceph migration, I'd be ok with some out of band tool that dumped the configmaps and loaded them into ceph. Then the code doesn't have to stick around in driver forever. Make it a migration step. |
For me, I think it should be enough. |
the pv's cant be edited after they are created. The apiserver blocks changes. |
I can see 3 possible solutions to that:
option two might be the most expedient and safe |
I would not vote for the above, just for this plugin, seems like a lot of work.
Wouldn't the PV delete step move it to "pending" state if the driver is not up? and, hence not really delete the PV till the driver is back up again, at which point the real PV on Ceph gets deleted as well? To prevent this, would an option in 0.3/1.0 versions of the plugin work, that would fake a delete? IOW, respond success for a delete, but in reality not delete anything in the Ceph Cluster? (just a thought, as I attempt to run these steps on a test cluster)
|
Yeah. maybe an extra step of: update the pv's to have state so they get deleted is needed. If the driver isn't running, its probably ok? |
Another migration option would be to swap things around directly on the ceph back end... Assume: Both 0.3 and 1.0 can co-exist during the migration Starting w/ a 0.3 PVC/PV pair: pvc/myvol and pv/myvol:
The original data should now be visible in the new PVC: pvc/myvol-1.0. If you really must have the same PVC name, either CSI clone it back into pvc/myvol or do the above steps again. |
Ran the above procedure on a test cluster, and it works as required (thanks @JohnStrunk ). @kfox1111 and @sbskas this would be the way to migrate, without leaving behind any older PVCs with older metadata for a longer duration, or without having to copy out the data. Let me know your thoughts, and we can possibly coordinate on scripts that can help achieve the same. Here are some more intermediate steps that can help clarify the procedure better:
|
Thanks for coming up with the procedure. looks like that was a fair amount of work. But it is also a very long procedure that has many potential places where a mistake could be made. I'm going to ask advice on the k8s sig-storage channel to see what other options are available. If there was a quick way to rename the driver under the hood, that may be preferable? |
Indeed, this is what we did to migrate the pv. Isn't there a simpler way of migrating thing like a mutatingwebhook to change the pv ? I was pointing to the csi-translation-library since one seems to be able to migrate old style PV to the new CSI without all those steps and I was wondering how they managed to do it ? |
@msau42 any ideas? |
The "simplest" I know of currently is to:
|
Hmm.. sounds like that might work... still a good chance of messing something up in the process. How possible would it be to make the csidriver field of the pv editable? |
That may fix this particular case, but doesn't solve the general issue of how to "upgrade" a PV. |
The problem is, pvc's and pv's are the abstraction between the user (pvc) and admin (pv) allowing scaleout of workload. If the admin has to deal with pvc's then it re-intertwines the workload from the cluster maintenance. This is especially hard on multitenant clusters. Being able to have a procedure that leaves the pvc's alone would be a huge benefit. Solving it completely generally may not be possible. Renaming a csidriver I expect to be a relatively common issue, as people will either not realize there is a convention and switch once they realize (like this driver) or the driver will someday change hands and want the driver name to go along. So, I'm kind of ok trying to find a solution to it, separately from trying to find a more general solution to allow editing of any pv. Is that reasonable? |
Name of the driver should be treated like any other API field. Once something is 1.0, then there are strict backwards compatibility rules that drivers need to follow. Anything pre 1.0 though does not have such strict guarantees. |
On another note, you should be able to run a 0.3 driver with name X, and a 1.0 with name Y alongside each other. They should be seen as 2 different drivers. However, you may need to make sure they're not clobbering each other's sockets |
so, should the driver be renamed back, since it started life in 1.0 with the other name? |
The 1.0 versioning was a misnomer IMO, as the version of the driver went along with the CSI spec version that it supported (it should have been a version for the driver, not the spec version). The problem is larger than the driver name in this case, we are changing the on-disk rbd image name and also the passed back |
I asked when backwards compatability would be honoured, and it sounded like the answer was, once the driver hit 1.0. So I thought 1.0 had a meaning there. I too have seen potentially breaking changes, but thus far they could be maintained unbroken by telling the chart to use the old name. I was planning on trying to block further breaking changes without migration plans. I'm still looking for a migration plan for allowing renaming the driver to move forward. For those running 1.0 and above, there is a non breaking plan. for 0.3 -> 1.0+, there isn't currently a plan. |
I did not fully understand this comment, hence asking for clarifications.
Could you point to the context in which this was answered. I am wondering if I answered this in some way or if this was before the current breaking changes under review.
I see that using the old name, would prevent any breakage till now, and the name is configurable, hence entirely feasible to use the older name as a solution to the driver name change in the code. Further, as per my understanding I thought and still think we are in pre-1.0 space, and hence we were making breaking changes to the code. Although, we stopped this one, as that would have required further PV spec edits had it got in.
Even for 1.0 -> 1.0+ (or maybe 2.0, depends on what it is versioned) it would be a breaking plan once we merge the on-disk changes. The migration plan (barring "PV upgrades" or ability to edit PV meta-data) would be to change up the names as in this comment which was tested with 1.0+ breaking changes in place. So we need to sort this out someway to allow for the breaking changes, such that we can support this more elegantly in the future. |
I think the discussion was offline with some folks. So, sorry I don't have history of it. :( #312 has not merged. This change in particular was the one I had in mind when I mentioned trying to block such changes unless there is a clear, reasonable migration plan. It Being under review isn't necessarily a bad thing as it allows progress to be made. But merging without a migration plan would be very bad/damaging to users. |
I did my initial experiments with 1.0 and 1.0+ code, hence repeated part of it (i.e running 2 CSI instances) with 0.3 today. I am able to run both instances without much trouble. The changes are,
A patch to the v1.0 helm chart looks like this to make it run as above.
Is the delete not working against the 0.3 version of the CSI Plugin? Request further details to enable testing the same. Thanks.
The translation library transforms the PV parameters, but helps when the older PV is from an in-tree provisioner (based on Kubernetes code reading at present). Further, with the future scheme of VolumeID based encoding the RBD image and cluster, such a simple transformation is not feasible (for example we need to feed the transformation engine details about the Ceph cluster and pool IDs etc. for it to work). This is an initial analysis of the csi translation based method. |
I'm closing the issue since we no longer are using the ceph-csi 0.3 and ceph-csi team decided to not support ceph-csi 0.3 -> ceph-csi 1.x.x migration. |
Syncing latest changes from upstream devel for ceph-csi
Since driver name changed and PV are tagged with driver-name, how do one migrate the already created PV from pre-csi-1.0 version to the new version.
Changing the driver in the persistent volume fails with :
"# persistentvolumes "pvc-638476e6264211e9" was not valid:
* spec.persistentvolumesource: Forbidden: is immutable after creation"
What's the plan then to migrate smoothly from csi-rbdplugin to rbd.csi.ceph.com ?
The text was updated successfully, but these errors were encountered: