Bug 1573074

Summary: The deployment fails on create_storage_domain stage when using generated answers
Product: [oVirt] ovirt-hosted-engine-setup Reporter: Sam McLeod <mailinglists>
Component: GeneralAssignee: Ido Rosenzwig <irosenzw>
Status: CLOSED CURRENTRELEASE QA Contact: Natalie Gavrielov <ngavrilo>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 2.2.16CC: bugs, mailinglists, stirabos, ylavi
Target Milestone: ovirt-4.2.4Flags: rule-engine: ovirt-4.2+
rule-engine: exception+
Target Release: 2.2.21   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: ovirt-hosted-engine-setup-2.2.21 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-06-26 08:39:37 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: 1581783    
Attachments:
Description Flags
engines deploy answers file none

Description Sam McLeod 2018-04-30 06:29:52 UTC
Description of problem:

hosted-engine --deploy fails on the create_storage_domain stage when using storage domain in answers.conf

Looks to be similar to https://bugzilla.redhat.com/show_bug.cgi?id=1556866

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

ovirt-hosted-engine-setup-2.2.16-1.el7.centos.noarch

How reproducible:

Every time an answers file is provided.

Steps to Reproduce:
1. Set the default value of `OVEHOSTED_STORAGE/storageDomainName=str:hosted_storage` in answers.conf
2. Run hosted-engine --deploy --config-append=answers.conf

Actual results:

[ INFO  ] TASK [Add iSCSI storage domain]
[ ERROR ] fatal: [localhost]: FAILED! => {"msg": "The task includes an option with an undefined variable. The error was: 'None' has no attribute 'split'\n\nThe error appears to have been in '/usr/share/ovirt-hosted-engine-setup/ansible/create_storage_domain.yml': line 71, column 5, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n    register: otopi_storage_domain_details\n  - name: Add iSCSI storage domain\n    ^ here\n"}

Expected results:

As the line `OVEHOSTED_STORAGE/storageDomainName=str:hosted_storage was generated from a successful interactive deployment, I would expect it to work when provided in an answers.conf file.

Comment 1 Ido Rosenzwig 2018-04-30 07:21:09 UTC
Please provide the answerfile that you used

Comment 2 Sam McLeod 2018-04-30 22:02:27 UTC
Created attachment 1428959 [details]
engines deploy answers file

Comment 3 Sam McLeod 2018-05-01 03:07:24 UTC
Removing the split from STORAGE_DOMAIN_ADDR and ISCSI_PORTAL_PORT in /usr/share/ovirt-hosted-engine-setup/ansible/create_storage_domain.yml provides more insight into the issue, suggesting that STORAGE_DOMAIN_ADDR is empty for some reason.


Looking in /usr/share/ovirt-hosted-engine-setup/plugins/gr-he-ansiblesetup/core/target_vm.py, it appears STORAGE_DOMAIN_ADDR address is STORAGE_DOMAIN_CONNECTION:

storage_domain_address = self.environment[
  ohostedcons.StorageEnv.STORAGE_DOMAIN_CONNECTION
]

In answers.conf it is set (by a successful deployment, not by hand):

OVEHOSTED_STORAGE/storageDomainConnection=str:10.51.10.10

Comment 4 Sam McLeod 2018-05-01 05:02:26 UTC
Interestingly if I remove the following OVEHOSTED_STORAGE parameters from the answers file but provide the *exact same* input when prompted - the deploy succeeds.

OVEHOSTED_STORAGE/iSCSIPortalPort=str:3260
OVEHOSTED_STORAGE/iSCSIPortal=str:1
OVEHOSTED_STORAGE/storageDomainConnection=str:10.51.10.10
OVEHOSTED_STORAGE/iSCSIPortalIPAddress=str:10.51.10.10
OVEHOSTED_STORAGE/iSCSITargetName=str:iqn.2003-01.org.linux-iscsi.s1-san5.x8664:sn.a70bc7bf74e5
OVEHOSTED_STORAGE/LunID=str:3600140521be786300000000000000000

Comment 5 Natalie Gavrielov 2018-06-07 11:39:07 UTC
Verified (automation: rhv-ge-deploy-4.2 #1529)
deployment using answer file that includes parameters:
OVEHOSTED_STORAGE/storageDatacenterName
OVEHOSTED_STORAGE/domainType
OVEHOSTED_STORAGE/LunID
OVEHOSTED_STORAGE/storageDomainConnection
OVEHOSTED_STORAGE/iSCSIPortalIPAddress
OVEHOSTED_STORAGE/iSCSIPortalPort
OVEHOSTED_STORAGE/iSCSIPortalUser
OVEHOSTED_STORAGE/iSCSIPortal
OVEHOSTED_STORAGE/iSCSITargetName
OVEHOSTED_STORAGE/storageDomainName

Build: ovirt-engine-4.2.3.4-0.1.el7.noarch (rhv-4.2.4-2)

Comment 6 Sandro Bonazzola 2018-06-26 08:39:37 UTC
This bugzilla is included in oVirt 4.2.4 release, published on June 26th 2018.

Since the problem described in this bug report should be
resolved in oVirt 4.2.4 release, it has been closed with a resolution of CURRENT RELEASE.

If the solution does not work for you, please open a new bug report.