Resource Group nested stacks do not have index_var substituted

Bug #1503096 reported by Chris Buccella
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Heat
Invalid
Undecided
Unassigned

Bug Description

To recreate:

aserver.yaml:
    heat_template_version: 2015-04-30

    resources:
      instance:
        type: OS::Nova::Server
        properties:
          name: my_server_%index%
          image: cirros
          flavor: m1.tiny

recreate.yaml:
    heat_template_version: 2015-04-30

    resources:
      rg:
        type: OS::Heat::ResourceGroup
        properties:
          count: 3
          resource_def: {type: aserver.yaml}

Creating a stack using recreate.yaml results in 3 servers all named "my_sever_%index%".

This might be the same cause of #1470614; not sure

Revision history for this message
Steve Baker (steve-stevebaker) wrote :

I don't think it is expected for index_var substitutions happening inside the template resource, only in the resource group itself. So you should do something like:

aserver.yaml:
    heat_template_version: 2015-04-30
    parameters:
      server_name:
        type: string

    resources:
      instance:
        type: OS::Nova::Server
        properties:
          name: {get_param: server_name}
          image: cirros
          flavor: m1.tiny

recreate.yaml:
    heat_template_version: 2015-04-30

    resources:
      rg:
        type: OS::Heat::ResourceGroup
        properties:
          count: 3
          resource_def:
            type: aserver.yaml
            properties:
              server_name: my_server_%index%

Changed in heat:
status: New → Invalid
Revision history for this message
Chris Buccella (chris-buccella) wrote :

Works for me. Thanks for the quick response.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.