Skip to content

conditional error reporting for vm move failure - #13675

Open
DaanHoogland wants to merge 6 commits into
4.20from
ghi13406-vmMove-error
Open

DaanHoogland wants to merge 6 commits into
4.20from
ghi13406-vmMove-error

Conversation

@DaanHoogland

Copy link
Copy Markdown
Contributor

Description

This PR...

Fixes: #13406

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)
  • 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
  • Minor

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

Screenshots (if appropriate):

How Has This Been Tested?

How did you try to break this feature and the system with this change?

@codecov

codecov Bot commented Jul 23, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 16.46%. Comparing base (e6f193d) to head (29f1ccb).

Additional details and impacted files
@@             Coverage Diff              @@
##               4.20   #13675      +/-   ##
============================================
+ Coverage     16.45%   16.46%   +0.01%     
- Complexity    13710    13719       +9     
============================================
  Files          5669     5670       +1     
  Lines        501734   501741       +7     
  Branches      60961    60962       +1     
============================================
+ Hits          82584    82636      +52     
+ Misses       409895   409849      -46     
- Partials       9255     9256       +1     
Flag Coverage Δ
uitests 4.16% <ø> (ø)
unittests 17.33% <100.00%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a configurable way to return more informative API error messages when assignVirtualMachine (VM ownership change) fails, addressing the lack of actionable failure details reported in #13406.

Changes:

  • Introduces a new global ConfigKey to control whether detailed assign/move failure reasons are exposed to API callers.
  • Updates AssignVMCmd to optionally return InvalidParameterValueException messages to the caller when enabled.
  • Registers the new ConfigKey in UserVmManagerImpl’s config key list.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
server/src/main/java/com/cloud/vm/UserVmManagerImpl.java Registers the new configuration key for VM-assign failure detail exposure.
api/src/main/java/org/apache/cloudstack/api/command/admin/vm/AssignVMCmd.java Conditionally returns a detailed failure reason from InvalidParameterValueException instead of only logging it.
api/src/main/java/com/cloud/vm/UserVmService.java Defines the new global ConfigKey controlling detailed failure message exposure.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@DaanHoogland

Copy link
Copy Markdown
Contributor Author

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@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.

@blueorangutan

Copy link
Copy Markdown

Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 18663

@DaanHoogland DaanHoogland linked an issue Jul 30, 2026 that may be closed by this pull request
@DaanHoogland DaanHoogland modified the milestones: 4.24.0, 4.20.4 Jul 30, 2026
@DaanHoogland
DaanHoogland marked this pull request as ready for review August 4, 2026 07:16
@DaanHoogland

Copy link
Copy Markdown
Contributor Author

@blueorangutan test

@blueorangutan

Copy link
Copy Markdown

@DaanHoogland a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests

@DaanHoogland
DaanHoogland requested a lite review from Copilot August 4, 2026 17:31

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@blueorangutan

Copy link
Copy Markdown

Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 18765

@blueorangutan

Copy link
Copy Markdown

[SF] Trillian test result (tid-16694)
Environment: kvm-ol8 (x2), zone: Advanced Networking with Mgmt server ol8
Total time taken: 55030 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr13675-t16694-kvm-ol8.zip
Smoke tests completed. 141 look OK, 0 have errors, 0 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File

@sonarqubecloud

sonarqubecloud Bot commented Aug 5, 2026

Copy link
Copy Markdown

@DaanHoogland

Copy link
Copy Markdown
Contributor Author

@daviftorres this is getting orphaned (slowly) are you still looking for test possibilities?

@davift

davift commented Nov 9, 2026

Copy link
Copy Markdown

@daviftorres this is getting orphaned (slowly) are you still looking for test possibilities?

Hey @DaanHoogland, I raised this issue just to bring awareness to it. I’m not actively working on or testing this one right now.

@JoaoJandre JoaoJandre left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From my point of view, we could always tell the user why the VM could not be moved. I think adding a config for it is a bit much. Also, in the future, will we add new configurations for each situation like this?

I guess we should start thinking about a way to configure which messages get seen by which types of users. And if we should have these behaviors be more configurable and flexible.

@DaanHoogland

Copy link
Copy Markdown
Contributor Author

From my point of view, we could always tell the user why the VM could not be moved. I think adding a config for it is a bit much. Also, in the future, will we add new configurations for each situation like this?

I guess we should start thinking about a way to configure which messages get seen by which types of users. And if we should have these behaviors be more configurable and flexible.

makes sense @JoaoJandre . care to start a discussion or an issue?

@sonarqubecloud

Copy link
Copy Markdown

@JoaoJandre

Copy link
Copy Markdown
Contributor

s we should start thinking about a way to configure which messages get seen by which types of users. And if we should have these behaviors be more configurable and flexible.

Done: #14692

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Ready

Development

Successfully merging this pull request may close these issues.

Failed to Move VM to Another Account

6 participants