Fix listing service offerings with different host tags#12919
Fix listing service offerings with different host tags#12919nvazquez wants to merge 3 commits intoapache:4.22from
Conversation
|
@blueorangutan package |
|
@nvazquez 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 Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## 4.22 #12919 +/- ##
============================================
- Coverage 17.60% 17.60% -0.01%
- Complexity 15676 15678 +2
============================================
Files 5918 5918
Lines 531667 531699 +32
Branches 65001 65006 +5
============================================
+ Hits 93617 93619 +2
- Misses 427491 427515 +24
- Partials 10559 10565 +6
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 17294 |
There was a problem hiding this comment.
Pull request overview
This PR updates service offering listing logic (used for VM scaling) so that offerings with different host tags are also shown, by expanding the tag filter to include tags present on hosts in the VM’s current cluster and by loosening host-tag matching to OR semantics.
Changes:
- Extend service offering filtering to include host tags from the VM’s current cluster when listing scale-eligible offerings.
- Change host-tag matching from requiring all tags (AND) to allowing any matching tag (OR), while still including untagged offerings.
- Add unit tests for collecting cluster host tags into the VM’s host tag filter.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
server/src/main/java/com/cloud/api/query/QueryManagerImpl.java |
Expands host-tag filtering for service offering listing and adds helper to include cluster tags. |
engine/schema/src/main/java/com/cloud/host/dao/HostTagsDao.java |
Adds DAO API to list host tags by cluster ID. |
engine/schema/src/main/java/com/cloud/host/dao/HostTagsDaoImpl.java |
Implements listing tags by cluster via host IDs + custom search. |
server/src/test/java/com/cloud/api/query/QueryManagerImplTest.java |
Adds tests for the new helper that augments host tags with current cluster tags. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
engine/schema/src/main/java/com/cloud/host/dao/HostTagsDaoImpl.java
Outdated
Show resolved
Hide resolved
|
@blueorangutan test |
|
@nvazquez a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests |
|
@blueorangutan package |
|
@nvazquez 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 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 17308 |
engine/schema/src/main/java/com/cloud/host/dao/HostTagsDaoImpl.java
Outdated
Show resolved
Hide resolved
Pearl1594
left a comment
There was a problem hiding this comment.
I was wondering if it would make sense to guard this under a global setting like vm.scale.allow.differing.host.tags, which by default would be false, to keep the existing behaviour. The reason being, with this PR it definitely gives flexibility to scale to an offering with different host tags, but end users may not be able to tell from the list which offerings would actually work for them. For example, if a user's VM is currently on a GPU host and they want to scale up for more resources, they may see SSD offerings in the list (because the cluster has SSD hosts as well), but depending on whether their specific host has both GPU and SSD tags or just GPU, the scale operation may succeed or fail with a "host tags" error. A global setting would allow users to opt into this new behaviour while keeping the current behaviour as the default.
|
[SF] Trillian test result (tid-15776)
|
Description
This PR fixes the listing of service offerings for VMs, including offerings that contain different host tags. Previously only offerings without any host tag or offerings matching exactly the same VM offering host tags were displayed
Fixes: #11407
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?