Bug 1248168

Summary: [Docs] [Director] Hostname mapping to 127.0.0.1 causes install failure
Product: Red Hat OpenStack Reporter: Chris Dearborn <christopher_dearborn>
Component: documentationAssignee: Dan Macpherson <dmacpher>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: DirectorCC: adahms, arkady_kanevsky, cdevine, christopher_dearborn, John_walsh, kbader, kurt_hey, mburns, morazi, rajini.karthik, randy_perryman, rhel-osp-director-maint, rsussman, sasha, sreichar, wayne_allen, yeylon
Target Milestone: y2Keywords: Documentation
Target Release: 7.0 (Kilo)   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-12-16 04:57:58 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:
Bug Depends On:    
Bug Blocks: 1238779    

Description Chris Dearborn 2015-07-29 18:56:21 UTC
Description of problem:
The documentation states:
==================
An entry for the system’s FQDN hostname is also needed in /etc/hosts. For example, if the system is named myhost.mydomain, /etc/hosts should have an entry like:

127.0.0.1   myhost.mydomain
==================

But mapping the FQDN to the loopback address causes "openstack undercloud install" to fail with the following error:

Error: Could not run: Could not retrieve facts for director-r13: no address for director-r13

The FQDN should apparently be mapped to the external/public IP address.  The docs need to be updated so that it indicates a change to /etc/hosts that does not cause the installer to fail.

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

How reproducible:
See below.

Steps to Reproduce:
1. Add the FQDN to the 127.0.0.1 entry in /etc/hosts per the docs.
2. Run "openstack undercloud install"

Actual results:
Install errors out with above error message.

Expected results:
Install should succeed.

Additional info:
In this case, the Director node was installed with hostname: director-r13.rcbd.lab.
"hostname" returns the FQDN.
"hostname --fqdn" returns "localhost".
"dnsdomainname" returns nothing.
"nisdomainname" returns nothing.
"domainname" returns nothing.
"ping `hostname`" works.
"ping `hostname --short`" does not work.

Comment 3 Alexander Chuzhoy 2015-07-29 19:10:09 UTC
This never happens on my setup:

1. Could you please paste the /etc/hosts after you've added the hostname
2. Did you change the hostname after the OS was installed?

Comment 4 Chris Dearborn 2015-07-29 19:16:22 UTC
/etc/hosts:
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4 director-r13.rcbd.lab
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6

No, I did not change the hostname after system install.  After the failure occurred, I did try the hostnamectl commands in the docs, then reran the install and produced the same failure.

Comment 5 Alexander Chuzhoy 2015-07-29 19:43:49 UTC
ok,
my host is registered in DNS, so:
1. pinging `hostname -f` tries 127.0.0.1
2. pinging `hostname -s` tries the IP registered in DNS. I have the respective "search domainname" line in my /etc/resolv.conf file.

Comment 6 Chris Dearborn 2015-07-29 19:55:17 UTC
Not sure what you are asking for.

My host is not registered in DNS.
My resolv.conf does not contain a "domain" or "search" line

Comment 8 Andrew Dahms 2015-08-04 00:47:44 UTC
Updated flags.

Comment 9 Andrew Dahms 2015-08-30 23:35:45 UTC
Assigning to Dan for review.

Comment 10 Dan Macpherson 2015-09-08 01:22:38 UTC
Hi Chris,

The problem is because the director uses the first hostname for 127.0.0.1. So currently you hosts file includes:

127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4 director-r13.rcbd.lab

But it should be 

127.0.0.1   director-r13.rcbd.lab localhost localhost.localdomain localhost4 localhost4.localdomain4

We have bug open for this issue:

https://bugzilla.redhat.com/show_bug.cgi?id=1254370

And a fix is currently being implemented in this docs.

- Dan

Comment 11 Dan Macpherson 2015-09-23 05:25:38 UTC
Hi Chris,

I've pushed out a fix that should rectify the hostname issues:

https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux_OpenStack_Platform/7/html/Director_Installation_and_Usage/sect-Setting_the_Hostname_for_the_System.html

Can you verify if the new hostname order works for you?

Comment 12 Chris Dearborn 2015-12-02 17:48:45 UTC
Was just able to verify it.  Working great for me.