Repository navigation
Compare volume size in bytes when changing to the same disk offering - #14750
bhouse-nexthop wants to merge 1 commit into
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## 4.22 #14750 +/- ##
=========================================
Coverage 18.32% 18.33%
- Complexity 16644 16660 +16
=========================================
Files 5939 5939
Lines 537787 537827 +40
Branches 65932 65939 +7
=========================================
+ Hits 98544 98591 +47
+ Misses 428033 428007 -26
- Partials 11210 11229 +19
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Tested on a KVM lab running a main (24.0) build that includes this change. Primary storage is Ceph RBD. The PR targets 4.22; Steps: attached a 1 GiB DATA volume on a custom-size disk offering to a Running VM, then changed it to the same offering, first with the same size, then with a new one. Result: all checks passed.
Before this change, the same-size call went through the full change path and returned success (#14749). Not tested: offerings with IOPS or a hypervisor snapshot reserve, and the UI. |
validateVolumeResizeWithNewDiskOfferingAndLoad converts a custom offering's size from GiB to bytes, then checkIfVolumeCanResizeWithNewDiskOffering shifted it by 30 again, so its "already having disk offering" guard never matched for custom-size offerings. | changeOfferingForVolume to the same custom offering | before | after | |---|---|---| | same size, same IOPS | ran the full change path | rejected: "already having disk offering" | | same size, new IOPS | allowed | allowed | | new size | allowed | allowed | | compute-only offering (size taken from the volume) | allowed | allowed | - Drop the second `<< 30` in the comparison. - Only reject when min/max IOPS are also unchanged, so IOPS-only changes keep working. - Skip compute-only offerings: their size always equals the volume's, and scale VM to the same custom service offering goes through here. - Add unit tests for each row. Signed-off-by: Brad House <bhouse@nexthop.ai>
496f21b to
2f150bf
Compare
Review follow-up for apache#14750. Signed-off-by: Brad House <bhouse@nexthop.ai> (cherry picked from commit 2020a93f70fb8bdb0ddd70c6511764bff0640987)
Review follow-up for apache#14750. Signed-off-by: Brad House <bhouse@nexthop.ai> (cherry picked from commit 8f4e66fcbb9b9fed67e5a1cfd43e20f14da6697f)
Description
Fixes #14749
checkIfVolumeCanResizeWithNewDiskOfferingshifted an already-bytes size by 30 again, so its "already having disk offering" guard never matched for custom-size offerings.<< 30.Types of changes
Bug Severity
How Has This Been Tested?
VolumeApiServiceImplTest(150 tests, 5 new)