Damans227 opened a new pull request, #13558: URL: https://github.com/apache/cloudstack/pull/13558
### 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()` 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. ### Types of changes - [ ] Breaking change (fix or feature that would cause existing functionality to change) - [ ] New feature (non-breaking change which adds functionality) - [ ] Bug fix (non-breaking change which fixes an issue) - [x] Enhancement (improves an existing feature and functionality) - [ ] Cleanup (Code refactoring and cleanup, that may add test cases) - [ ] Build/CI - [ ] Test (unit or integration test code) ### Feature/Enhancement Scale or Bug Severity #### Feature/Enhancement Scale - [ ] Major - [x] Minor ### 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 `VirtualMachineManagerImplTest` were updated to match the new `sendStop()` return type, including an assertion on the propagated failure detail. Ran the full `VirtualMachineManagerImplTest` suite (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()` within `VirtualMachineManagerImpl` was updated consistently to handle the new return type, including a case where the `Migrating` state combines the hostId/lastHostId checks into a single `sendStop()` call, to avoid an unrelated double-invocation. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
