Bug 1334920

Summary: Answer file is not fetched from first host if you specify the first host root password in the second host's answer file
Product: Red Hat Enterprise Virtualization Manager Reporter: Fabian von Feilitzsch <fabian>
Component: ovirt-hosted-engine-setupAssignee: Sandro Bonazzola <sbonazzo>
Status: CLOSED DUPLICATE QA Contact: meital avital <mavital>
Severity: high Docs Contact:
Priority: high    
Version: 3.6.5CC: gklein, lsurette, stirabos, ykaul
Target Milestone: ---   
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-05-17 21:01:31 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Integration RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1099562    

Description Fabian von Feilitzsch 2016-05-10 19:39:18 UTC
Description of problem:
When running hosted-engine --deploy for the second+ host, if you specify the root password for the first host in the answer file (OVEHOSTED_FIRST_HOST/rootPassword), the answer file is never fetched, and the installer fails with a Nonetype is not iterable error.

Version-Release number of selected component (if applicable):
Using this package: ovirt-hosted-engine-setup-1.3.5.0-1.el7ev.noarch

How reproducible:
100%

Steps to Reproduce:
1. Do self-hosted deploy on first host
2. Attempt an unattended installation on a second host, specifying all answers in the answer file.

Actual results:
NoneType is not iterable, the installation fails

Expected results:
The installation does not fail, and proceeds with the answer file from the first host.

Additional info:

I got this working locally, by modifying the _fetch_answer file in /usr/share/ovirt-hosted-engine-setup/plugins/ovirt-hosted-engine-setup/core/remote_answerfile.py. The while loop there iterates as long as the password is none, which is never true if it's specified in the answer file, so that part is skipped and the answer file is never copied. I just added ` or self._tmp_ans is None` to the while conditional check, and added an else branch to the conditional directly below that which sets password to self.environment[ohostedcons.FirstHostEnv.ROOT_PASSWORD]. Here is the whole modified block (starting on line 121):

while self.environment[ohostedcons.FirstHostEnv.ROOT_PASSWORD] is None or self._tmp_ans is None:
    if interactive:
        password = self.dialog.queryString(
            name='HOST_FIRST_HOST_ROOT_PASSWORD',
            note=_(
                "Enter 'root' user password for host {fqdn}: "
            ).format(
                fqdn=fqdn,
            ),
            prompt=True,
            hidden=True,
        )
    else:
        password = self.environment[ohostedcons.FirstHostEnv.ROOT_PASSWORD]

 

Here is my answer file:

[environment:default]
OVEHOSTED_CORE/confirmSettings=bool:True
OVEHOSTED_CORE/deployProceed=bool:True
OVEHOSTED_CORE/screenProceed=bool:True
OVEHOSTED_CORE/isAdditionalHost=bool:True
OVEHOSTED_STORAGE/domainType=str:nfs3
OVEHOSTED_STORAGE/storageDomainConnection=str:<host>:<path>
OVEHOSTED_STORAGE/storageDomainName=str:my_storage
OVEHOSTED_STORAGE/hostID=str:2
OVEHOSTED_ENGINE/appHostName=str:hosted_engine_2
OVEHOSTED_ENGINE/adminPassword=str:<password>
OVEHOSTED_FIRST_HOST/fqdn=str:rhevh.example.com
OVEHOSTED_FIRST_HOST/fetchAnswer=bool:True
OVEHOSTED_FIRST_HOST/rootPassword=str:<password>

Comment 1 Fabian von Feilitzsch 2016-05-10 19:43:06 UTC
This issue is impacting the ability to deploy self hosted by the Quickstart Cloud Installer (Red Hat Cloud Suite).

Comment 2 Simone Tiraboschi 2016-05-17 21:01:31 UTC

*** This bug has been marked as a duplicate of bug 1322729 ***