Bug 1314175

Summary: virt-who can't terminate automatically when run with error username/password
Product: Red Hat Enterprise Linux 6 Reporter: Liushihui <shihliu>
Component: virt-whoAssignee: Chris Snyder <csnyder>
Status: CLOSED WONTFIX QA Contact: Eko <hsun>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.8CC: hsun, ldai, rbalakri, sgao, shihliu
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-12-15 07:54:17 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:

Description Liushihui 2016-03-03 07:49:10 UTC
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):
virt-who-0.16-5.el6.noarch
subscription-manager-1.16.8-3.el6.x86_64
python-rhsm-1.16.6-1.el6.x86_64

How reproducible:
Always

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=10.73.5.227 --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 09:12:29 UTC
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. 

Opinions?

Comment 3 Radek Novacek 2016-10-06 07:44:15 UTC
Liushihui,

do you agree with my reasoning in comment #2?

Comment 4 Liushihui 2016-10-18 08:48:52 UTC
Redak,

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
    self.detect_fault(soapbody)
  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 07:54:17 UTC
closed it, if exception error is still exist, please file a new bug for it.