Support live disk resizing for RAW images#7476
Support live disk resizing for RAW images#7476rbradford merged 6 commits intocloud-hypervisor:mainfrom
Conversation
0086f70 to
0513eb9
Compare
0513eb9 to
95c9352
Compare
349270d to
3fe60fb
Compare
rbradford
left a comment
There was a problem hiding this comment.
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.
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 thomas.prescher@sap.com Signed-off-by: Thomas Prescher <thomas.prescher@cyberus-technology.de>
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 |
Add basic infrastructure so resize events are propagated to the underlying disk implementation. On-behalf-of: SAP thomas.prescher@sap.com Signed-off-by: Thomas Prescher <thomas.prescher@cyberus-technology.de>
Support for resize events for raw_async disks. On-behalf-of: SAP thomas.prescher@sap.com Signed-off-by: Thomas Prescher <thomas.prescher@cyberus-technology.de>
Support disk resizing via ch-remote and REST api. On-behalf-of: SAP thomas.prescher@sap.com Signed-off-by: Thomas Prescher <thomas.prescher@cyberus-technology.de>
On-behalf-of: SAP thomas.prescher@sap.com Signed-off-by: Thomas Prescher <thomas.prescher@cyberus-technology.de>
This test verifies that we can grow and shrink disk images during runtime. On-behalf-of: SAP thomas.prescher@sap.com Signed-off-by: Thomas Prescher <thomas.prescher@cyberus-technology.de>
9456396 to
95d0235
Compare
|
@weltling This is what I talked about in today's meeting. If you see a pragmatic way forward to enable this system call for QCOW2, it would be great! I'm however unsure if it would make sense.. you are the domain expert here. |
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