Problem:
Host to guest mapping not working on katello using virt-who and a fake hypervisor (AHV)
Expected outcome:
When sending to katello a fake virt-who mapping json file
I expect to assign licenses to my guests correctly.
The wirt-who log says: Hosts-to-guests mapping for config “fake-virt”: 1 hypervisors and 3 guests found
And the json file is uploaded correctly.
I can assign to my fake hypervisor a VDC license
but I cannot see my guests as part of the content host.
When I try to assign a license, on candelpin server (in debug mode) I can see:
WARN org.candlepin.bind.PreEntitlementRulesCheckOp - Entitlement not granted: [virt.guest.host.does.not.match.pool.owner] for pool: 8a84becb68cd8f140168dc73f91e04cc
ERROR org.candlepin.bind.BindChain - Skipped chain in preprocess of operation PreEntitlementRulesCheckOp
And on client side I see:
Pool “8a84becb68cd8f140168dc73f91e04cc” is restricted to guests running on host: “0ea35d1d-3f34-450f-9289-47bfb9193519”
Foreman and Proxy versions:
1.20.1
Foreman and Proxy plugin versions:
foreman_virt_who_configure 0.3.0
katello 3.10.0
Other relevant data:
logs
#/etc/virt-who.d/fake.conf
[fake-virt]
type=fake
file=/etc/virt-who.d/json/fake.json
is_hypervisor=True
owner=XXXX
env=Library
rhsm_hostname=foreman.XXXX
rhsm_username=virt_who_reporter_2
rhsm_encrypted_password=my_encrypted_password
rhsm_prefix=/rhsm
#/etc/virt-who.d/json/fake.json
{
"hypervisors":[
{"uuid": "myfake-ahv",
"guests":[
{"guestId": "995b396b-1aed-4624-9dd8-e8bb3eb4353e", "state":1, "attributes": {"active": 1, "virtWhoType": "fake"} },
{"guestId": "7c5917bf-b412-4cd8-a60c-2375291e21ab", "state":1, "attributes": {"active": 1, "virtWhoType": "fake"} },
{"guestId": "e25a3fa8-59b2-42a0-b645-b78f09872fa9", "state":1, "attributes": {"active": 1, "virtWhoType": "fake"} }
]
}
]}
# virt-who -d -o -c /etc/virt-who.d/fake.conf
2019-02-12 10:21:28,305 [virtwho.destination_7213977238706796299 DEBUG] MainProcess(145005):Thread-3 @subscriptionmanager.py:hypervisorCheckIn:246 - Host-to-guest mapping being sent to 'XXXX': {
"hypervisors": [
{
"hypervisorId": {
"hypervisorId": "myfake-ahv"
},
"guestIds": [
{
"guestId": "7c5917bf-b412-4cd8-a60c-2375291e21ab",
"state": 1,
"attributes": {
"active": 0,
"virtWhoType": "fake"
}
},
{
"guestId": "995b396b-1aed-4624-9dd8-e8bb3eb4353e",
"state": 1,
"attributes": {
"active": 1,
"virtWhoType": "fake"
}
},
{
"guestId": "e25a3fa8-59b2-42a0-b645-b78f09872fa9",
"state": 1,
"attributes": {
"active": 1,
"virtWhoType": "fake"
}
}
]
}
]
}