Bug 1154362

Summary: [hosted-engine] cannnot add host to cluster automatically.
Product: Red Hat Enterprise Virtualization Manager Reporter: Ulhas Surse <usurse>
Component: ovirt-hosted-engine-setupAssignee: Sandro Bonazzola <sbonazzo>
Status: CLOSED INSUFFICIENT_DATA QA Contact: meital avital <mavital>
Severity: medium Docs Contact:
Priority: medium    
Version: 3.5.0CC: bazulay, dfediuck, dougsland, ecohen, gklein, iheim, lsurette, rbalakri, Rhev-m-bugs, sputhenp, usurse, yeylon
Target Milestone: ---   
Target Release: 3.5.0   
Hardware: All   
OS: Linux   
Whiteboard: integration
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-10-28 13:26:34 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: 1155170    

Description Ulhas Surse 2014-10-19 09:38:44 UTC
Description of problem:
Hosted-engine setup is not adding host automatically with error: 
 Cannot automatically add the host to cluster None:
JBWEB000065: HTTP Status 401

Version-Release number of selected component (if applicable):
Red Hat Enterprise Virtualization 3.5

How reproducible:
always

Steps to Reproduce:
1. Run hosted-engine --deploy
2. After creating rhevm vm, the host will not be added automatically.
3.

Actual results:
2014-10-19 03:12:10 DEBUG otopi.plugins.ovirt_hosted_engine_setup.engine.add_host add_host._closeup:415 Connecting to the Engine
2014-10-19 03:12:12 DEBUG otopi.plugins.ovirt_hosted_engine_setup.engine.add_host add_host._closeup:502 Cannot add the host to cluster None
Traceback (most recent call last):
  File "/usr/share/ovirt-hosted-engine-setup/scripts/../plugins/ovirt-hosted-engine-setup/engine/add_host.py", line 426, in _closeup
    ca_file=self.cert,
  File "/usr/lib/python2.6/site-packages/ovirtsdk/api.py", line 154, in __init__
    url=''
  File "/usr/lib/python2.6/site-packages/ovirtsdk/infrastructure/proxy.py", line 118, in request
    persistent_auth=self._persistent_auth)
  File "/usr/lib/python2.6/site-packages/ovirtsdk/infrastructure/proxy.py", line 146, in __doRequest
    persistent_auth=persistent_auth
  File "/usr/lib/python2.6/site-packages/ovirtsdk/web/connection.py", line 134, in doRequest
    raise RequestError, response
RequestError:
status: 401
reason: Unauthorized
detail: JBWEB000065: HTTP Status 401
2014-10-19 03:12:12 ERROR otopi.plugins.ovirt_hosted_engine_setup.engine.add_host add_host._closeup:510 Cannot automatically add the host to cluster None:
JBWEB000065: HTTP Status 401
2014-10-19 03:12:12 DEBUG otopi.context context._executeMethod:152 method exception
Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/otopi/context.py", line 142, in _executeMethod
    method['method']()
  File "/usr/share/ovirt-hosted-engine-setup/scripts/../plugins/ovirt-hosted-engine-setup/engine/add_host.py", line 517, in _closeup
    cluster=cluster_name,
RuntimeError: Cannot add the host to cluster None
2014-10-19 03:12:12 ERROR otopi.context context._executeMethod:161 Failed to execute stage 'Closing up': Cannot add the host to cluster None

Expected results:
Host should be added automatically.

Additional info:
workaround:
# service ovirt-ha-broker start
# service ovirt-ha-agent start
Manually add hypervisor to the manager.

Comment 1 Sandro Bonazzola 2014-10-21 08:40:27 UTC
Hi, looking at the error: 
status: 401
reason: Unauthorized

looks like you used different admin@internal password in hosted-engine --deploy on the host and in engine-setup in the VM.

Can you check if this is the case?
If not, please provide full logs from both the hosts and the vm.