Bug 1259038 - virt-who fake backend not working with virt-who.noarch-0.14-1.el6_6sat.noarch
virt-who fake backend not working with virt-who.noarch-0.14-1.el6_6sat.noarch
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: virt-who (Show other bugs)
x86_64 Linux
unspecified Severity high
: pre-dev-freeze
: ---
Assigned To: Radek Novacek
Depends On: 1258765
Blocks: 1272873
  Show dependency treegraph
Reported: 2015-09-01 16:02 EDT by Leo Thomas
Modified: 2016-11-30 19:32 EST (History)
5 users (show)

See Also:
Fixed In Version: virt-who-0.16-1.el6
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2016-05-10 19:56:23 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Leo Thomas 2015-09-01 16:02:42 EDT
Description of problem:

The virt-who fake backend fails to work with virt-who.noarch-0.14-1.el6_6sat.noarch 

Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:

1. Install virt-who.noarch-0.14-1.el6_6sat.noarch on the server.

Collect host/guest mapping to create fake virt-who file using following command :-

# virt-who --esx --esx-owner=Default_Organization --esx-env=Library --esx-server=lab-ex5.gsslab.pnq.redhat.com --esx-username=root --esx-password=RedHat1! -p -d > /root/fake

Configure virt-who as following :-

cat /etc/virt-who.d/virt 


cat /etc/sysconfig/virt-who


Restart virt-who service 

Actual results:

tailf /var/log/rhsm/rhsm.log

2015-09-02 00:47:30,800 [DEBUG]  @virtwho.py:152 - Starting infinite loop with 3600 seconds interval
2015-09-02 00:47:31,093 [ERROR]  @virtwho.py:123 - Error in communication with subscription manager:
Traceback (most recent call last):
  File "/usr/share/virt-who/virtwho.py", line 107, in send
  File "/usr/share/virt-who/virtwho.py", line 134, in _sendGuestAssociation
    result = manager.hypervisorCheckIn(report.config, report.association, report.config.type)
  File "/usr/share/virt-who/manager/subscriptionmanager/subscriptionmanager.py", line 145, in hypervisorCheckIn
    serialized_mapping[host] = [guest.toDict() for guest in guests]
AttributeError: 'dict' object has no attribute 'toDict'

Expected results:

virt-who should send the host/guest mapping to Satellite and should see the following message on the rhsm.log file

[INFO]  @virtwho.py:147 - virt-who host/guest association update successful

Additional info:

virt-who-0.12-10.el6.noarch works perfectly with the same configuration file. 

tailf /var/log/rhsm/rhsm.log

0ace-f22f-b9febf779b7a', 'attributes': {'active': 1, 'virtWhoType': 'esx'}, 'state': 1}, {'guestId': '564d6eb5-85f9-9172-7bd3-d214c915fdc0', 'attributes': {'active': 1, 'virtWhoType': 'esx'}, 'state': 1}]}
2015-09-02 00:52:37,048 [DEBUG]  @subscriptionmanager.py:76 - Authenticating with certificate: /etc/pki/consumer/cert.pem
2015-09-02 00:52:38,497 [INFO]  @virtwho.py:147 - virt-who host/guest association update successful
Comment 2 Radek Novacek 2015-09-29 07:56:10 EDT
This issue has been addressed upstream and will be part of rebased virt-who package.
Comment 3 Radek Novacek 2015-12-17 07:30:59 EST
Fixed by rebase to virt-who-0.16-1.el6.
Comment 5 Liushihui 2016-02-24 03:14:33 EST
Verified it on virt-who-0.16-4.el6.noarch since virt-who can send host/guest mapping to server when run at fake mode. Therefore, verified it.

Verified version:

