-
Notifications
You must be signed in to change notification settings - Fork 565
Support live disk resizing for RAW images #7476
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
Support live disk resizing for RAW images #7476
Conversation
0086f70 to
0513eb9
Compare
0513eb9 to
95c9352
Compare
349270d to
3fe60fb
Compare
rbradford
left a comment
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.
I'm kinda impressed that Linux works with this! Will need an integration test.
3fe60fb to
c835bec
Compare
I will have a look how these integration tests work soon. |
|
Are we supporting both shrink and expanse? For expanse it is okay, but for shrink don't see a possibility of corruption? |
I tried to keep this compatible to qemu. If you shrink the disk, the guest has to play nice, i.e. the part that is shrinked must not be active at the time. There's also this comment in the qemu libvirt driver which basically states the same: https://gitlab.com/libvirt/libvirt/-/blob/master/src/qemu/qemu_driver.c?ref_type=heads#L9402 |
rbradford
left a comment
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.
Thanks! I have no problems in principal with the feature/PR. Please try and add an integration test.
c835bec to
e2eb29f
Compare
This change is a prerequisite for live disk resizing. Before this commit, the epoll-handler threads just got a copy of the sector size which we cannot update during runtime. On-behalf-of: SAP [email protected] Signed-off-by: Thomas Prescher <[email protected]>
e2eb29f to
29bcd60
Compare
29bcd60 to
eecaf37
Compare
a7bfb15 to
9440b87
Compare
@rbradford test has been added. |
9440b87 to
d18e840
Compare
|
Please beware that since the latest QoL improvements (#7489), you can run |
d18e840 to
9456396
Compare
|
TL;DR: Open question: disk resizing and byte-range OFD locks?! One last question: Since we have #7494: How does this work together with disk locking using byte-ranges? The old range will remain locked but that will not correspond to the new size. From a Cloud Hypervisor perspective, as the locks are just advisory and overlapping, we can keep the old lock as it will in any case prevent further Cloud Hypervisor instances from locking again. But technically, other software could see regions of the file being unlocked. |
@phip1611 you are absolutely right. Would it be ok to do this in a follow-up PR? |
I think it would be sufficient to create a follow-up ticket. In fact, this also has some caveats. For example, next to this live resize functionality, in the static qcow2 case, the physical image can also grow transparently to the guest, if I'm not mistaken. No need to fix all of this here in this PR. |
I've created #7569 |
rbradford
left a comment
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.
Just some nits.
Add basic infrastructure so resize events are propagated to the underlying disk implementation. On-behalf-of: SAP [email protected] Signed-off-by: Thomas Prescher <[email protected]>
Support for resize events for raw_async disks. On-behalf-of: SAP [email protected] Signed-off-by: Thomas Prescher <[email protected]>
Support disk resizing via ch-remote and REST api. On-behalf-of: SAP [email protected] Signed-off-by: Thomas Prescher <[email protected]>
On-behalf-of: SAP [email protected] Signed-off-by: Thomas Prescher <[email protected]>
This test verifies that we can grow and shrink disk images during runtime. On-behalf-of: SAP [email protected] Signed-off-by: Thomas Prescher <[email protected]>
9456396 to
95d0235
Compare
Summary
This pull request introduces live disk resizing support for RAW images. This enhancement enables dynamic adjustment of disks while the guest is running. This is part of our cloud-hypervisor openstack enablement.
Testing