RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1257396 - virt-who still send H/G mapping info to server although is_hypervisor is wrong
Summary: virt-who still send H/G mapping info to server although is_hypervisor is wrong
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: virt-who
Version: 7.2
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: rc
: ---
Assignee: Radek Novacek
QA Contact: xingge
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-08-27 02:26 UTC by Liushihui
Modified: 2016-12-01 00:33 UTC (History)
5 users (show)

Fixed In Version: virt-who-0.14-6.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-11-19 11:57:58 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2015:2370 0 normal SHIPPED_LIVE virt-who bug fix and enhancement update 2015-11-19 10:39:27 UTC

Description Liushihui 2015-08-27 02:26:09 UTC
Description of problem:
Although the fake data are fetched from multihost environment when virt-who run at offline mode, setting is_hypervisor=False(wrong config), virt-who still send wrong host/guest mapping info to server rather than send error info in the log.

Version-Release number of selected component (if applicable):
virt-who-0.14-4.el7.noarch
subscription-manager-1.15.9-6.el7.x86_64
python-rhsm-1.15.4-2.el7.x86_64
Satellite6.1.0-20150818.1

How reproducible:
Always

Steps to Reproduce:
1. Register system to satellite
2. Generate fake data which are fetched from multihost environment and save it to /root/fake:
# cat /root/fake
{"hypervisors": [{"uuid": "88d979a3-34f8-4cca-84e8-df0988257ba6", "guests": []}, {"uuid": "2c014415-c274-40f4-8265-b99c83d3e1aa", "guests": [{"guestId": "754215b3-e01e-420f-b7a8-e0cd2972c624", "state": 1, "attributes": {"active": 1, "virtWhoType": "rhevm", "hypervisorType": "qemu"}}, {"guestId": "4f1f93b8-c4c5-424d-89d8-1822367d2274", "state": 1, "attributes": {"active": 1, "virtWhoType": "rhevm", "hypervisorType": "qemu"}}]}]}
3. Run virt-who at offline mode and set is_hypervisor=False
# cat /etc/virt-who.d/fake
[fake-virt]
type=fake
file=/root/fake
is_hypervisor=False
owner=ACME_Corporation
env=Library
4.Restart virt-who service and check virt-who's log
# tail -f /var/log/rhsm/rhsm.log
2015-08-26 17:19:02,016 [DEBUG]  @virtwho.py:126 - Using config named 'fake-virt'
2015-08-26 17:19:02,017 [INFO]  @virtwho.py:661 - Using configuration "fake-virt" ("fake" mode)
2015-08-26 17:19:02,017 [DEBUG]  @virtwho.py:209 - Starting infinite loop with 3600 seconds interval
2015-08-26 17:19:02,050 [DEBUG]  @subscriptionmanager.py:112 - Authenticating with certificate: /etc/pki/consumer/cert.pem
2015-08-26 17:19:05,623 [INFO]  @subscriptionmanager.py:136 - Sending domain info: [] 

Actual results:
virt-who send wrong mapping info to server,it just fetched guest info from the first host 

Expected results:
Since fake data are fetched from multihost environment which is not suit to is_hypervisor = False, Virt-who shouldn't send the wrong mapping info to satellite, it should show error info in the log:
" Virt backend 'fake-virt' fails with error: Fake virt file '/root/fake' is not properly formed: 'uuid' "

Additional info:
When fake data are fetched from singal host environment, setting is_hypervisor=True(Wrong config), virt-who won't send host/guest mapping to server but show error info as the following:
" Virt backend 'fake-virt' fails with error: Fake virt file '/root/fake' is not properly formed: 'uuid' "

Comment 1 Radek Novacek 2015-08-27 14:55:11 UTC
Fixed in virt-who-0.14-6.el7.

Comment 3 Liushihui 2015-09-06 03:06:55 UTC
Verified it on virt-who-0.14-7.el7.noarch since virt-who won't send h/g mapping to satellite when is_hypervisor is wrong. Therefore, verify it.

Verified version:
virt-who-0.14-7.el7.noarch
subscription-manager-1.15.9-7.el7.x86_64
python-rhsm-1.15.4-4.el7.x86_64

Verified process:
1. Register system to satellite
2. Generate fake data which are fetched from multihost environment and save it to /root/fake:
# cat /root/fake
{"hypervisors": [{"uuid": "88d979a3-34f8-4cca-84e8-df0988257ba6", "guests": []}, {"uuid": "2c014415-c274-40f4-8265-b99c83d3e1aa", "guests": [{"guestId": "754215b3-e01e-420f-b7a8-e0cd2972c624", "state": 1, "attributes": {"active": 1, "virtWhoType": "rhevm", "hypervisorType": "qemu"}}, {"guestId": "4f1f93b8-c4c5-424d-89d8-1822367d2274", "state": 1, "attributes": {"active": 1, "virtWhoType": "rhevm", "hypervisorType": "qemu"}}]}]}
3. Run virt-who at offline mode and set is_hypervisor=False
# cat /etc/virt-who.d/fake
[fake-virt]
type=fake
file=/root/fake
is_hypervisor=False
owner=ACME_Corporation
env=Library
4.Restart virt-who service and check virt-who's log
# tail -f /var/log/rhsm/rhsm.log
2015-09-06 11:03:06,388 [DEBUG]  @virtwho.py:132 - Using config named 'fake-virt'
2015-09-06 11:03:06,389 [INFO]  @virtwho.py:696 - Using configuration "fake-virt" ("fake" mode)
2015-09-06 11:03:06,389 [DEBUG]  @virtwho.py:215 - Starting infinite loop with 3600 seconds interval
2015-09-06 11:03:06,424 [ERROR]  @virt.py:303 - Virt backend 'fake-virt' fails with error: Fake virt file '/root/fake' is not properly formed: uuid key shouldn't be present, try to check is_hypervisor value

Comment 4 errata-xmlrpc 2015-11-19 11:57:58 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2015-2370.html


Note You need to log in before you can comment on or make changes to this bug.