| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
A size-only resizeVolume of a ROOT volume already works on a running KVM
VM: orchestrateResizeVolume checks that the host is Up and Enabled, and
the agent grows the disk in place with virsh blockresize.
Growing the same volume by giving it a larger disk offering is refused,
through resizeVolume with diskofferingid, through changeOfferingForVolume,
and so through scaleVirtualMachine when
allow.diskoffering.change.during.scale.vm is on:
Cannot resize ROOT volume [...] when VM is not on Stopped State
checkIfVolumeIsRootAndVmIsRunning, which the size-only path does not
call, refuses any size change of a ROOT volume unless the VM is Stopped,
on every hypervisor. Where the ROOT volume's offering fixes its size, the
size-only path is refused too, so stopping the VM was the only way to
grow its root disk.
Let the check through when the volume belongs to a Running KVM user VM
and the new size is larger than the current one. Shrinking, other
hypervisors, system VMs and other VM states are refused as before. The
resize then follows the same path as a size-only resize of a running VM.
Signed-off-by: Brad House <bhouse@nexthop.ai>
Codecov Report❌ Patch coverage is 77.77778% with 2 lines in your changes missing coverage. Please review.
@@ Coverage Diff @@
## 4.22 #14602 +/- ##
============================================
- Coverage 18.32% 18.32% -0.01%
- Complexity 16644 16650 +6
============================================
Files 5939 5939
Lines 537768 537774 +6
Branches 65929 65931 +2
============================================
+ Hits 98551 98552 +1
- Misses 428008 428013 +5
Partials 11209 11209
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness.
|
Sorry, something went wrong.
Test report: growing a running KVM VM's ROOT on Ceph RBD through a new disk offeringEnvironment
A precondition I had to work around. On this build, any resize of a newly created RBD volume first fails in the agent, size-only resizes included: org.libvirt.LibvirtException: Storage volume not found: no storage vol with matching path 'cloudstack/<uuid>'
1. resizeVolume diskofferingid=root20, VM running
2. changeOfferingForVolume diskofferingid=root30, VM running
3. scaleVirtualMachine to so-r40, with allow.diskoffering.change.during.scale.vm=true
4. Refusals
Observed, not changed by this PR: a size-only resizeVolume size=20 on a running router's ROOT is accepted, as on stock. The size-only path never had the running-VM check. The RBD image and the DB went to 20 GiB, but qemu was not told (domblkinfo still shows the old size), because the resize orchestration only notifies a running user VM. The router keeps running and sees the new size at its next start. Without the PR (not rerun on a stock build): steps 1-3 are refused on stock with Cannot resize ROOT volume [...] when VM is not on Stopped State, the same check without the KVM grow exception. The size-only control above was allowed before and after. Result: pass.
|
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Description
On KVM, growing a running VM's ROOT volume by giving it a larger disk offering was refused with "Cannot resize ROOT volume [...] when VM is not on Stopped State", although a size-only resizeVolume grows the same volume in place.
Fixes #14601
Why it breaks
How it is fixed
checkIfVolumeIsRootAndVmIsRunning now lets the change through when all of these hold:
Everything else is refused as before:
Nothing below the check changes. The resize then takes the same route as a size-only resize of a running VM: the same job queue, orchestrateResizeVolume and its host checks, and the same agent command. The existing checks that apply to every running KVM VM still apply, for example a managed storage pool still refuses a resize while the VM is running (validateVolumeResizeWithSize).
Not in scope / existing behaviour now reachable for ROOT
Growing the partition and filesystem inside the guest (growpart, resize2fs) is up to the guest, as it already is for a size-only resize. cloud-init only does it at boot.
Types of changes
Feature/Enhancement Scale or Bug Severity
Bug Severity
How Has This Been Tested?
How did you try to break this feature and the system with this change?