Bug 810441

Summary: Restarting virt-who will encounter exception after rebooting of rhev-h which has registered to SAM and RHEV-M
Product: Red Hat Enterprise Linux 5 Reporter: yuanquan chen <yuachen>
Component: subscription-managerAssignee: William Poteat <wpoteat>
Status: CLOSED NOTABUG QA Contact: Entitlement Bugs <entitlement-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 5.8CC: bkearney, cshao, gouyang, huiwang, khong, leiwang, shcao, ycui
Target Milestone: rc   
Target Release: 5.8   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-04-09 03:26:33 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:
Bug Depends On:    
Bug Blocks: 771748    

Description yuanquan chen 2012-04-06 07:32:57 UTC
Description of problem:
After registering to SAM and RHEV-M, edit the /etc/sysconfig/virt-who, restart the virt-who service, it's ok. Reboot the rhev-h, edit the /etc/sysconfig/vrit-who, restart virt-who service, some exceptions appear.

Version-Release number of selected component (if applicable):
rhev-hypervisor-5.8-20120403.0.el5_8

How reproducible:
100%

Steps to Reproduce:
1. install rhev-h, boot up and register to SAM and RHEV-M
2. edit "/etc/sysconfig/virt-who" as "VIRTWHO_BACKGROUND=1 VIRTWHO_DEBUG=1 VIRTWHO_VDSM=1 VIRTWHO_INTERVAL=2", restart virt-who as "service virt-who restart", it's ok
3. restart rhev-h, edit "/etc/sysconfig/virt-who" as step 2, restart the virt-who service.
  
Actual results:
Register rhev-h to SAM and RHEV-M, reboot the rhev-h, edit "/etc/sysconfig/virt-who", restart the virt-who service, some exceptions appear.

Expected results:
Register rhev-h to SAM and RHEV-M, reboot the rhev-h, edit "/etc/sysconfig/virt-who", restart the virt-who service, no exception appears.

Additional info:
[root@hp-slot1-eth0 ~]# vi /etc/sysconfig/virt-who 
[root@hp-slot1-eth0 ~]# service virt-who restart
Stopping virt-who:                                         [  OK  ]
Starting virt-who: Listening for events is not available in VDSM or ESX
mode
Virt-who is running in vdsm mode
Starting infinite loop with 2 seconds interval and event handling
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
  File "/usr/lib/python2.4/site-packages/rhsm/connection.py", line 411,
in ping
  File "/usr/lib/python2.4/site-packages/rhsm/connection.py", line 267,
in request_get
  File "/usr/lib/python2.4/site-packages/rhsm/connection.py", line 227,
in _request
  File "/usr/lib64/python2.4/httplib.py", line 810, in request
  File "/usr/lib64/python2.4/httplib.py", line 833, in _send_request
  File "/usr/lib64/python2.4/httplib.py", line 804, in endheaders
  File "/usr/lib64/python2.4/httplib.py", line 685, in _send_output
  File "/usr/lib64/python2.4/httplib.py", line 652, in send
  File "/usr/lib64/python2.4/site-packages/M2Crypto/httpslib.py", line
47, in connect
  File "/usr/lib64/python2.4/site-packages/M2Crypto/SSL/Connection.py",
line 170, in connect
  File "<string>", line 1, in connect
gaierror: (-2, 'Name or service not known')
                                                           [  OK  ]
[root@hp-slot1-eth0 ~]# Sending update to updateConsumer: []
(-2, 'Name or service not known')
Traceback (most recent call last):
  File "/usr/share/virt-who/virt-who.py", line 143, in _send
  File "/usr/share/virt-who/subscriptionmanager.py", line 80, in
sendVirtGuests
SubscriptionManagerError: (-2, 'Name or service not known')
Error in communication with candlepin, trying to recover
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
  File "/usr/lib/python2.4/site-packages/rhsm/connection.py", line 411,
in ping
  File "/usr/lib/python2.4/site-packages/rhsm/connection.py", line 267,
in request_get
  File "/usr/lib/python2.4/site-packages/rhsm/connection.py", line 227,
in _request
  File "/usr/lib64/python2.4/httplib.py", line 810, in request
  File "/usr/lib64/python2.4/httplib.py", line 833, in _send_request
  File "/usr/lib64/python2.4/httplib.py", line 804, in endheaders
  File "/usr/lib64/python2.4/httplib.py", line 685, in _send_output
  File "/usr/lib64/python2.4/httplib.py", line 652, in send
  File "/usr/lib64/python2.4/site-packages/M2Crypto/httpslib.py", line
47, in connect
  File "/usr/lib64/python2.4/site-packages/M2Crypto/SSL/Connection.py",
line 170, in connect
  File "<string>", line 1, in connect
gaierror: (-2, 'Name or service not known')
Sending update to updateConsumer: []
(-2, 'Name or service not known')
Traceback (most recent call last):
  File "/usr/share/virt-who/virt-who.py", line 143, in _send
  File "/usr/share/virt-who/subscriptionmanager.py", line 80, in
sendVirtGuests
SubscriptionManagerError: (-2, 'Name or service not known')
Unable to recover, retry in 60 seconds.

Comment 2 yuanquan chen 2012-04-09 03:26:33 UTC
I retry the restarting of virt-who and find that the root cause of the exception is that the SAM server can't be resolved by the default DNS server. If we specify the proper DNS server in rhev-h, there's no any exception.