Repository navigation
Fix importVM for use with dummy template - #14195
Conversation
…mportVM. findByID will fail for dummy template as it is stored in the deleted state.
Codecov Report❌ Patch coverage is
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
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:
|
weizhouapache
left a comment
There was a problem hiding this comment.
code lgtm
need re-testing
rajujith
left a comment
There was a problem hiding this comment.
LGTM
Tested
ImportVm works fine without any error.
|
@blueorangutan package |
|
@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. |
|
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 19279 |
|
@blueorangutan test |
|
@abh1sar a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests |
|
[SF] Trillian test result (tid-17022)
|
Port the production fix from apache/cloudstack PR apache#14195, source commit 0cb24ba (merged into 4.22 as 273b2ea). Reuse the supplied template and load its details without a findById lookup that filters removed records. Preserve template CPU-detail inheritance and explicit VM overrides. Add six regression tests for dummy and active templates, non-VO templates, CPU override precedence and missing templates. Co-authored-by: Abhisar Sinha <63767682+abh1sar@users.noreply.github.com>
findByID will fail for dummy template as it is stored in the deleted state.
VMware to KVM: cold (VDDK) and warm (CBT) migration into Ceph/RBD and Linstor, plus importVm adoption of existing RBD and Linstor volumes Restores #13656 (merged as 0a5bf30, reverted by 510d0ec), with the fixes found in review: - CBT: the per-disk checkpoint between delta cycles is now read from the cycle snapshot's disk backing, so each delta copies only the changes since the previous cycle (a5578d6) - CBT: failures of the final agent command or of recording the final cycle are handled through the normal cutover failure path (6fa7d30) - CBT: cancel and delete keep the target disks of an imported VM (fd16736) - importVm: load template details from the supplied template, so imports with the removed "VM Import Default Template" work again (port of #14195, 2a3598a) - LINSTOR import: resource-group validation against the selected pool, and inspection and listing from controller metadata without connecting or disconnecting local DRBD resources (01058cd); pagination offset/limit order (ce349d8) Feature summary: - warm VMware-to-KVM migration with VDDK and Changed Block Tracking: persisted migration, cycle and disk records, preflight, delta cycles, operator cutover, cancel and cleanup; new admin APIs startVmwareCbtMigration, syncVmwareCbtMigration, cutoverVmwareCbtMigration, cancelVmwareCbtMigration, deleteVmwareCbtMigration, listVmwareCbtMigrations and checkVmwareCbtMigrationPrerequisites; UI under Tools - cold direct VDDK import straight into Ceph/RBD or Linstor (raw), with virt-v2v in-place finalization - adoption of existing RBD and Linstor ROOT (importVm importsource=shared) and DATA (importVolume) volumes without copying - guest OS type, firmware (BIOS/UEFI, secure boot) and console defaults derived from the source VM configuration; static IPv4 preservation; Windows data disks brought online at first boot - database changes in the 4.23.0 to 24.0.0 upgrade path Reviewed and tested: LGTM from rp- (LINSTOR maintainer) and alexandremattioli (tested warm CBT to QCOW2 and Ceph); Trillian smoke tests tid-17130 on 95fc5b5: 157 OK, 0 errors. Signed-off-by: Andrija Panic <andrija.panic@gmail.com>
Description
This PR fixes the
Unable to find template with id 202 for virtual machine importerror thrown when importing a VM.The dummy template
VM Import Default Templateis stored in the removed state, so findById returns null and importVM fails.Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
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?