Bug 766895

Summary: Addition of hypervisorCheckIn call
Product: Red Hat Enterprise Linux 5 Reporter: William Poteat <wpoteat>
Component: subscription-managerAssignee: William Poteat <wpoteat>
Status: CLOSED ERRATA QA Contact: Entitlement Bugs <entitlement-bugs>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 5.8CC: huiwang, jmolet, jsefler, khong
Target Milestone: rc   
Target Release: 5.8   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Addition of hypervisorCheckIn call to allow sending a mapping of host/guest ids for creation/update.
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-02-21 06:43:56 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On:    
Bug Blocks: 769266    

Description William Poteat 2011-12-12 19:01:09 UTC
Incorporation of feature:

Addition of hypervisorCheckIn call to allow sending a mapping of host/guest ids for creation/update.

Comment 3 John Sefler 2012-01-17 23:12:29 UTC
Demonstrating... When virt-who is run, it can successfully send an update to the candlepin server so that the consumer on the host becomes aware of the guests being run on the host.  This feature allows candlepin.standalone=true to be aware of guests being run on a host and therefore provide a realistic "RHEL subscription with up-to N virtual guests" model.



Verifying Version...
[root@margo ~]# rpm -q subscription-manager
subscription-manager-0.98.11-1.el5
[root@margo ~]# rpm -q virt-who
virt-who-0.5-3.el5
[root@margo ~]# curl -k --user admin:admin https://mgmt5.rhq.lab.eng.bos.redhat.com:8443/candlepin/status
{"version":"0.5.10","result":true,"standalone":true,"release":"1"}



On a RHEL58 Server host running xen virtualization...
[root@margo ~]# cat /etc/redhat-release 
Red Hat Enterprise Linux Server release 5.8 Beta (Tikanga)
[root@margo ~]# xen-detect
Running in PV context on Xen v3.1.
[root@margo ~]# virsh list
 Id Name                 State
----------------------------------
  0 Domain-0             running
  2 stacking-guest       idle
[root@margo ~]# virt-what
xen
xen-dom0
[root@margo ~]# subscription-manager facts --list | grep is_guest
virt.is_guest: False

[root@margo ~]# subscription-manager register --username testuser1 --password password --org admin
The system has been registered with id: 362f9bc7-58d6-4c3c-9bdf-e29734037b6f 

^^^ THE HOST IS NOW REGISTERED AND WE HAVE A CONSUMER ID FOR THE HOST



Demonstrating virt-who's ability to upload the virt.uuids of the guests running on the host to candlepin...
[root@margo ~]# virt-who -d
Virt-who is running in libvirt mode
Virtual machine found: stacking-guest: fd0c533a-a5c9-c83e-9265-22a9215327e2
Sending update to updateConsumer: ['fd0c533a-a5c9-c83e-9265-22a9215327e2']




On a RHEL58 Server guest of the host...
[root@localhost ~]# virt-what
xen
xen-domU
[root@localhost ~]# subscription-manager facts --list | grep is_guest
virt.is_guest: True
[root@localhost ~]# 
[root@localhost ~]# subscription-manager register --username testuser1 --password password --org admin
The system has been registered with id: 6e1e5830-8237-4a06-a02b-39681dec96c9 
[root@localhost ~]# 
[root@localhost ~]# subscription-manager facts --list | grep uuid
system.uuid: 6e1e5830-8237-4a06-a02b-39681dec96c9
virt.uuid: fd0c533a-a5c9-c83e-9265-22a9215327e2

^^^ THE GUEST IS NOW REGISTERED AND WE HAVE A CONSUMER ID AND ITS virt.uuid MATCHES WHAT virt-who SENT TO CANDLEPIN



NOW LET'S CALL THE /guests API ON THE HOST CONSUMER AND WE SHOULD FIND THE GUEST...
[root@margo ~]# curl -k --user admin:admin https://mgmt5.rhq.lab.eng.bos.redhat.com:8443/candlepin/consumers/362f9bc7-58d6-4c3c-9bdf-e29734037b6f/guests | python -m simplejson/tool | grep uuid
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  5618    0  5618    0     0  39625      0 --:--:-- --:--:-- --:--:--     0
            "virt.uuid": "fd0c533a-a5c9-c83e-9265-22a9215327e2"
        "uuid": "6e1e5830-8237-4a06-a02b-39681dec96c9"
[root@margo ~]# 

^^^^ THANKS TO virt-who's COMMUNICATION TO CANDLEPIN, WE HAVE VERIFIED THAT THE HOST CONSUMER IS AWARE OF THE REGISTERED GUEST SYSTEM'S uuid THROUGH ITS virt.uuid.



Moving to VERIFIED

Comment 4 William Poteat 2012-01-23 16:29:27 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
Addition of hypervisorCheckIn call to allow sending a mapping of host/guest ids for creation/update.

Comment 5 errata-xmlrpc 2012-02-21 06:43:56 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.

http://rhn.redhat.com/errata/RHBA-2012-0154.html