Bug 864819 - virt-who CLI cannot work properly in RHEV-H build
Summary: virt-who CLI cannot work properly in RHEV-H build
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: ovirt-node
Version: 5.9
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: rc
: ---
Assignee: Mike Burns
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-10-10 07:58 UTC by lzhuang
Modified: 2013-01-09 04:17 UTC (History)
14 users (show)

Fixed In Version: ovirt-node-1.0-88.el5
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-01-08 17:54:54 UTC
Target Upstream Version:
Embargoed:
lzhuang: needinfo+


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2013:0143 0 normal SHIPPED_LIVE rhev-hypervisor5 bug fix update 2013-01-08 22:53:23 UTC

Description lzhuang 2012-10-10 07:58:47 UTC
Description of problem:
virt-who CLI cannot work properly in RHEV-H, but those commands with the same version of virt-who can work correctly in RHEL build. Seems there's some problem in the integration of RHEV-H.

Version-Release number of selected component (if applicable):
Red Hat Enterprise Virtualization Hypervisor release 5.9 (20121003.1.el5)
virt-who-0.7-8.el5

How reproducible:
100%

Steps to Reproduce:
1. stop virt-who service:
   # service virt-who stop

2. (1) execute virt-who command, "-b" means running virt-who in background, "-d" means printing debug info in log,  "-i" means the interval of acquire and send list of virtual guest in seconds:
   # virt-who -d -b -i 10 --vdsm
   WARNING: Listening for events is not available in VDSM or ESX mode
   ERROR: Unable to recover, retry in 60 seconds.
   ^^^^^

   (2) In the /var/log/rhsm/rhsm.log, there's error info:
 2012-10-10 06:51:18,936 [ERROR]  @virt-who.py:164 - Unable to create connection:
Traceback (most recent call last):
  File "/usr/share/virt-who/virt-who.py", line 161, in _send
  File "/usr/share/virt-who/virt-who.py", line 140, in checkConnections
  File "/usr/share/virt-who/virt-who.py", line 95, in initVirt
  File "/usr/share/virt-who/virt.py", line 42, in __init__
VirtError: unable to connect to '/var/run/libvirt/libvirt-sock-ro', libvirtd may need to be started: No such file or directory
2012-10-10 06:51:18,937 [ERROR]  @virt-who.py:167 - Unable to recover, retry in 60 seconds.

3. check if virt-who is running:
   # ps -ef|grep virt-who
   root     11391 26407  0 06:57 pts/0    00:00:00 grep virt-who
   ^^^^^^^
   There's no such process running.

4. start libvirtd service, then execute virt-who cli again:
   # service libvirtd start
   Starting libvirtd daemon:                                  [  OK  ]
   
   # virt-who -d -b -i 10 --vdsm

   Nothing is printed in the log file /var/log/rhsm/rhsm.log.
   ^^^^^^^^
   But virtual guest info should be printed each 10 seconds in the log file.

  
Actual results:
As listed above.

Expected results:
virt-who CLI can be successfully executed as expected.

Additional info:

Comment 1 RHEL Program Management 2012-10-10 08:27:11 UTC
This request was evaluated by Red Hat Product Management for inclusion
in a Red Hat Enterprise Linux release.  Product Management has
requested further review of this request by Red Hat Engineering, for
potential inclusion in a Red Hat Enterprise Linux release for currently
deployed products.  This request is not yet committed for inclusion in
a release.

Comment 3 Mike Burns 2012-10-10 11:49:35 UTC
NOTE:  vdsm in RHEV-H 5.x does *not* use libvirt.  having both libvirt and vdsm running is not valid or allowed.  

does it work in non-cli mode?

Joey,  can you take a quick look to see if your recent change in rhn reg for SAM could have caused this?  I don't think so, but it's possible.  If not, then please move it to virt-who.

Comment 4 Radek Novacek 2012-10-10 12:13:26 UTC
The virt-who deployment to RHEV-H is somehow broken. 


rpm -qV virt-who:

S.5....T  c /etc/sysconfig/virt-who
S.5....T    /usr/bin/virt-who
missing     /usr/share/virt-who/event.py
missing     /usr/share/virt-who/event.pyo
missing     /usr/share/virt-who/log.py
missing     /usr/share/virt-who/log.pyo
missing     /usr/share/virt-who/subscriptionmanager.py
missing     /usr/share/virt-who/subscriptionmanager.pyo
missing     /usr/share/virt-who/test.py
missing     /usr/share/virt-who/test.pyo
missing     /usr/share/virt-who/vdsm.py
missing     /usr/share/virt-who/vdsm.pyo
missing     /usr/share/virt-who/virt-who.py
missing     /usr/share/virt-who/virt-who.pyo
missing     /usr/share/virt-who/virt.py
missing     /usr/share/virt-who/virt.pyo
missing     /usr/share/virt-who/vsphere.py
missing     /usr/share/virt-who/vsphere.pyo


cat /usr/bin/virt-who:

#!/bin/sh
exec /usr/bin/python /usr/share/virt-who/virt-who.pyc ""

instead of (normal rpm package):

if [ -f ./virt-who.py ];
then
    # Run it from local directory when available
    exec /usr/bin/python ./virt-who.py "$@"
else
    # Run it from /usr/share/virt-who
    exec /usr/bin/python /usr/share/virt-who/virt-who.py "$@"
fi

This means that command line arguments are NOT propagated to virt-who. So it's trying to use (default) libvirt mode instead of vdsm (--vdsm).

Comment 6 lzhuang 2012-10-11 01:44:24 UTC
(In reply to comment #3)
> NOTE:  vdsm in RHEV-H 5.x does *not* use libvirt.  having both libvirt and
> vdsm running is not valid or allowed.  
> 
> does it work in non-cli mode?
It works fine in non-cli mode with service vdsmd running and libvirtd stopped.

Comment 7 Radek Novacek 2012-10-11 06:00:16 UTC
Yes, non-cli mode works because it uses environmental variables that are read by initscript from /etc/sysconfig/virt-who.

Comment 9 lzhuang 2012-10-23 01:50:21 UTC
verified version:
Red Hat Enterprise Virtualization Hypervisor release 5.9 (20121017.2)
virt-who-0.7-9.el5

# virt-who -d -b -i 10 --vdsm

# ps -ef|grep virt-who
root      2674     1  0 01:46 ?        00:00:00 /usr/bin/python /usr/share/virt-who/virt-who.pyc -d -b -i 10 --vdsm

# tail -f /var/log/rhsm/rhsm.log
2012-10-23 01:46:51,635 [WARNING]  @virt-who.py:418 - Listening for events is not available in VDSM or ESX mode
2012-10-23 01:46:51,707 [DEBUG]  @virt-who.py:431 - Virt-who is running in vdsm mode
2012-10-23 01:46:51,708 [DEBUG]  @virt-who.py:438 - Starting infinite loop with 10 seconds interval and event handling
2012-10-23 01:46:51,796 [DEBUG]  @subscriptionmanager.py:81 - Sending list of uuids: []

The commands can be successfully executed, and there's no error info in the log file: /var/log/rhsm/rhsm.log

Moving it to VERIFIED.

Comment 11 errata-xmlrpc 2013-01-08 17:54:54 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-2013-0143.html


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