Bug 770329

Summary: virt-who will report two same events when one guest was added on Xen(PV & HVM)
Product: Red Hat Enterprise Linux 5 Reporter: Hui Wang <huiwang>
Component: virt-whoAssignee: Radek Novacek <rnovacek>
Status: CLOSED NOTABUG QA Contact: Entitlement Bugs <entitlement-bugs>
Severity: low Docs Contact:
Priority: unspecified    
Version: 5.8CC: khong, ndai, ovasik
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-01-02 14:08:29 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Hui Wang 2011-12-26 03:15:45 UTC
description:
Add one guest, the virt-who will report two same events on Xen(PV & HVM).

Version-Release number of selected component (if applicable):
virt-who-0.5-2.el5
subscription-manager-0.98.8-1.el5
subscription-manager-firstboot-0.98.8-1.el5
subscription-manager-gnome-0.98.8-1.el5   
python-rhsm-0.98.7-1.el5
libvirt-0.8.2-24.el5
libvirt-0.8.2-24.el5
libvirt-python-0.8.2-24.el5

How reproducible:
always

Steps to Reproduce:
1.Install RHEL 5.8-snapshot-2.0(Xen) and register to candlepin.
2.Configure virt-who.
# vi /etc/sysconfig/virt-who
VIRTWHO_BACKGROUND=1 (enable debugging)
VIRTWHO_DEBUG=1 (run in background)     
3.Restart the virt-who service in terminal1. 
[root@localhost ~]# service virt-who restart
Stopping virt-who:                                         [  OK  ]
Starting virt-who: Virt-who is running in libvirt mode
Starting infinite loop with 3600 seconds interval and event handling
                                                           [  OK  ]
[root@localhost ~]# Unable to obtain status from server, UEPConnection is likely not usable:
Traceback (most recent call last):
  File "/usr/share/virt-who/subscriptionmanager.py", line 60, in connect
    if not self.connection.ping()['result']:
  File "/usr/lib/python2.4/site-packages/rhsm/connection.py", line 411, in ping
    return self.conn.request_get("/status/")
  File "/usr/lib/python2.4/site-packages/rhsm/connection.py", line 267, in request_get
    return self._request("GET", method)
  File "/usr/lib/python2.4/site-packages/rhsm/connection.py", line 234, in _request
    self.validateResponse(result)
  File "/usr/lib/python2.4/site-packages/rhsm/connection.py", line 249, in validateResponse
    raise RemoteServerException(response['status'])
RemoteServerException: <unprintable instance object>
Virtual machine found: rhel5.8snaphsot2.0-server-32: ea898b80-5200-6ba1-6bb6-5dcd3ab07369
Virtual machine found: rhel4: 39b783f1-d199-0725-c4b1-50b14ca6dea3
Sending update to updateConsumer: ['39b783f1-d199-0725-c4b1-50b14ca6dea3', 'ea898b80-5200-6ba1-6bb6-5dcd3ab07369']

4.Add new a guest(PV or HVM)) on the host 
5.Check the output info of terminal1
# service virt-who restart
Stopping virt-who:                                         [  OK  ]
Starting virt-who: Virt-who is running in libvirt mode
Starting infinite loop with 3600 seconds interval and event handling
                                                           [  OK  ]
[root@localhost ~]# Unable to obtain status from server, UEPConnection is likely not usable:
Traceback (most recent call last):
  File "/usr/share/virt-who/subscriptionmanager.py", line 60, in connect
    if not self.connection.ping()['result']:
  File "/usr/lib/python2.4/site-packages/rhsm/connection.py", line 411, in ping
    return self.conn.request_get("/status/")
  File "/usr/lib/python2.4/site-packages/rhsm/connection.py", line 267, in request_get
    return self._request("GET", method)
  File "/usr/lib/python2.4/site-packages/rhsm/connection.py", line 234, in _request
    self.validateResponse(result)
  File "/usr/lib/python2.4/site-packages/rhsm/connection.py", line 249, in validateResponse
    raise RemoteServerException(response['status'])
RemoteServerException: <unprintable instance object>
Virtual machine found: rhel5.8snaphsot2.0-server-32: ea898b80-5200-6ba1-6bb6-5dcd3ab07369
Virtual machine found: rhel4: 39b783f1-d199-0725-c4b1-50b14ca6dea3
Sending update to updateConsumer: ['39b783f1-d199-0725-c4b1-50b14ca6dea3', 'ea898b80-5200-6ba1-6bb6-5dcd3ab07369']
EVENT: Domain rheladd(2) Started Booted
Virtual machine found: rhel5.8snaphsot2.0-server-32: ea898b80-5200-6ba1-6bb6-5dcd3ab07369
Virtual machine found: rheladd: 83b09dfc-b118-9e13-469c-fd6d7eb530a7
Virtual machine found: rhel4: 39b783f1-d199-0725-c4b1-50b14ca6dea3
Sending update to updateConsumer: ['39b783f1-d199-0725-c4b1-50b14ca6dea3', '83b09dfc-b118-9e13-469c-fd6d7eb530a7', 'ea898b80-5200-6ba1-6bb6-5dcd3ab07369']
EVENT: Domain rheladd(-1) Defined Added ^^^^^^^^^^^^^^^^^^^^^^The first event
Virtual machine found: rhel5.8snaphsot2.0-server-32: ea898b80-5200-6ba1-6bb6-5dcd3ab07369
Virtual machine found: rheladd: 83b09dfc-b118-9e13-469c-fd6d7eb530a7
Virtual machine found: rhel4: 39b783f1-d199-0725-c4b1-50b14ca6dea3
Sending update to updateConsumer: ['39b783f1-d199-0725-c4b1-50b14ca6dea3', '83b09dfc-b118-9e13-469c-fd6d7eb530a7', 'ea898b80-5200-6ba1-6bb6-5dcd3ab07369']
EVENT: Domain rheladd(-1) Defined Added ^^^^^^^^^^^^^^^^^^^^^^^^The second event
Virtual machine found: rhel5.8snaphsot2.0-server-32: ea898b80-5200-6ba1-6bb6-5dcd3ab07369
Virtual machine found: rheladd: 83b09dfc-b118-9e13-469c-fd6d7eb530a7
Virtual machine found: rhel4: 39b783f1-d199-0725-c4b1-50b14ca6dea3
Sending update to updateConsumer: ['39b783f1-d199-0725-c4b1-50b14ca6dea3', '83b09dfc-b118-9e13-469c-fd6d7eb530a7', 'ea898b80-5200-6ba1-6bb6-5dcd3ab07369']

Actual results:
Add one guest, the virt-who will report two same events

Expected results:
when the guest was added,virt-who will report one adding event

Additional info:

Comment 1 Radek Novacek 2012-01-02 14:08:29 UTC
This is bug in libvirt (or xen backend). Virt-who can't easily tell if the event appears twice. I can make some workaround but it would be ugly hack. I don't think it worth the effort. I'm closing this bug as NOTABUG. You can report this issue to libvirt or reopen if you really think I should do the workaround.