Bug 1227259

Summary: [RFE] virt-who should support connecting rhevm and hyperV through proxy
Product: Red Hat Enterprise Linux 6 Reporter: Liushihui <shihliu>
Component: virt-whoAssignee: Radek Novacek <rnovacek>
Status: CLOSED ERRATA QA Contact: gaoshang <sgao>
Severity: high Docs Contact:
Priority: medium    
Version: 6.7CC: gxing, hsun, ovasik, rbalakri, sgao, shihliu, tlavigne
Target Milestone: rcKeywords: FutureFeature
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: virt-who-0.16-1.el6 Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
: 1250782 (view as bug list) Environment:
Last Closed: 2016-05-10 23:55:13 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:
Embargoed:
Bug Depends On:    
Bug Blocks: 1250782    

Description Liushihui 2015-06-02 09:19:10 UTC
Description of problem:
virt-who can't support connecting rhevm and hyperV through proxy, it just support connecting vcenter through proxy 

Version-Release number of selected component (if applicable):
virt-who-0.12-8.el6.noarch
subscription-manager-1.14.6-1.el6.x86_64
python-rhsm-1.14.2-1.el6.x86_64
katello-headpin-1.4.3.28-1.el6sam_splice.noarch
candlepin-0.9.6.5-1.el6sam.noarch

How reproducible:
Always

Steps to Reproduce:
1. Configure virt-who run at rhevm mode/hyperv mode, make sure system which installed virt-who can't connect to rhevm/hyperv directly
2. Configure virt-who connect rhevm/hyperv through proxy as the following
# cat /etc/sysconfig/virt-who
http_proxy=http://10.66.129.158:3128
3. Restart virt-who service

Actual results:
virt-who hasn't connected to proxy and throw error log as the following
2015-06-02 17:04:41,184 [ERROR]  @virt.py:225 - Virt backend 'env/cmdline' fails with exception:
Traceback (most recent call last):
  File "/usr/share/virt-who/virt/virt.py", line 221, in run
    self._run()
  File "/usr/share/virt-who/virt/virt.py", line 249, in _run
    report = self._get_report()
  File "/usr/share/virt-who/virt/virt.py", line 195, in _get_report
    return HostGuestAssociationReport(self.config, self.getHostGuestMapping())
  File "/usr/share/virt-who/virt/rhevm/rhevm.py", line 79, in getHostGuestMapping
    hosts_xml = ElementTree.parse(self.get(self.hosts_url))
  File "/usr/share/virt-who/virt/rhevm/rhevm.py", line 66, in get
    return urllib2.urlopen(request)
  File "/usr/lib64/python2.6/urllib2.py", line 126, in urlopen
    return _opener.open(url, data, timeout)
  File "/usr/lib64/python2.6/urllib2.py", line 391, in open
    response = self._open(req, data)
  File "/usr/lib64/python2.6/urllib2.py", line 409, in _open
    '_open', req)
  File "/usr/lib64/python2.6/urllib2.py", line 369, in _call_chain
    result = func(*args)
  File "/usr/lib64/python2.6/urllib2.py", line 1198, in https_open
    return self.do_open(httplib.HTTPSConnection, req)
  File "/usr/lib64/python2.6/urllib2.py", line 1165, in do_open
    raise URLError(err)
URLError: <urlopen error [Errno 110] Connection timed out>

Expected results:
I suggest virt-who also support http_proxy when connect to rhevm and hyperv

Additional info:

Comment 2 Radek Novacek 2015-09-29 10:34:38 UTC
The proxy support has been added upstream and will be part of the rebase.

Comment 3 Radek Novacek 2015-12-17 12:28:27 UTC
Fixed by rebase to virt-who-0.16-1.el6.

Comment 5 Liushihui 2016-02-23 06:38:14 UTC
Failed to verified it as it blocked by bug 1309611.

Comment 6 Radek Novacek 2016-03-15 11:47:07 UTC
Please retry it with python-rhsm-1.15.1-1 or newer.

Comment 7 Liushihui 2016-03-16 02:23:54 UTC
Verified it on virt-who-0.16-7.el6.noarch since virt-who can connect with rhevm and hyperV through proxy.

Verified version:
virt-who-0.16-7.el6.noarch
subscription-manager-1.16.8-4.el6.x86_64
python-rhsm-1.16.6-1.el6.x86_64

Comment 9 errata-xmlrpc 2016-05-10 23:55:13 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.

https://rhn.redhat.com/errata/RHEA-2016-0859.html