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 2 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.61% 17.68% +0.06%
- Complexity 15661 15791 +130
============================================
Files 5917 5922 +5
Lines 531402 533125 +1723
Branches 64971 65203 +232
============================================
+ Hits 93586 94259 +673
- Misses 427262 428223 +961
- Partials 10554 10643 +89
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 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, |
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?