Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1246951

Summary: virt-who should support for hypervisor_id to the remote libvirt mode
Product: Red Hat Enterprise Linux 7 Reporter: Liushihui <shihliu>
Component: virt-whoAssignee: Radek Novacek <rnovacek>
Status: CLOSED ERRATA QA Contact: xingge <gxing>
Severity: high Docs Contact:
Priority: unspecified    
Version: 7.2CC: gxing, hsun, ldai, ovasik, rbalakri, rnovacek, sgao, shihliu
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: virt-who-0.14-3.el7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 1227986 Environment:
Last Closed: 2015-11-19 11:57:22 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:
Bug Depends On: 1227986    
Bug Blocks:    

Comment 1 Radek Novacek 2015-07-28 11:24:03 UTC
I don't think this issue is valid. virt-who behaves differently for remote libvirt connection, it behaves like with ESX and reports remote host with its guests using hypervisorCheckIn API call.

For local libvirt connection, the subscription-manager sends the hostname. For remote libvirt connection, virt-who gets the hostname from libvirt. This might cause different behaviour.

I don't see this as a bug, one host should be monitored using both local and remote libvirt mode. Do you agree?

Comment 2 Liushihui 2015-07-29 09:36:35 UTC
Radek,I agree with you.However,remote libvirt mode hasn't support reporting hostname. Therefore, I use this bug to track "support for hypervisor_id to the remote libvirt mode", is that acceptable? Thanks.


(In reply to Radek Novacek from comment #1)
> I don't think this issue is valid. virt-who behaves differently for remote
> libvirt connection, it behaves like with ESX and reports remote host with
> its guests using hypervisorCheckIn API call.
> 
> For local libvirt connection, the subscription-manager sends the hostname.
> For remote libvirt connection, virt-who gets the hostname from libvirt. This
> might cause different behaviour.
> 
> I don't see this as a bug, one host should be monitored using both local and
> remote libvirt mode. Do you agree?

Comment 3 Radek Novacek 2015-07-30 07:57:38 UTC
Yes, I'll add support for hypervisor_id to the remote libvirt backend.

Comment 4 Radek Novacek 2015-07-30 13:15:22 UTC
Fixed in virt-who-0.14-3.el7.

Comment 6 Liushihui 2015-08-11 08:03:09 UTC
Verified it on virt-who-0.14-3.el7.noarch since virt-who can report hostname after configure "hypervisor_id=hostname" when it run at remote libvirtd mode

Verified version
virt-who-0.14-3.el7.noarch
subscription-manager-1.15.9-2.el7.x86_64
python-rhsm-1.15.4-2.el7.x86_64
Satellite 6.1.0-20150731.0

Verified process:
1. Register system to Satellite server
[root@hp-z220-08 ~]# subscription-manager register --username=admin --password=admin
2. Configure virt-who run at remote libvirt mode, and configure send hostname instead of hostuuid
[root@hp-z220-08 ~]# cat /etc/virt-who.d/virt 
[test-libvirt]
type=libvirt
server=qemu+ssh://10.66.144.5/system
username=root
password=qwer1234P!
owner=ACME_Corporation
env=Library 
hypervisor_id=hostname
3. Restart virt-who service and check host/guest mapping info
[root@hp-z220-08 ~]# systemctl restart virt-who
[root@hp-z220-08 ~]# tail -f /var/log/rhsm/rhsm.log
2015-08-11 15:42:52,749 [DEBUG]  @virtwho.py:126 - Using config named 'test-libvirt'
2015-08-11 15:42:52,750 [INFO]  @virtwho.py:662 - Using configuration "test-libvirt" ("libvirt" mode)
2015-08-11 15:42:52,750 [DEBUG]  @virtwho.py:209 - Starting infinite loop with 3600 seconds interval
2015-08-11 15:42:52,785 [INFO]  @libvirtd.py:137 - Using libvirt url: qemu+ssh://root.144.5/system?no_tty=1
2015-08-11 15:42:52,972 [DEBUG]  @libvirtd.py:216 - Virtual machine found: 6.5_Server_x86_64: 8a0bc45e-5bfb-4ddd-bdcb-ed23c927f0a8
2015-08-11 15:42:52,973 [DEBUG]  @libvirtd.py:220 - Libvirt domains found: ['8a0bc45e-5bfb-4ddd-bdcb-ed23c927f0a8']
2015-08-11 15:42:52,981 [DEBUG]  @subscriptionmanager.py:112 - Authenticating with certificate: /etc/pki/consumer/cert.pem
2015-08-11 15:42:59,904 [DEBUG]  @subscriptionmanager.py:146 - Checking if server has capability 'hypervisor_async'
2015-08-11 15:43:02,909 [DEBUG]  @subscriptionmanager.py:158 - Server does not have 'hypervisors_async' capability
2015-08-11 15:43:02,910 [INFO]  @subscriptionmanager.py:165 - Sending update in hosts-to-guests mapping: {
    "hp-z220-07.qe.lab.eng.nay.redhat.com": [
        {
            "guestId": "8a0bc45e-5bfb-4ddd-bdcb-ed23c927f0a8", 
            "state": 5, 
            "attributes": {
                "active": 0, 
                "virtWhoType": "libvirt", 
                "hypervisorType": "QEMU"
            }
        }
    ]
}
4. Open satellite web UI, check content host

Result:
virt-who send hostname instead of hostuuid to satellite, hostname can shown on the satellite web UI. Therefore, verify it

Comment 7 errata-xmlrpc 2015-11-19 11:57:22 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-2015-2370.html