Bug 1382062

Summary: Upper case letters in HostnameFormat parameters cause trouble
Product: Red Hat OpenStack Reporter: Jiri Stransky <jstransk>
Component: openstack-tripleo-heat-templatesAssignee: Alex Schultz <aschultz>
Status: CLOSED ERRATA QA Contact: Gurenko Alex <agurenko>
Severity: medium Docs Contact:
Priority: medium    
Version: 10.0 (Newton)CC: agurenko, aschultz, egallen, gkadam, jraju, jslagle, jstransk, mburns, mcornea, ohochman, rhel-osp-director-maint, tvignaud
Target Milestone: Upstream M2Keywords: Triaged
Target Release: 12.0 (Pike)   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: openstack-tripleo-heat-templates-7.0.0-0.20170616123155.el7ost puppet-tripleo-7.1.1-0.20170623015402.2625756.el7ost Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-12-13 20:46:56 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 Jiri Stransky 2016-10-05 15:56:26 UTC
If one uses uppercase letters to name Nova servers, e.g.:

ControllerHostnameFormat: 'CONTROLLER%index%'

Then the uppercase is used on Nova/Heat side to refer to the machine, but the actual hostname is lower case.

# hiera -c /etc/puppet/hiera.yaml bootstrap_nodeid
CONTROLLER0

# facter hostname
controller0

This causes the bootstrap node checks to not work, which breaks dependent features like upgrades/updates and restarts on config change.

Comment 1 Jiri Stransky 2016-10-05 16:16:30 UTC
The problems could be deeper than just the bootstrap node checks, e.g. see:

[root@controller0 hieradata]# grep -r CONTROLLER /etc/puppet/hieradata/
/etc/puppet/hieradata/controller.yaml:bootstack_nodeid: CONTROLLER0
/etc/puppet/hieradata/bootstrap_node.yaml:bootstrap_nodeid: CONTROLLER0
/etc/puppet/hieradata/ceph_cluster.yaml:ceph_mon_initial_members: CONTROLLER0,CONTROLLER1,CONTROLLER2
/etc/puppet/hieradata/all_nodes.yaml:controller_node_names: CONTROLLER0,CONTROLLER1,CONTROLLER2
/etc/puppet/hieradata/all_nodes.yaml:galera_node_names: CONTROLLER0,CONTROLLER1,CONTROLLER2

I wonder if we should simply disallow uppercase letters in the *HostnameFormat parameters.

Comment 2 James Slagle 2017-03-01 13:00:41 UTC
i think the right fix here is to make the bootstrap node hostname checks case insensitive, as hostnames are generally considered case insensitive

Comment 3 Alex Schultz 2017-06-15 18:38:37 UTC
Do we have any specific errors around this? I only see redis and mongo not correctly using downcase($bootstrap_nodeid). I will fix those but unless we have some additional information, this shouldn't be an issue.

Comment 4 Alex Schultz 2017-06-15 19:23:46 UTC
It looks like we also don't have the same case insensitive comparisons in the THT scripts. so i'm looking into those as well but any specific errors would be handy

Comment 5 Jiri Stransky 2017-06-16 07:38:35 UTC
The issue we actually hit was just with the bootstrap node check, which i think is handled by https://review.openstack.org/474762

Comment 10 Omri Hochman 2017-11-16 15:56:18 UTC
verified with openstack-tripleo-heat-templates-7.0.3-3.el7ost.noarch


[root@undercloud74 ~]# cat /usr/share/openstack-puppet/modules/tripleo/manifests/profile/base/database/redis.pp | grep downcase
    if downcase($bootstrap_nodeid) == $::hostname {

Comment 15 errata-xmlrpc 2017-12-13 20:46:56 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

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

https://access.redhat.com/errata/RHEA-2017:3462