engine/schema: fix new systemvm template is not registered during upgrade if hypervisor is not KVM#12952
Conversation
…rade if hypervisor is not KVM
|
@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. |
|
Packaging result [SF]: ✖️ el8 ✖️ el9 ✖️ debian ✖️ suse15. SL-JID 17343 |
|
@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. |
| new Pair<>(Hypervisor.HypervisorType.XenServer, CPU.CPUArch.getDefault()), | ||
| new Pair<>(Hypervisor.HypervisorType.Hyperv, CPU.CPUArch.getDefault()), | ||
| new Pair<>(Hypervisor.HypervisorType.LXC, CPU.CPUArch.getDefault()), | ||
| new Pair<>(Hypervisor.HypervisorType.Ovm3, CPU.CPUArch.getDefault()) |
There was a problem hiding this comment.
@weizhouapache when arch type is null, it's defaulted to amd64, is null arch issue here?
There was a problem hiding this comment.
also, make note of the changes in the below PR in main (no need of forward merging the changes here to main)
There was a problem hiding this comment.
@sureshanaparti
in another place
the arch of MetadataTemplateDetails is from hypervisorType, which is null for non-KVM
NewTemplateMap.put(key, new MetadataTemplateDetails(
hypervisorType.first(),
section.get("templatename"),
section.get("filename"),
section.get("downloadurl"),
section.get("checksum"),
hypervisorType.second(),
section.get("guestos")));
but in hypervisorsInUse, the arch is amd64/x86_64 (default arch of clusters)
cluster arch
mysql> SELECT DISTINCT hypervisor_type,arch from cluster;
+-----------------+--------+
| hypervisor_type | arch |
+-----------------+--------+
| VMware | x86_64 |
+-----------------+--------+
1 row in set (0.00 sec)
so the check always return false (line 1034)
There was a problem hiding this comment.
also, make note of the changes in the below PR in main (no need of forward merging the changes here to main)
good point @sureshanaparti
so the issue should not appear in 4.22, great
There was a problem hiding this comment.
ok @weizhouapache, how about replacing hypervisorType.second() == null ? CPU.CPUArch.amd64.getType() : hypervisorType.second().getType() at
maybe, move it to method and use the call same method here and in getHypervisorArchKey()
private String getCPUArchType(CPU.CPUArch arch) {
if (arch == null) {
return CPU.CPUArch.amd64.getType();
}
return arch.getType();
}
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## 4.20 #12952 +/- ##
=========================================
Coverage 16.26% 16.26%
- Complexity 13433 13434 +1
=========================================
Files 5665 5665
Lines 500530 500530
Branches 60787 60787
=========================================
+ Hits 81395 81417 +22
+ Misses 410044 410021 -23
- Partials 9091 9092 +1
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 17344 |
|
@blueorangutan test |
|
@weizhouapache a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests |
Description
This PR fixes the issue that the new systemvm template is not registered for non-KVM hypervisor types
Types 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?