Bug 1371685 - When using HostnameMap with more than 9 computes, hostnames are not properly set
Summary: When using HostnameMap with more than 9 computes, hostnames are not properly set
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat OpenStack
Classification: Red Hat
Component: openstack-tripleo-heat-templates
Version: 8.0 (Liberty)
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: 10.0 (Newton)
Assignee: Jiri Stransky
QA Contact: Arik Chernetsky
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-08-30 19:43 UTC by David Hill
Modified: 2019-12-16 06:34 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-07-28 17:32:37 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description David Hill 2016-08-30 19:43:57 UTC
Description of problem:
When using HostnameMap with more than 9 computes, hostnames are not properly set and this is due to the use of str_replace in /usr/share/openstack-tripleo-heat-templates/puppet/compute.yaml:

  NovaCompute:
    type: OS::Nova::Server
    properties:
      image:
        {get_param: Image}
      image_update_policy:
        get_param: ImageUpdatePolicy
      flavor: {get_param: Flavor}
      key_name: {get_param: KeyName}
      networks:
        - network: ctlplane
      user_data_format: SOFTWARE_CONFIG
      user_data: {get_resource: UserData}
      name:
        str_replace:
            template: {get_param: Hostname}
            params: {get_param: HostnameMap}


So as soon as you hit compute 10-19, it will always replace the first part of the string with the first node in the HostnameMap...  The effect here is that you end up with 0-9 at the end of the string instead of having the proper hostname in the HostnameMap.


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


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 1 Steven Hardy 2016-08-31 17:55:40 UTC
I think this is a duplicate of https://bugzilla.redhat.com/show_bug.cgi?id=1353920 ?

Comment 2 David Hill 2016-09-01 16:17:30 UTC
Nope... it's not the same issue.  If the value is to similar to the key, this breaks.  The other case solves one specific corner case but look at this one:

1) When the first compute his deployed, it replaces all the strings in that array so 
  HostnameMap:
    whatever-CTLR0: whatever-CTLR0-wa1614
    whatever-CTLR1: whatever-CTLR1-wa1514
    whatever-CTLR2: whatever-CTLR2-wa0112
    whatever-COMP0: whatever-COMP0-wa0001
    whatever-COMP1: whatever-COMP1-wa1101
    whatever-COMP2: whatever-COMP2-wa0002
    whatever-COMP3: whatever-COMP3-wa1102
    whatever-COMP4: whatever-COMP4-wa0003
    whatever-COMP5: whatever-COMP5-wa1103
    whatever-COMP6: whatever-COMP6-wa0004
    whatever-COMP7: whatever-COMP7-wa1104
    whatever-COMP8: whatever-COMP8-wa0005
    whatever-COMP9: whatever-COMP9-wa1105
    whatever-COMP10: whatever-COMP10-wa0006
    whatever-COMP11: whatever-COMP11-wa1106
    whatever-COMP12: whatever-COMP12-wa0007

becomes:
  HostnameMap:
    whatever-CTLR0: whatever-CTLR0-wa1614
    whatever-CTLR1: whatever-CTLR1-wa1514
    whatever-CTLR2: whatever-CTLR2-wa0112
    whatever-COMP0: whatever-COMP0-wa0001
    whatever-COMP1: whatever-COMP1-wa1101
    whatever-COMP2: whatever-COMP2-wa0002
    whatever-COMP3: whatever-COMP3-wa1102
    whatever-COMP4: whatever-COMP4-wa0003
    whatever-COMP5: whatever-COMP5-wa1103
    whatever-COMP6: whatever-COMP6-wa0004
    whatever-COMP7: whatever-COMP7-wa1104
    whatever-COMP8: whatever-COMP8-wa0005
    whatever-COMP9: whatever-COMP9-wa1105
    whatever-COMP10: whatever-COMP1-wa11010-wa0006
    whatever-COMP11: whatever-COMP1-wa11011-wa1106
    whatever-COMP12: whatever-COMP1-wa11012-wa0007

Comment 7 Zane Bitter 2017-07-28 17:32:37 UTC
Yeah, this is fixed in OSP10 by https://review.openstack.org/#/c/355583/


Note You need to log in before you can comment on or make changes to this bug.