check state instead of power state on change offering for ROOT volume#13271
check state instead of power state on change offering for ROOT volume#13271DaanHoogland wants to merge 5 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
Updates ROOT volume resize/offering-change validation for VMware to use the VM state (e.g., Stopped) instead of the VM power_state (e.g., PowerOff), addressing cases where VMware power state lags and incorrectly blocks disk offering changes.
Changes:
- Switch VMware ROOT-volume validation from
userVm.getPowerState()touserVm.getState()inresizeVolumeInternal. - Apply the same state-based validation in
validateVolumeReadyStateAndHypervisorChecks. - Update corresponding log/error messages to reference
Stoppedstate.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## 4.22 #13271 +/- ##
============================================
- Coverage 17.67% 17.67% -0.01%
- Complexity 15792 15796 +4
============================================
Files 5922 5923 +1
Lines 533165 533313 +148
Branches 65208 65242 +34
============================================
+ Hits 94242 94256 +14
- Misses 428276 428395 +119
- Partials 10647 10662 +15
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:
|
|
@blueorangutan test ol9 vmware-80u3 |
seems the only consistent error. checking latest main... |
winterhazel
left a comment
There was a problem hiding this comment.
I did not test, but it looks ok.
Co-authored-by: Fabricio Duarte <fabricio.duarte.jr@gmail.com> Co-authored-by: dahn <daan.hoogland@gmail.com>
|
@blueorangutan package |
|
@DaanHoogland a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress. |
|
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 18445 |
|
@blueorangutan test ol9 vmware-80u3 |
|
@DaanHoogland a [SL] Trillian-Jenkins test job (ol9 mgmt + vmware-80u3) has been kicked to run smoke tests |
| // snapshotDaoMock returns an empty list by default (Mockito default behaviour) | ||
| when(volumeDaoMock.getHypervisorType(volumeId)).thenReturn(HypervisorType.VMware); | ||
|
|
| when(volumeDaoMock.getHypervisorType(volumeId)).thenReturn(HypervisorType.VMware); | ||
|
|
| // Must complete without throwing any exception | ||
| volumeApiServiceImpl.validateVolumeReadyStateAndHypervisorChecks(volume, currentSizeBytes, newSizeBytes); | ||
| } |
| && !State.Stopped.equals(userVm.getState()) | ||
| && HypervisorType.VMware.equals(hypervisorType)) { | ||
| logger.error("For ROOT volume resize VM should be in Stopped state."); | ||
| throw new InvalidParameterValueException("The current VM state is '" + userVm.getState() + "'. But VM should be in " + State.Stopped + " state."); |
|
[SF] Trillian test result (tid-16475)
|
|
All co-pilot comments are about unit tests that are passing, so they make no sense to me. |
Description
This PR...
Fixes: #13261
Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
Screenshots (if appropriate):
How Has This Been Tested?
How did you try to break this feature and the system with this change?