server: copy template details to vm instance details when import VM - #12793
weizhouapache merged 4 commits into
Conversation
|
@blueorangutan package |
|
@weizhouapache 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. |
There was a problem hiding this comment.
Pull request overview
This PR aims to fix VM import so that a template’s details are loaded and then copied into the imported VM’s instance details.
Changes:
- Fetches the template VO from the DAO and explicitly loads its details prior to
commitUserVm. - Switches downstream calls (
checkIfDynamicScalingCanBeEnabled,commitUserVm, ISO format check) to use the DAO-loadedVMTemplateVO.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## 4.22 #12793 +/- ##
=========================================
Coverage 17.91% 17.91%
Complexity 16113 16113
=========================================
Files 5928 5928
Lines 535057 535063 +6
Branches 65480 65482 +2
=========================================
+ Hits 95879 95882 +3
- Misses 428269 428274 +5
+ Partials 10909 10907 -2
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:
|
|
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 17101 |
|
@blueorangutan test |
|
@weizhouapache a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests |
|
[SF] Trillian test result (tid-15611)
|
|
This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch. |
|
@weizhouapache can you resolve the conflicts. |
| // Ensure template details are loaded so that commitUserVm can copy them into the VM's details map | ||
| VMTemplateVO vmTemplateVO = _templateDao.findById(template.getId()); | ||
| if (vmTemplateVO == null) { | ||
| throw new InvalidParameterValueException("Unable to find template with id " + template.getId() + " for virtual machine import"); | ||
| } | ||
| _templateDao.loadDetails(vmTemplateVO); |
| final Boolean dynamicScalingEnabled = checkIfDynamicScalingCanBeEnabled(null, serviceOffering, vmTemplateVO, zone.getId()); | ||
| return commitUserVm(true, zone, host, lastHost, vmTemplateVO, hostName, displayName, owner, | ||
| null, null, userData, null, null, isDisplayVm, keyboard, | ||
| accountId, userId, serviceOffering, template.getFormat().equals(ImageFormat.ISO), sshPublicKeys, networkNicMap, |
|
This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch. |
|
@blueorangutan package |
|
@vladimirpetrov 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 19203 |
vladimirpetrov
left a comment
There was a problem hiding this comment.
LGTM based on manual testing, tested with a custom template and unmanage/reimport running VM.
|
@blueorangutan test |
|
@vladimirpetrov a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests |
cool, thanks @vladimirpetrov |
|
[SF] Trillian test result (tid-16979)
|
|
merging based on approvals and Vladi's manual verification |
|
@abh1sar has found an issue caused by this PR, when importvm which uses dummy template (existed in database but marked as remvoed) |
|
Created pr #14195 |
Description
This PR fixes #12594
Tested
guest.cpu.mode=host-passthroughTypes of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
Screenshots (if appropriate):
How Has This Been Tested?
How did you try to break this feature and the system with this change?