Skip to content

Fix importVM for use with dummy template - #14195

Open
abh1sar wants to merge 1 commit into
apache:4.22from
shapeblue:import-vm-template-fix
Open

abh1sar wants to merge 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

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants