Bug 1359640

Summary: Can't print host's name and facts when run "virt-who -p"
Product: Red Hat Enterprise Linux 7 Reporter: Liushihui <shihliu>
Component: virt-whoAssignee: Radek Novacek <rnovacek>
Status: CLOSED ERRATA QA Contact: Eko <hsun>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 7.3CC: ldai, ovasik, sgao
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: virt-who-0.17-7.el7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-11-04 05:10:07 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 Liushihui 2016-07-25 08:04:00 UTC
Description of problem:
Virt-who can't print host's name and facts after run "virt-who -p"

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

How reproducible:
Always

Steps to Reproduce:
1. Register system to satellite5.7
2. Run virt-who with CLI to print esx's host/guest mapping info
[root@hp-microservergen8-01 ~]# virt-who -d -p --satellite --satellite-server=sat57.jul21.redhat.com --satellite-username=admin --satellite-password=redhat --esx --esx-owner=linuxera --esx-env=linuxera --esx-server=https://10.73.2.95:443 --esx-username=administrator --esx-password=Welcome1! > /root/aaa
2016-07-25 03:48:07,521 [virtwho.init INFO] MainProcess(39982):MainThread @main.py:main:160 - Using configuration "env/cmdline" ("esx" mode)
2016-07-25 03:48:07,521 [virtwho.init INFO] MainProcess(39982):MainThread @main.py:main:162 - Using reporter_id='hp-microservergen8-01.ml3.eng.bos.redhat.com-7f98a6f2c3d140578ed8088db627b31a'
2016-07-25 03:48:07,560 [virtwho.env_cmdline DEBUG] Esx-1(39988):MainThread @virt.py:run:364 - Virt backend 'env/cmdline' started
2016-07-25 03:48:07,561 [virtwho.env_cmdline DEBUG] Esx-1(39988):MainThread @esx.py:_prepare:128 - Log into ESX
2016-07-25 03:48:09,167 [virtwho.env_cmdline DEBUG] Esx-1(39988):MainThread @esx.py:_prepare:131 - Creating ESX event filter
2016-07-25 03:48:09,838 [virtwho.env_cmdline DEBUG] Esx-1(39988):MainThread @virt.py:enqueue:357 - Report for config "env/cmdline" gathered, putting to queue for sending
2016-07-25 03:48:11,529 [virtwho.env_cmdline DEBUG] Esx-1(39988):MainThread @virt.py:run:383 - Virt backend 'env/cmdline' stopped after sending one report
2016-07-25 03:48:11,532 [virtwho.main DEBUG] MainProcess(39982):MainThread @main.py:_main:222 - Associations found: {
    "hypervisors": [
        {
            "guests": [], 
            "uuid": "60554d56-20cb-f25e-7ab9-33e7e330dc15"
        }, 
        {
            "guests": [
                {
                    "attributes": {
                        "active": 1, 
                        "virtWhoType": "esx"
                    }, 
                    "guestId": "4206405a-4133-bd0c-f8a5-9c7bc1355837", 
                    "state": 1
                }
            ], 
            "uuid": "3e504d56-3982-037b-f3e6-669289892fa1"
        }
    ]
}
2016-07-25 03:48:11,533 [virtwho.main DEBUG] MainProcess(39982):MainThread @__main__.py:main:19 - virt-who terminated
2016-07-25 03:48:11,533 [virtwho.main DEBUG] MainProcess(39982):MainThread @executor.py:terminate:303 - virt-who is shutting down


Actual results:
It only print hypervisor's uuid and guests, it hasn't print hypervisors' name and facts. hypervisor's name and facts.

