Encrypted password is not working in `virt-who` on `ESX` and `RHEVM` environment
Issue
- Encrypted password is not working in
virt-whoonESXandRHEVMenvironment - Configured
virt-whowith encrypted password in/etc/virt-who.d/template.conf- With
ESX:
- With
[vcenter]
type=esx
owner=RedHat
env=Library
server=vmware-1.sat6.example.com
username=satadmin
encryped_password=56f5f570fbb1711df8dbbc286cf9ef3f
rhsm_hostname=dhcp10-173.exmaple.com
rhsm_username=admin
rhsm_encrypted_password=314aefd359e7856d445f358a60b51f87
rhsm_prefix=/rhsm
* service virt-who restart;tail -f /var/log/rhsm/rhsm.log
2016-08-24 23:36:49,763 [DEBUG] @virtwho.py:133 - Using config named 'vcenter'
2016-08-24 23:36:49,763 [INFO] @virtwho.py:697 - Using configuration "vcenter" ("esx" mode)
2016-08-24 23:36:49,764 [DEBUG] @virtwho.py:216 - Starting infinite loop with 3600 seconds interval
2016-08-24 23:36:49,839 [DEBUG] @esx.py:55 - Log into ESX
2016-08-24 23:36:54,036 [ERROR] @esx.py:238 - Unable to login to ESX
Traceback (most recent call last):
File "/usr/share/virt-who/virt/esx/esx.py", line 235, in login
self.client.service.Login(_this=self.sc.sessionManager, userName=self.username, password=self.password)
File "/usr/lib/python2.7/site-packages/suds/client.py", line 542, in __call__
return client.invoke(args, kwargs)
File "/usr/lib/python2.7/site-packages/suds/client.py", line 602, in invoke
result = self.send(soapenv)
File "/usr/lib/python2.7/site-packages/suds/client.py", line 653, in send
result = self.failed(binding, e)
File "/usr/lib/python2.7/site-packages/suds/client.py", line 708, in failed
r, p = binding.get_fault(reply)
File "/usr/lib/python2.7/site-packages/suds/bindings/binding.py", line 265, in get_fault
raise WebFault(p, faultroot)
WebFault: Server raised fault: 'Cannot complete login due to an incorrect user name or password.'
2016-08-24 23:36:54,050 [ERROR] @virt.py:303 - Virt backend 'vcenter' fails with error: Server raised fault: 'Cannot complete login due to an incorrect user name or password.'
- With
RHEVM:
[rhemv]
type=rhevm
server=lab-rhevm.example.com:443
username=rhevadmin@rhevm.example.com:443
encryped_password=56f5f570fbb1711df8dbbc286cf9ef3f
owner=RedHat
env=Library
hypervisor_id=hostname
* service virt-who restart;tail -f /var/log/rhsm/rhsm.log
2016-08-24 23:26:49,638 [DEBUG] @virtwho.py:133 - Using config named 'rhemv'
2016-08-24 23:26:49,640 [INFO] @virtwho.py:697 - Using configuration "rhemv" ("rhevm" mode)
2016-08-24 23:26:49,641 [DEBUG] @virtwho.py:216 - Starting infinite loop with 3600 seconds interval
2016-08-24 23:26:49,754 [ERROR] @virt.py:306 - Virt backend 'rhemv' fails with exception:
Traceback (most recent call last):
File "/usr/share/virt-who/virt/virt.py", line 301, in run
self._run()
File "/usr/share/virt-who/virt/virt.py", line 332, in _run
report = self._get_report()
File "/usr/share/virt-who/virt/virt.py", line 274, in _get_report
return HostGuestAssociationReport(self.config, self.getHostGuestMapping())
File "/usr/share/virt-who/virt/rhevm/rhevm.py", line 104, in getHostGuestMapping
clusters_xml = ElementTree.parse(self.get(self.clusters_url))
File "/usr/share/virt-who/virt/rhevm/rhevm.py", line 89, in get
return urllib2.urlopen(request)
File "/usr/lib64/python2.7/urllib2.py", line 154, in urlopen
return opener.open(url, data, timeout)
File "/usr/lib64/python2.7/urllib2.py", line 437, in open
response = meth(req, response)
File "/usr/lib64/python2.7/urllib2.py", line 550, in http_response
'http', request, response, code, msg, hdrs)
File "/usr/lib64/python2.7/urllib2.py", line 475, in error
return self._call_chain(*args)
File "/usr/lib64/python2.7/urllib2.py", line 409, in _call_chain
result = func(*args)
File "/usr/lib64/python2.7/urllib2.py", line 558, in http_error_default
raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
HTTPError: HTTP Error 401: Unauthorized
Environment
- Red Hat Satellite 6.2
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
