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
SWATCH-1929: Replace rhsm.VM_HOST_UUID by system profile.virtual_host_uuid #3043
Conversation
/retest |
1 similar comment
/retest |
+ "left outer join hosts h_ on h.facts->'satellite'->>'virtual_host_uuid' = h_.canonical_facts->>'subscription_manager_id' " | ||
+ "where h.facts->'satellite'->'virtual_host_uuid' is not null " |
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.
We actually still need to consult the 'satellite'->'virtual_host_uuid'
fact, because the reporting pipeline for Satellite doesn't yet use the canonical field.
I determined this via:
- https://github.com/RedHatInsights/yuptoo doesn't have any special handling of
virtual_host_uuid
- the satellite plugin reports
virtual_host_uuid
as a Satellite-specific fact.
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.
Thanks for the pointers! I've just removed the satelite changes and updated the PR and JIRA descriptions.
3f859eb
to
cdc0733
Compare
QE : Needs to modify |
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.
- Create a Hypervisor Guest map using swatch-client or smqe-tools in a account. Creates one hypervsior with 2 guests
swatch-client consumer hypervisor -u <username> -g 2
- In EE, Sync conduit and check HBI if the hosts are present along with
virtual_host_uuid
for guests
app.host_inventory.rest_client.hosts_api.api_host_get_host_list()
app.host_inventory.rest_client.hosts_api.api_host_get_host_system_profile_by_id(['id of the guests from above result'])
{'count': 1,
'page': 1,
'per_page': 50,
'results': [{'id': '01d43448-adba-413a-842f-5f7407b6961b',
'system_profile': {'ansible': None,
'arch': 'x86_64',
'basearch': None,
<snip>
'virtual_host_uuid': 'd54b8b39-a433-46f4-8810-d96c1b437d2d',
'yum_repos': None}}],
'total': 1}
- Sync tally and check if the hypervisor is correctly tallied and present in system_table along with guests
app.rhsm_subscriptions.rest_client.instances_api.get_instances_by_product("RHEL for x86",uom="Sockets",category="hypervisor")
2024-02-16 12:26:09.970 [ INFO] [root] REST: http://swatch-api-service.ephemeral-9hddxl.svc:8000/api/rhsm-subscriptions/v1/instances/products/RHEL%20for%20x86
2024-02-16 12:26:10.211 [ INFO] [iqe.base.rest_client] REST: METHOD=GET, request_id=None, params=[('uom', 'Sockets'), ('category', 'hypervisor')]
Out[12]:
{'data': [{'category': 'hypervisor',
'display_name': 'hyper_ifxyorum.example.edu',
'id': '8a0951f6-df69-4c9a-afbe-a4b947332934',
'instance_id': '869a18ad-1858-46bc-935d-3099087fd83e',
'last_seen': datetime.datetime(2024, 2, 16, 12, 6, 36, 788247, tzinfo=tzlocal()),
'measurements': [2.0],
'number_of_guests': 2,
'subscription_manager_id': 'd54b8b39-a433-46f4-8810-d96c1b437d2d'}],
'meta': {'count': 1, 'measurements': ['Sockets'], 'product': 'RHEL for x86'}}
Raised a fix for test failure, will merge after this PR is merged. |
Okis, merging then! |
@Sgitario Can we keep this open for while, we are trying to see if we can succesfully make the CI here green |
/retest |
+1 let me know when I can merge it, or feel free to merge it yourself. |
/retest |
2 similar comments
/retest |
/retest |
@Sgitario We can merge this |
@san7ket , thanks! Merged. |
Jira issue: SWATCH-1929
Description
Add support for the recently added system profile fact virtual_host_uuid (RedHatInsights/inventory-schemas#121) which replaces legacy facts rhsm.VM_HOST_UUID.
Testing
1.- podman-compose up
2.- Create hosts for orgId=16790890 in Insights database
3.- DEV_MODE=true SUBSCRIPTION_SYNC_ENABLED=true ENABLE_SYNCHRONOUS_OPERATIONS=true ./gradlew :bootRun
4.- Perform tally snapshot:
5.- Query the created hosts in the swatch database and confirm the virtual_host_uuid has been used:
SELECT hypervisor_uuid FROM hosts;
It should be 123456.