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...
Keywords:
Status: CLOSED ERRATA
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
medium
high
Target Milestone: ---
: 3.5.0
Assignee: Simone Tiraboschi
QA Contact: sefi litmanovich
URL:
Whiteboard: integration
Depends On:
Blocks: rhev3.5beta 1156165
TreeView+ depends on / blocked
 
Reported: 2014-06-16 15:55 UTC by wdaniel
Modified: 2019-04-28 09:36 UTC (History)
10 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:
Environment:
Last Closed: 2015-02-11 20:40:17 UTC
oVirt Team: ---
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2015:0161 0 normal SHIPPED_LIVE ovirt-hosted-engine-setup bug fix and enhancement update 2015-12-07 21:35:11 UTC
oVirt gerrit 29898 0 master MERGED packaging: setup: raising an exception on SDK failure Never
oVirt gerrit 29963 0 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:
1.
2.
3.

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:

(from add_host.py)
    def _closeup(self):
        self._getPKICert()
        self._getSSHkey()
        try:
            self.logger.debug('Connecting to the Engine')
            engine_api = self._ovirtsdk_api.API(                         <==== 'engine_api' gets assigned if the try statement works
                url='https://{fqdn}/api'.format(
                    fqdn=self.environment[
                        ohostedcons.NetworkEnv.OVIRT_HOSTED_ENGINE_FQDN
                    ],
                ),
                username='admin@internal',
                password=self.environment[
                    ohostedcons.EngineEnv.ADMIN_PASSWORD
                ],
                ca_file=self.cert,
            )

<snip>

        except ovirtsdk.infrastructure.errors.RequestError as e:
            self.logger.debug(
                'Cannot add the host to the Default cluster',
                exc_info=True,
            )
            self.logger.error(
                _(
                    'Cannot automatically add the host '
                    'to the Default cluster:\n{details}\n'
                ).format(
                    details=e.detail
                )
            )
        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
            engine_api,
            self.environment[ohostedcons.EngineEnv.APP_HOST_NAME]
        )

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:
https://bugzilla.redhat.com/show_bug.cgi?id=1116009

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.

https://rhn.redhat.com/errata/RHBA-2015-0161.html


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