Fix listing service offerings with different host tags#12919
Fix listing service offerings with different host tags#12919DaanHoogland merged 5 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 15675 -1
============================================
Files 5918 5918
Lines 531667 531721 +54
Branches 65001 65013 +12
============================================
+ Hits 93617 93621 +4
- Misses 427491 427535 +44
- 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
|
@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 17314 |
There was a problem hiding this comment.
@nvazquez the setting is not in effect for custom offerings
Steps to reproduce the issue
-
Have 2 host tags with hosttags h1 and h2 respectively
-
Create a custom unconstrained offering c1 with host tag h1
-
Create another custom unconstrained offering c2 with host tag h2
-
Make sure dynamic scaling is enabled in the global settings and service offering and the registered template
-
Deploy a vm with the custom unconstrained offering c1
-
Make sure the global setting "allow.different.host.tags.offerings.for.vm.scale" is enabled
-
Scale the running vm
-
The custom unconstrained offering c2 with host tag h2 is not displayed
- If the vm is stopped then all the offerings are displayed
|
Hi @kiranchavala this is similar to issue: #6865 and it seems to be by design from PR: #5923. I do see it is planned to be fixed by: #12908 |
kiranchavala
left a comment
There was a problem hiding this comment.
@nvazquez can you add the host tags and storage tags in the UI
when a user tries to scale the VM, it's handy to see the tags associated with the service offering
https://cloudstack.apache.org/api/apidocs-4.22/apis/listServiceOfferings.html
(local) 🐱 > list serviceofferings id=57d7582f-d854-477c-9690-329eeada8d32 filter=hosttags,storagetags
{
"count": 1,
"serviceoffering": [
{
"hosttags": "test3",
"storagetags": "test3"
}
]
}
|
@kiranchavala please find the fix pushed, host tags and/or storage tags will only be displayed when available at least in one offering from the list @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 17388 |
|
@blueorangutan test |
|
@DaanHoogland a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests |
|
[SF] Trillian test result (tid-15821)
|
kiranchavala
left a comment
There was a problem hiding this comment.
LGTM
Tested the issue manually
Tested with both admin and with normal user role
Have 2 host tags with hosttags h1 and h2 respectively
Create a compute offering c1,c2,c3 with host tags h1,h2,h3 respectively
Stop the vm
Scale the vm
Only the compute offering c3 is visible, as it has the same host tag
Make sure the global setting "allow.different.host.tags.offerings.for.vm.scale" is enabled
Scale the vm
Compute offering c2 is also visible, though it having a host tag h2
Also the host tags and storage tags are visible in the ui
Description
This PR introduces the global setting:
allow.different.host.tags.offerings.for.vm.scaleto fix the listing of service offerings for VMs, including offerings that contain different host tags.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?