Expected results:
It should not only print hypervisors' uuid and guests but also print its name and facts.
    "hypervisors": [
        {
            "guests": [], 
            "uuid": "60554d56-20cb-f25e-7ab9-33e7e330dc15"
            "name": "bootp-73-5-201.rhts.eng.pek2.redhat.com", 
            "facts": {
                "hypervisor.type": "VMware ESXi", 
                "cpu.cpu_socket(s)": "4", 
                "hypervisor.version": "6.0.0"
            }
        }, 
        {
            "guests": [
                {
                    "attributes": {
                        "active": 1, 
                        "virtWhoType": "esx"
                    }, 
                    "guestId": "4206405a-4133-bd0c-f8a5-9c7bc1355837", 
                    "state": 1
                }
            ], 
            "uuid": "3e504d56-3982-037b-f3e6-669289892fa1"
            "name": "bootp-73-5-248.rhts.eng.pek2.redhat.com", 
            "facts": {
                "hypervisor.type": "VMware ESXi", 
                "cpu.cpu_socket(s)": "4", 
                "hypervisor.version": "6.0.0"
            }

        }
    ]

Additional info:

Comment 1 Radek Novacek 2016-07-26 14:41:48 UTC
This issue is now addressed upstream.

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

Comment 3 Liushihui 2016-08-03 02:21:35 UTC
Verified on virt-who-0.17-7.el7.noarch since virt-who can print host's name and facts. Therefore, verify it.

Verified version:

Verified process:
1. Register system to satellite6.2
2. Run virt-who with CLI to print rhevm's host/guest mapping info
[root@hp-dl560egen8-01 virt-who.d]# virt-who --rhevm --rhevm-owner=ACME_Corporation --rhevm-env=Library --rhevm-server=https://ibm-x3690x5-01.rhts.eng.bos.redhat.com:443/ovirt-engine/ --rhevm-username=admin@internal --rhevm-password=redhat -p -d >/root/aaa
2016-08-02 22:03:28,776 [virtwho.init INFO] MainProcess(74037):MainThread @main.py:main:160 - Using configuration "env/cmdline" ("rhevm" mode)
2016-08-02 22:03:28,776 [virtwho.init INFO] MainProcess(74037):MainThread @main.py:main:162 - Using reporter_id='hp-dl560egen8-01.khw.lab.eng.bos.redhat.com-802e3ee1794e4d728db29e3f9fbae108'
2016-08-02 22:03:28,819 [virtwho.env_cmdline DEBUG] RhevM-1(74043):MainThread @virt.py:run:364 - Virt backend 'env/cmdline' started
2016-08-02 22:03:29,332 [virtwho.env_cmdline DEBUG] RhevM-1(74043):MainThread @virt.py:enqueue:357 - Report for config "env/cmdline" gathered, putting to queue for sending
2016-08-02 22:03:29,333 [virtwho.env_cmdline DEBUG] RhevM-1(74043):MainThread @virt.py:run:385 - Virt backend 'env/cmdline' stopped after sending one report
2016-08-02 22:03:29,337 [virtwho.main DEBUG] MainProcess(74037):MainThread @main.py:_main:226 - Associations found: {
    "hypervisors": [
        {
            "facts": {
                "cpu.cpu_socket(s)": "2", 
                "hypervisor.type": "qemu"
            }, 
            "guests": [
                {
                    "attributes": {
                        "active": 1, 
                        "virtWhoType": "rhevm"
                    }, 
                    "guestId": "4c4f9cbd-d811-4061-9aeb-050b774b870a", 
                    "state": 1
                }
            ], 
            "name": "dell-pe1950-06.rhts.englab.brq.redhat.com", 
            "uuid": "abd3f71b-a1f6-4538-9805-b5047d0978fd"
        }, 
        {
            "facts": {
                "cpu.cpu_socket(s)": "4", 
                "hypervisor.type": "qemu"
            }, 
            "guests": [
                {
                    "attributes": {
                        "active": 1, 
                        "virtWhoType": "rhevm"
                    }, 
                    "guestId": "530c34dc-2086-4f1d-a509-c417950bd0cb", 
                    "state": 1
                }
            ], 
            "name": "hp-dl560egen8-01.khw.lab.eng.bos.redhat.com", 
            "uuid": "9a722f5e-1411-4a1d-8e75-17e7dad3958a"
        }
    ]
}

Result:
It not only print hypervisors' uuid and guests but also print its name and facts.

Comment 5 errata-xmlrpc 2016-11-04 05:10:07 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