| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
A size-only resizeVolume of a running system VM's volume, such as a virtual router's ROOT, was accepted. orchestrateResizeVolume only looks the VM up as a user VM, so for a system VM the resize was sent with no instance name and no host. The storage and the database got the new size, but the hypervisor was never told and the running guest kept the old size until its next start. The XenServer and KVM host checks in the same method were skipped for the same reason. The resize validation now refuses to change the size of a volume attached to a system VM that is not Stopped. A stopped system VM's volume can still be resized. A ROOT resize through a new disk offering was already refused unless the VM was stopped. Fixes apache#14645 Signed-off-by: Brad House <bhouse@nexthop.ai>
Codecov Report❌ Patch coverage is 88.88889% with 1 line in your changes missing coverage. Please review.
@@ Coverage Diff @@
## 4.22 #14647 +/- ##
============================================
- Coverage 18.32% 18.32% -0.01%
- Complexity 16644 16653 +9
============================================
Files 5939 5939
Lines 537768 537796 +28
Branches 65929 65933 +4
============================================
+ Hits 98551 98553 +2
- Misses 428008 428025 +17
- Partials 11209 11218 +9
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: resizing a virtual router's ROOT volumeSummary: a size-only resizeVolume of a running router's ROOT volume is now refused, and neither the DB nor the RBD image changes. With the router stopped, the same resize is accepted. Environment
Steps and results
Refusal message: Cannot resize volume [ROOT-477] of system VM r-477-VM while it is in state Running. Stop the system VM before resizing its volume. Before this PR, the same call on a running router succeeded and grew the RBD image, while the router's disk kept its old size until it restarted. The resized router was never started again. It was destroyed with its network at the end of the test. Result: pass. Not covered
|
Sorry, something went wrong.
…pedForResize The check requires the system VM to be Stopped, not merely not Running, so name it after what it enforces. Signed-off-by: Brad House <bhouse@nexthop.ai>
| Back | FazBrowse Home | New Git URL |
Description
A size-only resizeVolume of a running system VM's volume, for example a virtual router's ROOT, was accepted. The storage and the database got the new size, but the running VM was never told, so the guest kept the old size until it next started. This PR refuses that resize unless the system VM is Stopped.
Fixes #14645
Why it happens
orchestrateResizeVolume looks the VM up only with _userVmDao.findById(). For a system VM that is null, so:
A ROOT resize through a new disk offering, in resizeVolume or changeOfferingForVolume, is already refused unless the VM is Stopped (checkIfVolumeIsRootAndVmIsRunning). The size-only resizeVolume path had no such check.
Fix
validateVolumeResizeWithSize, which both resizeVolume and changeOfferingForVolume call before any size change, now refuses one more case. If the volume is attached to a system VM (VirtualMachine.Type.isUsedBySystem()) that is not Stopped, the call fails with:
I chose to refuse rather than do the resize live. A live resize would need orchestrateResizeVolume to handle system VMs on every hypervisor, through the VM work queue and the host checks, and that needs testing on each one. Refusing matches how other volume operations treat system VMs: snapshots of their volumes are refused, and attach and detach accept only user VMs.
This touches a different part of VolumeApiServiceImpl from #14602, and the two merge cleanly.
Types of changes
Feature/Enhancement Scale or Bug Severity
Bug Severity
How Has This Been Tested?
The bug was seen on a KVM + Ceph RBD lab while testing #14602. A size-only resizeVolume size=20 on a running router's ROOT succeeded. rbd info and the API showed 20 GiB, but virsh domblkinfo still showed the old size until the router restarted. The fix itself is covered by unit tests; it has not been run on the lab yet.
New tests in VolumeApiServiceImplTest:
VolumeApiServiceImplTest passes (150 tests). Checkstyle is clean for server.
How did you try to break this feature and the system with this change?