Propagate StopAnswer error details up the call chain when stopping a VM#13558
Propagate StopAnswer error details up the call chain when stopping a VM#13558Damans227 wants to merge 1 commit into
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## 4.22 #13558 +/- ##
============================================
+ Coverage 17.67% 19.41% +1.74%
- Complexity 15797 19153 +3356
============================================
Files 5923 6284 +361
Lines 533349 564865 +31516
Branches 65248 68920 +3672
============================================
+ Hits 94253 109687 +15434
- Misses 428437 443274 +14837
- Partials 10659 11904 +1245
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:
|
When a hypervisor's StopAnswer for a StopCommand fails, the underlying failure reason is logged locally but never surfaced to the caller. Operators and API callers only ever see a generic "Unable to stop VM" message, with no indication of what actually went wrong on the hypervisor side. This changes sendStop() and cleanup() in VirtualMachineManagerImpl to return a Pair<Boolean, String> (success flag + failure detail) instead of a plain boolean, and threads that detail through to the exceptions raised by callers (advanceStop, migrate, orchestrateMigrateWithStorage, orchestrateMigrateForScale), so the StopAnswer failure reason is now visible in the resulting error message.
1dfd4ad to
5fe808e
Compare
|
@blueorangutan package |
|
@nvazquez 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 18491 |
|
@blueorangutan test |
|
@nvazquez a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests |
|
[SF] Trillian test result (tid-16539)
|
Description
When a hypervisor's StopAnswer for a StopCommand fails, the underlying failure reason is logged locally but never surfaced to the caller. Operators and API callers only ever see a generic "Unable to stop VM" message, with no indication of what actually went wrong on the hypervisor side.
This PR changes
sendStop()andcleanup()inVirtualMachineManagerImplto return aPair<Boolean, String>(success flag + failure detail) instead of a plainboolean, and threads that detail through to the exceptions raised by callers (advanceStop,migrate,orchestrateMigrateWithStorage,orchestrateMigrateForScale), so the StopAnswer failure reason is now visible in the resulting error message.Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
How Has This Been Tested?
This is a logging/error-message improvement; there's no change to the stop/cleanup control flow itself. Existing unit tests in
VirtualMachineManagerImplTestwere updated to match the newsendStop()return type, including an assertion on the propagated failure detail. Ran the fullVirtualMachineManagerImplTestsuite (100 tests) locally, all passing.How did you try to break this feature and the system with this change?
Verified every caller of
sendStop()/cleanup()withinVirtualMachineManagerImplwas updated consistently to handle the new return type, including a case where theMigratingstate combines the hostId/lastHostId checks into a singlesendStop()call, to avoid an unrelated double-invocation.