"Layered" MultipartMime for user_data no longer works

Bug #1306036 reported by Steve Lipinski
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Heat
Expired
Undecided
Unassigned

Bug Description

Trying to have Nested MultipartMime resources like the server_init resource in the following example no longer works:

https://github.com/openstack/heat-templates/blob/master/hot/software-config/example-cloud-init.yaml

The referenced resource:
      - config: {get_resource: three_four_init}
        type: multipart

does not seem to be included anymore.

Changed in heat:
status: New → Invalid
status: Invalid → Incomplete
Revision history for this message
Steve Lipinski (steve-lipinski) wrote :

This template copied directly from the example:
heat_template_version: 2013-05-23
description: >
  This template demonstrates the different ways configuration resources
  can be used to specify boot-time cloud-init configuration.
parameters:
  key_name:
    type: string
  flavor:
    type: string
  image:
    type: string

resources:
  the_sg:
    type: OS::Neutron::SecurityGroup
    properties:
      name: the_sg
      description: Ping and SSH
      rules:
      - protocol: icmp
      - protocol: tcp
        port_range_min: 22
        port_range_max: 22

  one_init:
    type: OS::Heat::CloudConfig
    properties:
      cloud_config:
        write_files:
        - path: /tmp/one
          content: "The one is bar"

  five_init:
    # this resource demonstrates multiple cloud-config resources
    # with a merge_how strategy
    type: OS::Heat::CloudConfig
    properties:
      cloud_config:
        merge_how: 'dict(recurse_array,no_replace)+list(append)'
        write_files:
        - path: /tmp/five
          content: "The five is bar"

  two_init:
    # this resource is a simple shell script. No inputs or outputs are
    # specified since this is not supported by cloud-init but values
    # could be inserted into the script using str_replace.
    type: OS::Heat::SoftwareConfig
    properties:
      group: ungrouped
      config: |
        #!/bin/sh
        echo "The two is bar" > /tmp/two

  three_init:
    type: OS::Heat::SoftwareConfig
    properties:
      group: ungrouped
      config: |
        #!/bin/sh
        echo "The three is bar" > /tmp/three

  four_init:
    type: OS::Heat::SoftwareConfig
    properties:
      group: ungrouped
      config: |
        #!/bin/sh
        echo "The four is bar" > /tmp/four

  three_four_init:
    type: OS::Heat::MultipartMime
    properties:
      parts:
      - config: {get_resource: three_init}
      - config: {get_resource: four_init}

  server_init:
    type: OS::Heat::MultipartMime
    properties:
      parts:
      - config: {get_resource: one_init}
      - config: {get_resource: two_init}
        # referencing another OS::Heat::MultipartMime resource will result
        # in each part of that resource being appended to this one.
      - config: {get_resource: three_four_init}
        type: multipart
      - config: {get_resource: five_init}

  server:
    type: OS::Nova::Server
    properties:
      image: {get_param: image}
      flavor: {get_param: flavor}
      key_name: {get_param: key_name}
      security_groups:
      - {get_resource: the_sg}
      user_data_format: RAW
      user_data:
        get_resource: server_init

Does not work.

/tmp/three and /tmp/four are not created:
# ls /tmp
five one two

I have seen similar with other templates I have created.
If in include a OS::Heat::MultipartMime resource within another OS::Heat::MultipartMime resource as in:
  server_init:
    type: OS::Heat::MultipartMime
    properties:
      parts:
..
      - config: {get_resource: three_four_init}
        type: multipart
..

The three_four_init resource does not seem to get included.

Changed in heat:
status: Incomplete → New
Revision history for this message
Steve Baker (steve-stevebaker) wrote :

interesting, that is the same template which works for me. Can you please attach the contents of this file on the created server?

/var/lib/cloud/instance/user-data.txt (my guess is that the parts will be there, but will contain {get_resource...} instead of the script)

Revision history for this message
Steve Lipinski (steve-lipinski) wrote :

Here is the user-data.txt.

Seems 3 and 4 are missing altogether.

Revision history for this message
Steve Lipinski (steve-lipinski) wrote :

That was with this:
    type: OS::Heat::MultipartMime
    properties:
      parts:
        - config: {get_resource: one_init}
        - config: {get_resource: two_init}
        - config: {get_resource: three_four_init}
          type: multipart
        - config: {get_resource: five_init}

Changed in heat:
status: New → Triaged
Revision history for this message
Steve Baker (steve-stevebaker) wrote :

I still can't reproduce this with current heat master. Could you please reproduce again and state what version of heat you have installed?

Changed in heat:
status: Triaged → Incomplete
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for heat because there has been no activity for 60 days.]

Changed in heat:
status: Incomplete → Expired
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.