Verified process:
1 Register system to satellite6
2 Collect host/guest mapping to create fake virt-who file using following command:
[root@sgi-xe500-01 ~]# virt-who --esx --esx-owner=Default_Organization --esx-env=Library --esx-server= --esx-username=root --esx-password=Welcome1! -p -d > /root/fake
[root@sgi-xe500-01 ~]# cat /root/fake
{"hypervisors": [{"uuid": "7a384d56-085c-0e32-c7ad-f7181c3f6ddf", "guests": []}, {"uuid": "77ea4d56-2176-2518-74f6-d350749401dd", "guests": []}, {"uuid": "c74a4d56-677e-dd13-828f-617c5cdf0329", "guests": []}, {"uuid": "60554d56-20cb-f25e-7ab9-33e7e330dc15", "guests": []}, {"uuid": "3e504d56-3982-037b-f3e6-669289892fa1", "guests": [{"guestId": "564db653-006a-906b-d2e3-43e033df954a", "state": 5, "attributes": {"active": 0, "hypervisorVersion": "6.0.0", "virtWhoType": "esx", "hypervisorType": "VMware ESXi"}}]}]}
3. Configure virt-who run at fake mode as the following:
[root@sgi-xe500-01 ~]# cat /etc/virt-who.d/virt 
[root@sgi-xe500-01 ~]# cat /etc/sysconfig/virt-who  | grep -v ^# | grep -v ^$
4. Check virt-who log in /var/log/rhsm/rhsm.log
2016-02-24 03:05:23,895 [virtwho.init DEBUG] MainProcess(31357):MainThread @virtwho.py:__init__:125 - Using config named 'fake-virt'
2016-02-24 03:05:23,895 [virtwho.init INFO] MainProcess(31357):MainThread @virtwho.py:main:722 - Using configuration "fake-virt" ("fake" mode)
2016-02-24 03:05:23,917 [virtwho.main DEBUG] MainProcess(31359):MainThread @virtwho.py:run:229 - Starting infinite loop with 60 seconds interval
2016-02-24 03:05:24,059 [virtwho.fake-virt DEBUG] FakeVirt-1(31367):MainThread @virt.py:run:358 - Virt backend 'fake-virt' started
2016-02-24 03:05:24,062 [virtwho.fake-virt DEBUG] FakeVirt-1(31367):MainThread @virt.py:enqueue:351 - Report gathered, putting to queue for sending
2016-02-24 03:05:24,078 [virtwho.main DEBUG] MainProcess(31359):MainThread @subscriptionmanager.py:_connect:121 - Authenticating with certificate: /etc/pki/consumer/cert.pem
2016-02-24 03:05:24,454 [virtwho.main DEBUG] MainProcess(31359):MainThread @subscriptionmanager.py:hypervisorCheckIn:162 - Checking if server has capability 'hypervisor_async'
2016-02-24 03:05:25,315 [virtwho.main DEBUG] MainProcess(31359):MainThread @subscriptionmanager.py:hypervisorCheckIn:174 - Server does not have 'hypervisors_async' capability
2016-02-24 03:05:25,315 [virtwho.main INFO] MainProcess(31359):MainThread @subscriptionmanager.py:hypervisorCheckIn:185 - Sending update in hosts-to-guests mapping for config "fake-virt": 5 hypervisors and 1 guests found
2016-02-24 03:05:25,315 [virtwho.main DEBUG] MainProcess(31359):MainThread @subscriptionmanager.py:hypervisorCheckIn:186 - Host-to-guest mapping: {
    "7a384d56-085c-0e32-c7ad-f7181c3f6ddf": [], 
    "3e504d56-3982-037b-f3e6-669289892fa1": [
            "guestId": "564db653-006a-906b-d2e3-43e033df954a", 
            "state": 5, 
            "attributes": {
                "active": 0, 
                "hypervisorVersion": "6.0.0", 
                "virtWhoType": "esx", 
                "hypervisorType": "VMware ESXi"
    "77ea4d56-2176-2518-74f6-d350749401dd": [], 
    "c74a4d56-677e-dd13-828f-617c5cdf0329": [], 
    "60554d56-20cb-f25e-7ab9-33e7e330dc15": []

Result: virt-who can send host/guest mapping info to satellite
Comment 7 errata-xmlrpc 2016-05-10 19:56:23 EDT
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.


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