Bug 1295372 - virt-who can't support two hypervisors enabled in /etc/sysconfig/virt-who
virt-who can't support two hypervisors enabled in /etc/sysconfig/virt-who
Status: CLOSED NOTABUG
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: virt-who (Show other bugs)
6.8
x86_64 Linux
medium Severity medium
: rc
: ---
Assigned To: Radek Novacek
Eko
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2016-01-04 04:45 EST by Eko
Modified: 2016-11-30 19:35 EST (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-01-07 02:24:44 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Eko 2016-01-04 04:45:16 EST
Description of problem:
if I enabled two hypervisors mode in /etc/sysconfig/virt-who, such as:
VIRTWHO_LIBVIRT=1
VIRTWHO_ESX=1

virt-who only run for esx mode, the libvirt mode will be skipped.


Version-Release number of selected component (if applicable):
virt-who-0.16-1.el6.noarch

How reproducible:
always

Steps to Reproduce:
1. enable two hypervisors modes in /etc/sysconfig/virt-who, such as:
VIRTWHO_LIBVIRT=1
VIRTWHO_LIBVIRT_OWNER=ACME_Corporation
VIRTWHO_LIBVIRT_ENV=Library
VIRTWHO_LIBVIRT_SERVER=10.66.144.8
VIRTWHO_LIBVIRT_USERNAME=root
VIRTWHO_LIBVIRT_PASSWORD=redhat


VIRTWHO_ESX=1
VIRTWHO_ESX_OWNER=ACME_Corporation
VIRTWHO_ESX_ENV=Library
VIRTWHO_ESX_SERVER=10.73.2.15
VIRTWHO_ESX_USERNAME=administrator@vsphere.local
VIRTWHO_ESX_PASSWORD=Welcome1!

2. restart virt-who service 
# /etc/init.d/virt-who restart

3. check rhsm.log
========= only ESX host/guests mapping info found========

2016-01-04 17:43:02,759 [virtwho.init INFO] MainProcess(29635):MainThread @virtwho.py:parseOptions:720 - Using reporter_id='hp-z220-09.qe.lab.eng.nay.redhat.com'
2016-01-04 17:43:02,761 [virtwho.init INFO] MainProcess(29635):MainThread @virtwho.py:main:811 - Using configuration "env/cmdline" ("esx" mode)
2016-01-04 17:43:02,776 [virtwho.main DEBUG] MainProcess(29638):MainThread @virtwho.py:run:287 - Starting infinite loop with 60 seconds interval
2016-01-04 17:43:02,879 [virtwho.env_cmdline DEBUG] Esx-1(29646):MainThread @virt.py:run:338 - Virt backend 'env/cmdline' started
2016-01-04 17:43:02,881 [virtwho.env_cmdline DEBUG] Esx-1(29646):MainThread @esx.py:_prepare:55 - Log into ESX
2016-01-04 17:43:03,245 [virtwho.env_cmdline DEBUG] Esx-1(29646):MainThread @esx.py:_prepare:58 - Creating ESX event filter
2016-01-04 17:43:03,442 [virtwho.env_cmdline DEBUG] Esx-1(29646):MainThread @virt.py:enqueue:331 - Report gathered, putting to queue for sending
2016-01-04 17:43:03,442 [virtwho.env_cmdline DEBUG] Esx-1(29646):MainThread @esx.py:_run:150 - Waiting for ESX changes
2016-01-04 17:43:03,448 [virtwho.main DEBUG] MainProcess(29638):MainThread @virtwho.py:update_report_to_send:274 - Report for config "env/cmdline" updated
2016-01-04 17:43:03,452 [virtwho.main DEBUG] MainProcess(29638):MainThread @subscriptionmanager.py:_connect:112 - Authenticating with certificate: /etc/pki/consumer/cert.pem
2016-01-04 17:43:03,666 [virtwho.main DEBUG] MainProcess(29638):MainThread @subscriptionmanager.py:hypervisorCheckIn:149 - Checking if server has capability 'hypervisor_async'
2016-01-04 17:43:04,157 [virtwho.main DEBUG] MainProcess(29638):MainThread @subscriptionmanager.py:hypervisorCheckIn:161 - Server does not have 'hypervisors_async' capability
2016-01-04 17:43:04,157 [virtwho.main INFO] MainProcess(29638):MainThread @subscriptionmanager.py:hypervisorCheckIn:170 - Sending update in hosts-to-guests mapping: 2 hypervisors and 3 guests found
2016-01-04 17:43:04,158 [virtwho.main DEBUG] MainProcess(29638):MainThread @subscriptionmanager.py:hypervisorCheckIn:171 - Host-to-guest mapping: {
    "4c4c4544-0048-5a10-8043-b5c04f393358": [
        {
            "guestId": "42293e7d-ba7e-1cea-d897-d8a373b26925", 
            "state": 5, 
            "attributes": {
                "active": 0, 
                "hypervisorVersion": "6.0.0", 
                "virtWhoType": "esx", 
                "hypervisorType": "VMware ESXi"
            }
        }
    ], 
    "86b2bd00-8bad-11e2-87f4-6c3be514699d": [
        {
            "guestId": "42098426-0d49-7dc6-0cb7-2331f149b8aa", 
            "state": 3, 
            "attributes": {
                "active": 1, 
                "hypervisorVersion": "6.0.0", 
                "virtWhoType": "esx", 
                "hypervisorType": "VMware ESXi"
            }
        }, 
        {
            "guestId": "4239b745-4369-40fd-569c-ba0d396654e9", 
            "state": 5, 
            "attributes": {
                "active": 0, 
                "hypervisorVersion": "6.0.0", 
                "virtWhoType": "esx", 
                "hypervisorType": "VMware ESXi"
            }
        }
    ]
}
2016-01-04 17:43:04,480 [virtwho.main DEBUG] MainProcess(29638):MainThread @virtwho.py:send_current_report:206 - Report for config "env/cmdline" sent


Actual results:
only ESX host/guests mapping info found, no libvirt host/guest info found.


Expected results:
the two hypervisors host/guests mapping info should be found

Additional info:
Comment 2 Radek Novacek 2016-01-05 04:33:16 EST
This is expected and documented behaviour. The /etc/sysconfig/virt-who file states:

# Virt-who subscription manager backend. Enable only one option from the following:

Config files in /etc/virt-who.d/ must be used for second and next hypervisor configurations.

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