Bug 1314175 - virt-who can't terminate automatically when run with error username/password
virt-who can't terminate automatically when run with error username/password
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: virt-who (Show other bugs)
x86_64 Linux
unspecified Severity medium
: rc
: ---
Assigned To: Chris Snyder
Depends On:
  Show dependency treegraph
Reported: 2016-03-03 02:49 EST by Liushihui
Modified: 2016-12-15 02:54 EST (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2016-12-15 02:54:17 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Liushihui 2016-03-03 02:49:10 EST
Description of problem:
When run virt-who with wrong hypervisor username and password, it still run normally although throw up error info in the log.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. Register system to satellite6
2. Run virt-who with error username and password at CLI mode:
[root@sgi-xe270-01 ~]# virt-who --hyperv --hyperv-owner=ACME_Corporation --hyperv-env=Library --hyperv-server= --hyperv-username=administrator --hyperv-password=XXXXXXX 
2016-03-03 02:41:49,700 INFO: Using reporter_id='sgi-xe270-01.rhts.eng.bos.redhat.com'
2016-03-03 02:41:49,703 INFO: Using configuration "env/cmdline" ("hyperv" mode)
2016-03-03 02:41:53,300 ERROR: Virt backend 'env/cmdline' fails with error: Incorrect domain/username/password
2016-03-03 02:41:53,301 INFO: Waiting 60 seconds before retrying backend 'env/cmdline'
2016-03-03 02:42:56,808 ERROR: Virt backend 'env/cmdline' fails with error: Incorrect domain/username/password
2016-03-03 02:42:56,808 INFO: Waiting 60 seconds before retrying backend 'env/cmdline'

Actual results:
Although it will throw up error info "fails with error: Incorrect domain/username/password" virt-who thread can't terminated automatically,it still retry every 60s,

Expected results:
When username and password is error, virt-who should not only throw up error info in the log but also terminated automatically.

Additional info:
Comment 2 Radek Novacek 2016-05-05 05:12:29 EDT
I don't think virt-who should terminate itself in this case, there are couple of scenarios to consider:

1) admin first starts virt-who and after that creates user in the hypervisor
2) temporary outage in authentication mechanism on hypervisor (e.g. when LDAP server is not available for some time and hypervisor tries to authenticate against local users)

Overall I think that virt-who shouldn't stop when hypervisor username/password is not valid. 

Comment 3 Radek Novacek 2016-10-06 03:44:15 EDT

do you agree with my reasoning in comment #2?
Comment 4 Liushihui 2016-10-18 04:48:52 EDT

OK, I understand it now.
However, I have another concern about this problem since virt-who throw up some exception info when it failed to connect vcenter. please see it as the following. 
Can virt-who just send some brief error info as it show on hyperv(Incorrect domain/username/password)? 

2016-10-18 04:43:17,765 [virtwho.test-esx1 ERROR] Esx-1(23748):MainThread @esx.py:login:346 - Unable to login to ESX
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/virtwho/virt/esx/esx.py", line 341, 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 647, in send
    result = self.succeeded(binding, reply.message)
  File "/usr/lib/python2.7/site-packages/suds/client.py", line 684, in succeeded
    reply, result = binding.get_reply(self.method, reply)
  File "/usr/lib/python2.7/site-packages/suds/bindings/binding.py", line 151, in get_reply
  File "/usr/lib/python2.7/site-packages/suds/bindings/binding.py", line 182, in detect_fault
    raise WebFault(p, fault)
WebFault: Server raised fault: 'Cannot complete login due to an incorrect user name or password.'
Comment 5 Eko 2016-12-15 02:54:17 EST
closed it, if exception error is still exist, please file a new bug for it.

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