Preserve custom/c1 syntax during storage volume rename#14681
Preserve custom/c1 syntax during storage volume rename#14681tomponline merged 2 commits intocanonical:mainfrom
custom/c1 syntax during storage volume rename#14681Conversation
`newVol.Type` should always be custom Signed-off-by: Wesley Hershberger <wesley.hershberger@canonical.com>
Signed-off-by: Wesley Hershberger <wesley.hershberger@canonical.com>
|
@MggMuggins TIL LXD does this. |
|
You and me both 😆 |
|
@tomponline There's no bug when used with instance devices. Renaming devices attached to profiles fails, but with an unhelpful error message. InstancesAssume the following configuration in a lxd cluster with cluster members Renaming ProfilesThe block volume sharing rules aren't strictly correct; adding the same device to the default profile hits this: Setting that aside for a moment, the rename fails here: I tried a similar setup with filesystem volumes in profiles and get the same thing. I think the current implementation is sound, at least insofar as it validates changes after making them. Looking at the code I think there's a corner case involving how revert happens (or not) when the rename fails like this, but I need a little more time to work it out properly. cc @masnax |
This makes `storagePoolVolumeUpdateUsers` safe to call without using a reverter. This also adds a few tests around renaming attached local custom storage volumes in a clustered context. As we've discussed previously (#14681), updating disk devices in profiles isn't necessarily sound. These tests give me a little more confidence that updates behave sanely for local storage volumes in a cluster. We should consider eliminating this feature altogether and simply making it a hard error to rename a custom storage volume while it is referred to by any disk device.
Follow-up to #14491; if a volume is specified as
source: custom/c1, then a rename ofc1->c2should leave the device withsource: custom/c2.