Bug 1392621

Summary: Setting cloudprovider should not over write nodename when openshift_hostname is set installing on OpenStack
Product: OpenShift Container Platform Reporter: Ryan Howe <rhowe>
Component: InstallerAssignee: Russell Teague <rteague>
Installer sub component: openshift-ansible QA Contact: Johnny Liu <jialiu>
Status: CLOSED INSUFFICIENT_DATA Docs Contact:
Severity: low    
Priority: medium CC: aos-bugs, bleanhar, chernand, cjonagam, jokerman, mmccomas, rhowe
Version: 3.3.0   
Target Milestone: ---   
Target Release: ---   
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: 2017-08-24 18:30:10 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:

Description Ryan Howe 2016-11-07 22:15:46 UTC
Description of problem:

When openshift_cloudprovider_kind is set during the install the nodeName comes from the metadata of the cloud provide even when openshift_hostname is set for the host. 

https://github.com/openshift/openshift-ansible/blob/master/roles/openshift_facts/library/openshift_facts.py#L938-L944

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


Steps to Reproduce:
1. On openstack environment in nova.conf set dhcp_domain to openstacklocal or random string. (I am using openstacklocal in these steps bc this is how we found out openshift_hostname was not used) 

2. Set up cluster and hostfile setting openshift_hostname=HOSTNAME and openshift_cloudprovider_kind=openstack

3. Run installer 

Actual results:

node-config.yaml gets a value of the nodeName equal to what contents are seen by running 
# curl http://169.254.169.254/openstack/latest/meta_data.json -s | python -m json.tool


Expected results:
I expect the nodeName to be what is set for openshift_hostname as I want to overwrite the value that would normally come from the metadata server. 

Additional info:

Comment 1 Scott Dodson 2016-11-08 03:22:09 UTC
Can you confirm which version of the installer is used, is it from rpms or from a github checkout? The code you've referenced was reverted prior to releasing the 3.3 installer. It did exist in the release-1.3 branch but QE caught this issue prior to release.

Comment 2 Johnny Liu 2016-11-08 03:37:21 UTC
What is your version of openshift-ansilbe rpm package?

Seem like this bug is dup with BZ#1383015, while BZ#1383015 is already fixed, so I suspect you are using a wrong openshift-ansilbe rpm package for your installation.

Comment 3 Christian Hernandez 2016-11-10 18:59:16 UTC
This same thing just happened here at a customer POC. We are running with the aws cloud provider. Will upload logs soon.

Comment 4 cjonagam 2016-11-17 18:17:56 UTC
This was the error christian was seeing

`Could not find an allocated subnet for node: ip-172-23-10-197.nmgcloudapps.net,`