Repository navigation
Commit c2202de
committed
Allow growing a running KVM VM's ROOT volume through a new disk offering
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>1 parent d02adcd commit c2202de
2 files changed
Lines changed: 72 additions & 3 deletions
File tree
- server/src
- main/java/com/cloud/storage
- test/java/com/cloud/storage
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1524 | 1524 | | |
1525 | 1525 | | |
1526 | 1526 | | |
1527 | | - | |
1528 | | - | |
1529 | | - | |
| 1527 | + | |
| 1528 | + | |
| 1529 | + | |
| 1530 | + | |
| 1531 | + | |
1530 | 1532 | | |
1531 | 1533 | | |
1532 | 1534 | | |
1533 | 1535 | | |
| 1536 | + | |
| 1537 | + | |
| 1538 | + | |
| 1539 | + | |
| 1540 | + | |
| 1541 | + | |
| 1542 | + | |
| 1543 | + | |
| 1544 | + | |
| 1545 | + | |
| 1546 | + | |
1534 | 1547 | | |
1535 | 1548 | | |
1536 | 1549 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
139 | 139 | | |
140 | 140 | | |
141 | 141 | | |
| 142 | + | |
142 | 143 | | |
143 | 144 | | |
144 | 145 | | |
| |||
2504 | 2505 | | |
2505 | 2506 | | |
2506 | 2507 | | |
| 2508 | + | |
| 2509 | + | |
| 2510 | + | |
| 2511 | + | |
| 2512 | + | |
| 2513 | + | |
| 2514 | + | |
| 2515 | + | |
| 2516 | + | |
| 2517 | + | |
| 2518 | + | |
| 2519 | + | |
| 2520 | + | |
| 2521 | + | |
| 2522 | + | |
| 2523 | + | |
| 2524 | + | |
| 2525 | + | |
| 2526 | + | |
| 2527 | + | |
| 2528 | + | |
| 2529 | + | |
| 2530 | + | |
| 2531 | + | |
| 2532 | + | |
| 2533 | + | |
| 2534 | + | |
| 2535 | + | |
| 2536 | + | |
| 2537 | + | |
| 2538 | + | |
| 2539 | + | |
| 2540 | + | |
| 2541 | + | |
| 2542 | + | |
| 2543 | + | |
| 2544 | + | |
| 2545 | + | |
| 2546 | + | |
| 2547 | + | |
| 2548 | + | |
| 2549 | + | |
| 2550 | + | |
| 2551 | + | |
| 2552 | + | |
| 2553 | + | |
| 2554 | + | |
| 2555 | + | |
| 2556 | + | |
| 2557 | + | |
| 2558 | + | |
| 2559 | + | |
| 2560 | + | |
| 2561 | + | |
| 2562 | + | |
2507 | 2563 | | |
0 commit comments