Bug 1353074

Summary: virt-who failed to show the rhevm guest state, if the guest is running, the state is 0
Product: Red Hat Enterprise Linux 7 Reporter: Eko <hsun>
Component: virt-whoAssignee: Radek Novacek <rnovacek>
Status: CLOSED ERRATA QA Contact: Eko <hsun>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 7.3CC: ovasik, sgao, shihliu
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: virt-who-0.17-6.el7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-11-04 05:10:01 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Eko 2016-07-06 02:15:05 UTC
Description of problem:
running a guest in rhevm4.0, virt-who show the "0" state, not "1"

Version-Release number of selected component (if applicable):
virt-who-0.17-5.el7.noarch
subscription-manager-1.17.8-1.el7.x86_64
python-rhsm-1.17.5-1.el7.x86_64

How reproducible:
always

Steps to Reproduce:
1. running a guest in rhevm-4.0

2. configure virt-who for rhevm mode
[test-rhevm]
type=rhevm
server=https://bootp-73-3-237.eng.pek2.redhat.com:443/ovirt-engine/
username=admin@internal
password=admin
owner=ACME_Corporation
env=Library

3. restart virt-who and check the rhsm.log
# virt-who -c rhevm.conf -d
2016-07-05 22:13:44,814 [virtwho.init INFO] MainProcess(20231):MainThread @main.py:main:160 - Using configuration "test-rhevm" ("rhevm" mode)
2016-07-05 22:13:44,814 [virtwho.init INFO] MainProcess(20231):MainThread @main.py:main:162 - Using reporter_id='hp-z220-12.qe.lab.eng.nay.redhat.com-14b12011609544bdb19af97d8c8032a9'
2016-07-05 22:13:44,815 [virtwho.main DEBUG] MainProcess(20231):MainThread @executor.py:run:171 - Starting infinite loop with 60 seconds interval
2016-07-05 22:13:44,845 [virtwho.test-rhevm DEBUG] RhevM-1(20238):MainThread @virt.py:run:364 - Virt backend 'test-rhevm' started
2016-07-05 22:13:45,397 [virtwho.test-rhevm WARNING] RhevM-1(20238):MainThread @rhevm.py:getHostGuestMapping:190 - Guest 31938edc-7b19-4e18-9141-3e43c87ba2b1 doesn't report any status
2016-07-05 22:13:45,398 [virtwho.test-rhevm DEBUG] RhevM-1(20238):MainThread @virt.py:enqueue:357 - Report for config "test-rhevm" gathered, putting to queue for sending
2016-07-05 22:13:45,408 [virtwho.main DEBUG] MainProcess(20231):MainThread @subscriptionmanager.py:_connect:123 - Authenticating with certificate: /etc/pki/consumer/cert.pem
2016-07-05 22:13:45,768 [virtwho.main DEBUG] MainProcess(20231):MainThread @subscriptionmanager.py:hypervisorCheckIn:171 - Checking if server has capability 'hypervisor_async'
2016-07-05 22:13:46,092 [virtwho.main DEBUG] MainProcess(20231):MainThread @subscriptionmanager.py:hypervisorCheckIn:183 - Server does not have 'hypervisors_async' capability
2016-07-05 22:13:46,092 [virtwho.main INFO] MainProcess(20231):MainThread @subscriptionmanager.py:hypervisorCheckIn:194 - Sending update in hosts-to-guests mapping for config "test-rhevm": 2 hypervisors and 1 guests found
2016-07-05 22:13:46,092 [virtwho.main DEBUG] MainProcess(20231):MainThread @subscriptionmanager.py:hypervisorCheckIn:195 - Host-to-guest mapping: {
    "00266dfa-d283-48cf-afe7-6ce6d5378ca1": [
        {
            "guestId": "31938edc-7b19-4e18-9141-3e43c87ba2b1", 
            "state": 0, 
            "attributes": {
                "active": 0, 
                "virtWhoType": "rhevm"
            }
        }
    ], 
    "6ae19c1e-5c76-4389-9cc4-e131fca41595": []
}
2016-07-05 22:13:47,170 [virtwho.main DEBUG] MainProcess(20231):MainThread @executor.py:send_report:101 - Report for config "test-rhevm" sent



Actual results:
if guest is running, the state and active is still 0

Expected results:
the state and active should be 1  when guest running

Additional info:

Comment 1 Eko 2016-07-06 02:26:40 UTC
there is a warning message:
2016-07-05 22:13:45,397 [virtwho.test-rhevm WARNING] RhevM-1(20238):MainThread @rhevm.py:getHostGuestMapping:190 - Guest 31938edc-7b19-4e18-9141-3e43c87ba2b1 doesn't report any status

Comment 3 Radek Novacek 2016-07-12 13:27:37 UTC
This issue is now addressed upstream:

https://github.com/virt-who/virt-who/commit/ab3f6f6a5c862d6d623a867401d48dda42de7155

Comment 4 Radek Novacek 2016-07-14 12:19:56 UTC
Fixed in virt-who-0.17-6.el7.

Comment 6 Eko 2016-07-19 09:18:41 UTC
verified with virt-who-0.17-6.el7

if vm running: 
2016-07-19 05:15:13,709 [virtwho.main DEBUG] MainProcess(17541):MainThread @subscriptionmanager.py:hypervisorCheckIn:195 - Host-to-guest mapping: {
    "363a290e-7b23-47d4-b3d8-bf17418125f2": [
        {
            "guestId": "d8826da2-745d-4e4a-a757-43d6a4ae02c1", 
            "state": 1, 
            "attributes": {
                "active": 1, 
                "virtWhoType": "rhevm"
            }
        }
    ]
}


if vm suspend:
2016-07-19 05:16:17,060 [virtwho.main DEBUG] MainProcess(17541):MainThread @subscriptionmanager.py:hypervisorCheckIn:195 - Host-to-guest mapping: {
    "363a290e-7b23-47d4-b3d8-bf17418125f2": []
}

Comment 8 errata-xmlrpc 2016-11-04 05:10:01 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-2016-2387.html