-
Notifications
You must be signed in to change notification settings - Fork 1.2k
server: fix available hypervisors listing for a zone #10738
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
server: fix available hypervisors listing for a zone #10738
Conversation
In the absence of a SYSTEM type template for a zone, listing of templates can break. Behaviour was change in apache#9840 but it would be better to find available hypervisors using existing hosts.
@blueorangutan package |
@shwstppr 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. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## 4.20 #10738 +/- ##
=========================================
Coverage 16.01% 16.02%
Complexity 13123 13123
=========================================
Files 5652 5652
Lines 495921 495921
Branches 60053 60053
=========================================
+ Hits 79446 79451 +5
+ Misses 407611 407607 -4
+ Partials 8864 8863 -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:
|
Re-kicking smoketests in Github Actions. @blueorangutan package |
@rohityadavcloud 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I remember there is a similar method, so looked for it
cloudstack/engine/schema/src/main/java/com/cloud/dc/dao/ClusterDaoImpl.java
Lines 168 to 178 in 55c8115
public List<HypervisorType> getAvailableHypervisorInZone(Long zoneId) { | |
SearchCriteria<ClusterVO> sc = AvailHyperSearch.create(); | |
if (zoneId != null) { | |
sc.setParameters("zoneId", zoneId); | |
} | |
List<ClusterVO> clusters = listBy(sc); | |
return clusters.stream() | |
.map(ClusterVO::getHypervisorType) | |
.distinct() | |
.collect(Collectors.toList()); | |
} |
Packaging result [SF]: ✖️ el8 ✖️ el9 ✖️ debian ✖️ suse15. SL-JID 13077 |
Packaging result [SF]: ✖️ el8 ✖️ el9 ✖️ debian ✖️ suse15. SL-JID 13076 |
nice find @weizhouapache , do you mean we should make a template method? |
@shwstppr can you review and fix the build/CI failures? |
Signed-off-by: Abhishek Kumar <[email protected]>
@weizhouapache are you suggesting using ClusterDao method here or in the callers itself? |
@blueorangutan package |
@shwstppr 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. |
if the method returns the same result, we can use it.
if there is a cluster without any host, then the results will be different .. |
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 13088 |
Thanks @weizhouapache . It seems HostDao and ClusterDao can return different results. Maybe we can have a separate refactor to consolidate this or should I make the change here to use ClusterDao? |
@blueorangutan test |
@shwstppr a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests |
[SF] Trillian test result (tid-13072)
|
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.
code lgtm
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.
clgtm
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.
LGTM based on manual testing
@shwstppr , this looks ready to merge, do you feel it is ready? |
@DaanHoogland yes. Marked it ready for review |
Description
In the absence of a SYSTEM type template for a zone, listing of templates can break.
Behaviour was change in #9840 but it would be better to find available hypervisors using existing hosts.
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?