-
Notifications
You must be signed in to change notification settings - Fork 937
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
Storage: Attach VM snapshots as disk devices #14930
base: main
Are you sure you want to change the base?
Conversation
52455e2
to
604cbf0
Compare
75acc94
to
cc24a1b
Compare
@MggMuggins when we added Also can you update that API extension to include the new |
91bf766
to
b146396
Compare
Good catch; should be good to go. |
90bc474
to
3b6a98c
Compare
Still chasing down a bug, this is not GTM. |
0391ad1
to
cedd3db
Compare
@MggMuggins please can you rebase |
cedd3db
to
ee74bcb
Compare
ee74bcb
to
eab486d
Compare
Spun my wheels a bit today on checking that deleting a snapshot isn't possible if it's attached to an instance. Added a test to the lxd-ci PR to check that; this is good for review. Still working on the LVM refcount bug. When the LVM driver deactivates a volume snapshot it checks to see if the parent volume is still in use. We need the inverse; the driver also needs to make sure when deactivating the parent that there aren't any snapshots in use. It looks like deactivating the parent also deactivates the snapshot (hence the error below), but I doubt the opposite is true. More on this tomorrow. Putting this here for future travelers:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@MggMuggins did you consider supporting source: vol/snap
rather than source-snapshot
? As we tend to use vol/snap format most other places?
Just want to check u didnt miss this question? |
I did not 😉 Here is this set of changes with that syntax instead (tests failing atm, def broken). From an implementation perspective it makes complete sense (much smaller delta with the existing disk device driver and lxc, consistent with I don't love it for the same reasons that I switched to Fixed 2 bugs (ceph |
How about we stick with |
I'm happy with that; the I'll get this ready to go ASAP. |
...to reflect changes in syntax & snapshots Signed-off-by: Wesley Hershberger <[email protected]>
Signed-off-by: Wesley Hershberger <[email protected]>
Signed-off-by: Wesley Hershberger <[email protected]>
Signed-off-by: Wesley Hershberger <[email protected]>
Signed-off-by: Wesley Hershberger <[email protected]>
eab486d
to
c3d24f5
Compare
Link to the `source` disk device key for clarity Signed-off-by: Wesley Hershberger <[email protected]>
Bring the fix from canonical#13258 to `lxc storage volume attach-profile` Signed-off-by: Wesley Hershberger <[email protected]>
Prevents a disk device that refers from a snapshot from being identified as a reference to its parent volume. Signed-off-by: Wesley Hershberger <[email protected]>
Signed-off-by: Wesley Hershberger <[email protected]>
Signed-off-by: Wesley Hershberger <[email protected]>
c3d24f5
to
5a43b28
Compare
@tomponline This is ready to go. Added tests for readonly ceph block devices to canonical/lxd-ci#413 |
Nevermind, the readonly fix regressed something else and I don't have time today to dig into it. I'll pull those commits out so that this PR is unblocked and keep working on it on Monday. |
5a43b28
to
16abd2c
Compare
func parseVolumeSnapshot(defaultType string, name string) (volName string, volType string, snapshot string) { | ||
volName, volType = parseVolume(defaultType, name) | ||
|
||
parts := strings.SplitN(volName, "/", 2) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
strings.Cut would also be an option here
@@ -2549,8 +2549,8 @@ This adds support for listing network zones across all projects using the `all-p | |||
|
|||
## `instance_root_volume_attachment` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@MggMuggins shall we rename this to vm_root_volume_attachment
as my understanding is that we dont support containers yet, and we dont plan to before LXD 6.3 is released?
Attach a snapshot of
v1
to another VM as a disk device using this device config:Attempting to attach custom volume snapshots using this API will fail. I am planning to complete that functionality next week.
Tests in the works for lxd-cicanonical/lxd-ci#413