Bug 1367287

Summary: hypervisor_id=hostname/hwuuid can't work when vir-who work at xen mode
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: hsun, ovasik, sgao, shihliu
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: virt-who-0.17-10.el7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-11-04 05:10:33 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-08-16 06:42:01 UTC
Description of problem:
When virt-who work at xen mode, configure hypervisor_id=hostname/hwuuid can't work, virt-who can't send hostname and hwuuid to satellite.

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

How reproducible:
Always

Steps to Reproduce:
1. Register system to satellite5.7.
2. Configure virt-who run at xen mode and report host's name or hwuuid.
[root@hp-z220-03 virt-who.d]# cat /etc/virt-who.d/xen 
[test-xen]
type=xen
server=10.73.131.178
username=root
encrypted_password=cf0fc8adf1684c50644300e7cbd6a113
#password=Welcome1
owner=ACME_Corporation
env=Library
sat_server=10.73.3.209
sat_username=admin
sat_password=redhat
hypervisor_id=hwuuid   or hypervisor_id=hostname
3. Restart virt-who and check virt-who's log
[root@hp-z220-03 virt-who.d]#systemctl restart virt-who
[root@hp-z220-03 virt-who.d]#tail -f /var/log/rhsm/rhsm.log
2016-08-16 02:20:42,311 [virtwho.main INFO] MainProcess(17941):MainThread @satellite.py:hypervisorCheckIn:208 - Sending update in hosts-to-guests mapping: 1 hypervisors and 0 guests found
2016-08-16 02:20:42,311 [virtwho.main DEBUG] MainProcess(17941):MainThread @satellite.py:hypervisorCheckIn:210 - Host-to-guest mapping: {
    "hypervisors": [
        {
            "hypervisorId": {
                "hypervisorId": "4cc99f10-42ea-40f3-bbc5-ca1a7f8aa903"
            }, 
            "name": "xenserver-dagelflw", 
            "guestIds": [], 
            "facts": {
                "hypervisor.type": "XenServer", 
                "cpu.cpu_socket(s)": "2", 
                "hypervisor.version": "7.0.0"
            }
        }
    ]
}
2016-08-16 02:20:42,311 [virtwho.main DEBUG] MainProcess(17941):MainThread @satellite.py:hypervisorCheckIn:215 - Loading systemid for 4cc99f10-42ea-40f3-bbc5-ca1a7f8aa903

Actual results:
Virt-who still send hostuuid(""hypervisorId": "4cc99f10-42ea-40f3-bbc5-ca1a7f8aa903"") to server.

Expected results:
Virt-who should send hostname/hwuuid to server according to config.

Additional info:

Comment 1 Radek Novacek 2016-08-16 12:53:19 UTC
Implemented upstream:

https://github.com/virt-who/virt-who/commit/1cd16c1bba98fc874fec054c5f80e470926c5c7e

Comment 2 Radek Novacek 2016-08-16 16:49:15 UTC
Fixed in virt-who-0.17-10.el7.

Comment 4 Liushihui 2016-08-31 03:26:32 UTC
Verified it on virt-who-0.17-10.el7 since Virt-who can send hostname/hwuuid to server according to config. Therefore, verify it.

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