Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 1109929 - Failure to add initial host to Default cluster prevents the 'engine_api' variable from being set properly
Summary: Failure to add initial host to Default cluster prevents the 'engine_api' vari...
Alias: None
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-hosted-engine-setup
Version: 3.3.0
Hardware: x86_64
OS: Linux
Target Milestone: ---
: 3.5.0
Assignee: Simone Tiraboschi
QA Contact: sefi litmanovich
Whiteboard: integration
Depends On:
Blocks: rhev3.5beta 1156165
TreeView+ depends on / blocked
Reported: 2014-06-16 15:55 UTC by wdaniel
Modified: 2018-12-06 16:53 UTC (History)
11 users (show)

Fixed In Version: ovirt-3.5.0-beta1.1
Doc Type: Bug Fix
Doc Text:
Previously, if the host could not be added to the Default cluster during hosted engine deployment, the deployment would fail with an ambiguous error. Now, the issue is properly detected and a specific error is raised to make the user aware of the problem.
Clone Of:
Last Closed: 2015-02-11 20:40:17 UTC
oVirt Team: ---
Target Upstream Version:

Attachments (Terms of Use)

System ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2015:0161 normal SHIPPED_LIVE ovirt-hosted-engine-setup bug fix and enhancement update 2015-12-07 21:35:11 UTC
oVirt gerrit 29898 master MERGED packaging: setup: raising an exception on SDK failure Never
oVirt gerrit 29963 ovirt-hosted-engine-setup-1.2 MERGED packaging: setup: raising an exception on SDK failure Never

Description wdaniel 2014-06-16 15:55:48 UTC
Description of problem:

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

How reproducible:

Steps to Reproduce:

Actual results:

Expected results:

Additional info:

Comment 1 wdaniel 2014-06-16 16:04:57 UTC
Description of problem:

It appears that if the initial HA host can not be added to the Default cluster, the 'engine_api' variable is never set, thus causing Tracebacks in the next few steps:

    def _closeup(self):
            self.logger.debug('Connecting to the Engine')
            engine_api = self._ovirtsdk_api.API(                         <==== 'engine_api' gets assigned if the try statement works


        except ovirtsdk.infrastructure.errors.RequestError as e:
                'Cannot add the host to the Default cluster',
                    'Cannot automatically add the host '
                    'to the Default cluster:\n{details}\n'
        up = self._wait_host_ready(                                <======= 'engine_api' is called here as a parameter, but it's not set in the 'except' clause so it doesn't exist

I couldn't find any other code that would assign this variable in the python file .

How reproducible:

Have not been able to yet, working on trying t ofind a way to fail at the appropriate time.

Actual results:

The hosted-engine script fails out with Traceback errors, halting deployment of the VM

Expected results:

Hosted-engine script could warn of the particular issue - in this case it appears as if the rhevm bridge had been created but didn't have an IP address. Script should make sure the engine_api variable is properly set and handled either outside this try/except clause, or in the except statement in addition to the try statement.

Comment 7 Simone Tiraboschi 2014-07-08 13:37:03 UTC
Please check if is somehow related to this one:

Comment 8 sefi litmanovich 2015-01-15 14:02:13 UTC
Verified with ovirt-hosted-engine-setup-1.2.1-8.el7ev.noarch, installing rhevm-3.5.0-0.28.el6ev.noarch as engine.

To invoke the error at the 'Enter the name of the cluster to which you want to add the host (Default) [Default]:' stage I commented out the ip and hostname of the vm from the host's /etc/hosts and also blocked connection between the two with iptables before hitting return.

the error I got:
[ ERROR ] Failed to execute stage 'Closing up': [ERROR]::RHEV API connection failure, [Errno -2] Name or service not known

as expected.

Comment 10 errata-xmlrpc 2015-02-11 20:40:17 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.

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