server: copy template details to vm instance details when import VM#12793
server: copy template details to vm instance details when import VM#12793weizhouapache wants to merge 3 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.67% 17.66% -0.01%
+ Complexity 15797 15794 -3
============================================
Files 5923 5923
Lines 533349 533355 +6
Branches 65248 65250 +2
============================================
- Hits 94253 94242 -11
- Misses 428437 428453 +16
- Partials 10659 10660 +1
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. |
7dc8127 to
0ed525a
Compare
| // 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. |
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?