Bug 1534934

Summary: [Doc] Azure installation failed with openshift_hostname undefined
Product: OpenShift Container Platform Reporter: Wenqi He <wehe>
Component: DocumentationAssignee: Vikram Goyal <vigoyal>
Status: CLOSED WONTFIX QA Contact: Xiaoli Tian <xtian>
Severity: high Docs Contact: Vikram Goyal <vigoyal>
Priority: high    
Version: 3.9.0CC: aos-bugs, decarr, jhou, jokerman, mgugino, mmccomas
Target Milestone: ---   
Target Release: 3.11.z   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-04-22 13:24:19 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:

Description Wenqi He 2018-01-16 10:21:07 UTC
Description of problem:
Install OCP on Azure failed with openshift_hostname undefined

Version-Release number of the following components:
openshift-ansible master branch
$ git describe
openshift-ansible-3.9.0-0.20.0


How reproducible:
Always

Steps to Reproduce:
1.Start VMs on Azure
2.Deploy OCP with at least one node role host.

Actual results:
# ansible-playbook -i inventory -v /usr/share/ansible/openshift-ansible/playbooks/prerequisites.yml
TASK [Validate openshift_hostname when defined] ********************************
Tuesday 16 January 2018  09:20:08 +0000 (0:00:00.445)       0:00:08.809 ******* 
fatal: [example.com.cloudapp.azure.com]: FAILED! => {"msg": "The task includes an option with an undefined variable. The error was: 'openshift_hostname' is undefined\n\nThe error appears to have been in '/home/slave4/workspace/Launch Environment Flexy/private-openshift-ansible/playbooks/init/validate_hostnames.yml': line 13, column 5, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n  - name: Validate openshift_hostname when defined\n    ^ here\n\nexception type: <class 'ansible.errors.AnsibleUndefinedVariable'>\nexception: 'openshift_hostname' is undefined"}

Below is the inventory file related to this error:
#openshift host defination start
[masters]
example.com.cloudapp.azure.com ansible_user=root ansible_ssh_user=root openshift_public_hostname=example.com.cloudapp.azure.com
[nodes]
example.com.cloudapp.azure.com ansible_user=root ansible_ssh_user=root openshift_public_hostname=example.com.cloudapp.azure.com openshift_node_labels="{'role': 'node'}"

After I added openshift_hostname=example.com.cloudapp.azure.com in the inventory, I got below error:

TASK [Validate openshift_hostname when defined] **************************************************************************************************
fatal: [example.com.cloudapp.azure.com]: FAILED! => {"changed": false, "failed": true, "msg": "The hostname example.com.cloudapp.azure.com for example.com.cloudapp.azure.com doesn't resolve to an IP address owned by this host. Please set openshift_hostname variable to a hostname that when resolved on the host in question resolves to an IP address matching an interface on this host. This will ensure proper functionality of OpenShift networking features. Inventory setting: openshift_hostname=example.com.cloudapp.azure.com This check can be overridden by setting openshift_hostname_check=false in the inventory. See https://docs.openshift.org/latest/install_config/install/advanced_install.html#configuring-host-variables\n"}


Expected results:
No errors and Azure can be installed successfully.

Additional info:

Comment 1 Wenqi He 2018-01-17 05:51:41 UTC
Due to fail to install on Azure, all the test related to Azure specific feature is blocked. Such as Azure disk, Azure file and so on

Comment 2 Wenqi He 2018-01-18 09:04:05 UTC
I'd like to remove the TestBlocker key word since we figured out that we need to create the internal host name on Azure firstly and then create VM. Like below:
az network nic create --resource-group xxx --name qe-internal-ip --vnet-name qe-vnet --subnet default-subnet --internal-dns-name qe-internal-hostname --public-ip-address qe-public-ip

But I think this is something we need to doc and explain the new change since it worked in 3.7 before without --internal-dns-name. Thanks

Comment 4 Jan Chaloupka 2018-08-02 07:52:15 UTC
Hi Wenqi,

are you saying this is documentation only issue? Or is there something else that needs to be resolved (given the priority is still high)?

Scott, do we have already a place in openshift docs for the Azure cloud provider where we could put the note?

Comment 5 Wenqi He 2018-08-03 02:06:50 UTC
I think it is doc related issue for 3.9 and above, without internal hostname, the installation will fail, and I do not think openshift-ansible can help modify something to fix this, it should notice user when they create vms need to set --internal-dns-name on network interface.

Comment 8 Michael Gugino 2019-04-09 13:24:55 UTC
Moving to Documentation component.