-
Notifications
You must be signed in to change notification settings - Fork 1.3k
engine/schema: fix new systemvm template is not registered during upgrade if hypervisor is not KVM #12952
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
abh1sar
merged 3 commits into
apache:4.20
from
weizhouapache:4.20-fix-missing-new-systemvm-template
Apr 6, 2026
Merged
engine/schema: fix new systemvm template is not registered during upgrade if hypervisor is not KVM #12952
Changes from 2 commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@weizhouapache when arch type is null, it's defaulted to amd64, is null arch issue here?
cloudstack/engine/schema/src/main/java/com/cloud/upgrade/SystemVmTemplateRegistration.java
Lines 402 to 408 in e2497cf
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also, make note of the changes in the below PR in main (no need of forward merging the changes here to main)
https://github.com/apache/cloudstack/pull/11656/changes#diff-a9c9a38684718059c060de404bf9529de96e502f1e81b30793e6a32f725042a9
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sureshanaparti
in another place
the arch of MetadataTemplateDetails is from hypervisorType, which is null for non-KVM
but in
hypervisorsInUse, the arch is amd64/x86_64 (default arch of clusters)cloudstack/engine/schema/src/main/java/com/cloud/upgrade/SystemVmTemplateRegistration.java
Line 1068 in e2497cf
cluster arch
so the check always return false (line 1034)
cloudstack/engine/schema/src/main/java/com/cloud/upgrade/SystemVmTemplateRegistration.java
Lines 1032 to 1034 in e2497cf
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good point @sureshanaparti
so the issue should not appear in 4.22, great
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok @weizhouapache, how about replacing
hypervisorType.second() == null ? CPU.CPUArch.amd64.getType() : hypervisorType.second().getType()atcloudstack/engine/schema/src/main/java/com/cloud/upgrade/SystemVmTemplateRegistration.java
Line 837 in e2497cf
maybe, move it to method and use the call same method here and in getHypervisorArchKey()