Skip to content

Fix importVM for use with dummy template - #14195

Merged
weizhouapache merged 1 commit into
apache:4.22from
shapeblue:import-vm-template-fix
Sep 19, 2026
Merged

weizhouapache merged 1 commit into
apache:4.22from
shapeblue:import-vm-template-fix

Conversation

@abh1sar

@abh1sar abh1sar commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

Description

This PR fixes the Unable to find template with id 202 for virtual machine import error thrown when importing a VM.
The dummy template VM Import Default Template is stored in the removed state, so findById returns null and importVM fails.

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?

Tested ImportVmCmd with and without the fix

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

…mportVM.

findByID will fail for dummy template as it is stored in the deleted state.
@codecov

codecov Bot commented Sep 17, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 17.98%. Comparing base (a8c8c18) to head (0cb24ba).

Files with missing lines Patch % Lines
.../src/main/java/com/cloud/vm/UserVmManagerImpl.java 0.00% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##               4.22   #14195   +/-   ##
=========================================
  Coverage     17.97%   17.98%           
- Complexity    16184    16186    +2     
=========================================
  Files          5930     5930           
  Lines        535615   535614    -1     
  Branches      65582    65582           
=========================================
+ Hits          96271    96304   +33     
+ Misses       428377   428336   -41     
- Partials      10967    10974    +7     
Flag Coverage Δ
uitests 4.02% <ø> (ø)
unittests 19.05% <0.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.

@weizhouapache weizhouapache left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

code lgtm

need re-testing

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

LGTM
Tested
ImportVm works fine without any error.

@abh1sar

abh1sar commented Sep 18, 2026

Copy link
Copy Markdown
Contributor Author

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

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

@weizhouapache weizhouapache added this to the 4.22.2 milestone Sep 18, 2026
@blueorangutan

Copy link
Copy Markdown

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

@abh1sar

abh1sar commented Sep 18, 2026

Copy link
Copy Markdown
Contributor Author

@blueorangutan test

@blueorangutan

Copy link
Copy Markdown

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

@blueorangutan

blueorangutan commented Sep 19, 2026

Copy link
Copy Markdown

[SF] Trillian test result (tid-17022)
Environment: kvm-ol8 (x2), zone: Advanced Networking with Mgmt server ol8
Total time taken: 53070 seconds
Marvin logs: [archive removed]
Smoke tests completed. 147 look OK, 2 have errors, 0 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File
test_09_arping_in_cpvm Failure 5.26 test_diagnostics.py
test_02_enableHumanReadableLogs Error 0.32 test_human_readable_logs.py

@weizhouapache
weizhouapache merged commit 273b2ea into apache:4.22 Sep 19, 2026
24 of 26 checks passed
@weizhouapache
weizhouapache deleted the import-vm-template-fix branch September 19, 2026 08:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants