Bug 1095597 - Virt-who should report guest attributes in order to support virt-guest-limit feature
Summary: Virt-who should report guest attributes in order to support virt-guest-limit ...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: virt-who
Version: 5.11
Hardware: Unspecified
OS: Unspecified
high
unspecified
Target Milestone: rc
: ---
Assignee: Radek Novacek
QA Contact: gaoshang
URL:
Whiteboard:
Depends On:
Blocks: rhsm-rhel511 1098019 1098420
TreeView+ depends on / blocked
 
Reported: 2014-05-08 06:17 UTC by Rehana
Modified: 2016-12-01 00:32 UTC (History)
4 users (show)

Fixed In Version: virt-who-0.9-4.el5
Doc Type: Enhancement
Doc Text:
no docs needed
Clone Of:
: 1098019 (view as bug list)
Environment:
Last Closed: 2014-09-16 00:29:37 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2014:1206 0 normal SHIPPED_LIVE virt-who bug fix and enhancement update 2014-09-16 04:16:42 UTC

Description Rehana 2014-05-08 06:17:38 UTC
Description of problem:

Observed that with the virt-who-0.9-1.el5 version, guest attributes are not getting reported on rhel5.11 server, due to this the host(having subscription with guest-limit 4) is not reporting the compliance status to yellow when more no.of guest are running on the host 

Version-Release number of selected component (if applicable):
rpm -qa | grep virt-who
virt-who-0.9-1.el5

[root@jsefler-7server ~]# rpm -q virt-who --changelog | grep guest -B1
* Fri Jan 10 2014 Radek Novacek <rnovacek> 0.8-12


How reproducible:
3/3

Steps to Reproduce:
1.Register and attach guest-limit subscription to host
2.Create guest machines on the host and restart virt-who service
3.Verify the guest attributes using the guest id

[root@ibm-x3250m4-05  curl -u stage_test_43:***** --insecure --request GET https://subscription.rhn.stage.redhat.com:443/subscription/consumers/9e229787-69ea-4cc4-9b5d-0f626f83e69b/guestids | python -m simplejson/tool

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   174    0   174    0     0    141      0 --:--:--  0:00:01 --:--:--  169k
[
    {
        "created": "2014-05-06T12:57:54.000+0000",
        "guestId": "de1ff247-82dd-a3d5-fbd2-4733a5dab296",
        "id": "8a99f98445cce56f0145d19ca3b7251f",
        "updated": "2014-05-06T12:57:54.000+0000"
    }
]
[root@ibm-x3250m4-05 ~]#  curl -u stage_test_43:***** --insecure --request GET https://subscription.rhn.stage.redhat.com:443/subscription/consumers/9e229787-69ea-4cc4-9b5d-0f626f83e69b/guestids/de1ff247-82dd-a3d5-fbd2-4733a5dab296 | python -m simplejson/tool

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   188    0   188    0     0     26      0 --:--:--  0:00:06 --:--:--    41
{
    "attributes": {},  ---> attribute sets are empty
    "created": "2014-05-06T12:57:54.000+0000",
    "guestId": "de1ff247-82dd-a3d5-fbd2-4733a5dab296",
    "id": "8a99f98445cce56f0145d19ca3b7251f",
    "updated": "2014-05-06T12:57:54.000+0000"
}

Actual results:
Observed that the guest ids are not reporting the guest attributes

Expected results:
guest attributes should be present
ex:with virt-who-0.8-12.el7.noarch, guest attributes are getting reported on rhel7

[root@hp-dl360egen8-01 ~]# curl -u stage_2013_model_test:*****  --insecure --request GET https://subscription.rhn.stage.redhat.com:443/subscription/consumers/075618cc-5e06-4187-95f8-050307c31226/guestids/2db50cf9-64c1-4a18-8e6b-b4db25ff2267 | python -m json.tool
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   248    0   248    0     0     38      0 --:--:--  0:00:06 --:--:--    63
{
    "attributes": {
        "active": "1",
        "hypervisorType": "QEMU",    --->> guest attributes
        "virtWhoType": "libvirt"
    },
    "created": "2014-05-07T13:55:46.000+0000",
    "guestId": "2db50cf9-64c1-4a18-8e6b-b4db25ff2267",
    "id": "8a99f98645d319ec0145d6f7fa242d1e",
    "updated": "2014-05-07T13:55:46.000+0000"
}

Additional info:
The same feature should be included on rhel66 as well

Comment 1 Radek Novacek 2014-05-09 06:18:26 UTC
Could you please put virt-who to debug mode (set VIRTWHO_DEBUG=1 in /etc/sysconfig/virt-who), reproduce the bug and then attach the log (/var/log/rhsm/rhsm.log) here? Thank you.

Comment 2 Rehana 2014-05-09 06:40:19 UTC
Due to the bug #1095860 against stage server, i couldn't retest against stage; so i have used to my local candlepin set up to retest, hope this helps.

[root@ibm-x3250m4-05 ~]# cat /etc/sysconfig/virt-who  | grep VIRTWHO_DEBUG
VIRTWHO_DEBUG=1

[root@ibm-x3250m4-05 ~]# service virt-who restart
Stopping virt-who: [  OK  ]
Starting virt-who: [  OK  ]


[root@ibm-x3250m4-05 ~]# curl -u username:passwd --insecure --request GET https://ip:8443/candlepin/consumers/13293036-23f9-4e2f-ba3a-72095f93d23e/guestids | python -m simplejson/tool
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   347    0   347    0     0    248      0 --:--:--  0:00:01 --:--:--     0
[
    {
        "created": "2014-05-09T06:43:51.401+0000", 
        "guestId": "de1ff247-82dd-a3d5-fbd2-4733a5dab296", 
        "id": "8ac6a36245b14d950145dfb941e95807", 
        "updated": "2014-05-09T06:43:51.401+0000"
    }, 
    {
        "created": "2014-05-09T06:43:51.396+0000", 
        "guestId": "b3ace9e5-f699-2ef8-34eb-9ca5c7e1d19b", 
        "id": "8ac6a36245b14d950145dfb941e45805", 
        "updated": "2014-05-09T06:43:51.396+0000"
    }
]
[root@ibm-x3250m4-05 ~]# curl -u username:passwd --insecure --request GET https://ip:8443/candlepin/consumers/13293036-23f9-4e2f-ba3a-72095f93d23e/guestids/de1ff247-82dd-a3d5-fbd2-4733a5dab296 | python -m simplejson/tool
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   188    0   188    0     0    135      0 --:--:--  0:00:01 --:--:--     0
{
    "attributes": {}, 
    "created": "2014-05-09T06:43:51.401+0000", 
    "guestId": "de1ff247-82dd-a3d5-fbd2-4733a5dab296", 
    "id": "8ac6a36245b14d950145dfb941e95807", 
    "updated": "2014-05-09T06:43:51.401+0000"
}



rhsm.log

 tail -f /var/log/rhsm/rhsm.log
2014-05-09 02:34:33,345 [DEBUG] subscription-manager @connection.py:450 - Making request: GET /candlepin/consumers/13293036-23f9-4e2f-ba3a-72095f93d23e
2014-05-09 02:34:35,088 [DEBUG] subscription-manager @connection.py:473 - Response: status=200, requestUuid=87de3f3b-b4e4-4ee4-827b-10fae0416073
2014-05-09 02:34:35,088 [WARNING] subscription-manager @connection.py:477 - Clock skew detected, please check your system time
2014-05-09 02:34:35,091 [DEBUG] subscription-manager @cache.py:290 - Started thread to write cache: /var/lib/rhsm/cache/product_status.json
2014-05-09 02:34:35,092 [INFO] subscription-manager @managercli.py:194 - Attempted to auto-attach/heal the system.
2014-05-09 02:34:35,096 [DEBUG] subscription-manager @dbus_interface.py:74 - installed python-dbus doesn't support 'get_default_main_loop'
2014-05-09 02:34:35,099 [DEBUG] subscription-manager @dbus_interface.py:67 - installed python-dbus doesn't support 'follow_name_owner_changes'
2014-05-09 02:34:35,350 [INFO] rhsmd @rhsmd:193 - rhsmd started
2014-05-09 02:34:35,355 [INFO] rhsmd @rhsmd:148 - D-Bus interface com.redhat.SubscriptionManager.EntitlementStatus.update_status called with status = 1
2014-05-09 02:34:35,460 [INFO] rhsmd @rhsmd:116 - D-Bus signal com.redhat.SubscriptionManager.EntitlementStatus.entitlement_status_changed emitted
2014-05-09 02:36:20,333 [DEBUG]  @virt-who.py:512 - Starting event loop
2014-05-09 02:36:21,842 [DEBUG]  @virt-who.py:528 - Virt-who is running in libvirt mode
2014-05-09 02:36:21,842 [DEBUG]  @virt-who.py:535 - Starting infinite loop with 3600 seconds interval and event handling
2014-05-09 02:36:21,843 [DEBUG]  @virt.py:56 - Virtual machine found: rhel64: b3ace9e5-f699-2ef8-34eb-9ca5c7e1d19b
2014-05-09 02:36:21,844 [DEBUG]  @virt.py:56 - Virtual machine found: rhel5111: de1ff247-82dd-a3d5-fbd2-4733a5dab296
2014-05-09 02:36:21,845 [DEBUG]  @subscriptionmanager.py:81 - Sending list of uuids: ['b3ace9e5-f699-2ef8-34eb-9ca5c7e1d19b', 'de1ff247-82dd-a3d5-fbd2-4733a5dab296']

Comment 3 Radek Novacek 2014-05-09 07:09:38 UTC
Thank you.

There was one patch missing in the upstream master branch of virt-who that is in the RHEL-7 branch. Fixed by upstream commit:

https://git.fedorahosted.org/cgit/virt-who.git/commit/?id=ee127e3a7c4281776f84c2a09229b73be54cd054

Comment 4 Radek Novacek 2014-05-19 10:19:30 UTC
Setting priority to high as it affects planned Guest Counting feature of SAM 1.4.

Comment 5 Radek Novacek 2014-05-22 09:26:17 UTC
Fixed in virt-who-0.9-4.el5.

Comment 7 Rehana 2014-05-29 11:15:50 UTC
Retested on 

rpm -qa | grep virt-who
virt-who-0.9-4.el5

subscription-manager version
server type: Red Hat Subscription Management
subscription management server: 0.9.10.2-1
subscription-manager: 1.11.3-4.el5
python-rhsm: 1.11.3-3.el5

Observed that now with latest virt-who-0.9-4, the host machine is reporting the Guest attributes

# curl -u stage_test_43:*** --insecure --request GET https://subscription.rhn.stage.redhat.com:443/subscription/consumers/9a8fa52e-3d5e-493f-af46-1e886c11a04d/guestids | python -m simplejson/tool
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   174    0   174    0     0    132      0 --:--:--  0:00:01 --:--:--  169k
[
    {
        "created": "2014-05-29T10:59:20.000+0000", 
        "guestId": "d8b2fa3c-5e13-c788-7f28-3ca7532b6b1e", 
        "id": "8a99f987462a2cb1014647a258f9795f", 
        "updated": "2014-05-29T10:59:20.000+0000"
    }
]
#  curl -u stage_test_43:*** --insecure --request GET https://subscription.rhn.stage.redhat.com:443/subscription/consumers/9a8fa52e-3d5e-493f-af46-1e886c11a04d/guestids/d8b2fa3c-5e13-c788-7f28-3ca7532b6b1e  | python -m simplejson/tool
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   248    0   248    0     0    200      0 --:--:--  0:00:01 --:--:--  242k
{
    "attributes": {
        "active": "1", ----------------> for a running guest machine
        "hypervisorType": "QEMU", 
        "virtWhoType": "libvirt"
    }, 
    "created": "2014-05-29T10:59:20.000+0000", 
    "guestId": "d8b2fa3c-5e13-c788-7f28-3ca7532b6b1e", 
    "id": "8a99f987462a2cb1014647a258f9795f", 
    "updated": "2014-05-29T10:59:20.000+0000"
}

#  curl -u stage_test_43:*** --insecure --request GET https://subscription.rhn.stage.redhat.com:443/subscription/consumers/9a8fa52e-3d5e-493f-af46-1e886c11a04d/guestids/d8b2fa3c-5e13-c788-7f28-3ca7532b6b1e  | python -m simplejson/tool
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   248    0   248    0     0    290      0 --:--:-- --:--:-- --:--:--  242k
{
    "attributes": {
        "active": "0", ------> Stopped guest machine
        "hypervisorType": "QEMU", 
        "virtWhoType": "libvirt"
    }, 
    "created": "2014-05-29T11:13:29.000+0000", 
    "guestId": "d8b2fa3c-5e13-c788-7f28-3ca7532b6b1e", 
    "id": "8a99f98a464435c5014647af4de75555", 
    "updated": "2014-05-29T11:13:29.000+0000"



Moving this bug to "Verified"

Comment 9 errata-xmlrpc 2014-09-16 00:29:37 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-2014-1206.html


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