Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

SoftwareDeployment does not provision user data

Hello,

For the following heat template, the SoftwareDeployment does not provision the user data:

heat_template_version: 2015-10-15

resources:

  server:
    type: OS::Nova::Server
    properties:
      config_drive: "true"
      name: test
      image: some_image
      flavor: some_flavor
      key_name: key
      user_data_format: SOFTWARE_CONFIG
      networks:
       - port: { get_resource: some_port }
    metadata:
      os-collect-config:
        collectors:
          - heat_local
        polling_interval: 60

  some_port:
    type: OS::Neutron::Port
    properties:
      network_id: some_network
      fixed_ips:
        - subnet_id: some_subnet

  config:
    type: OS::Heat::SoftwareConfig
    properties:
      group: script
      config: |
        #!/bin/bash
        echo "one" > /tmp/one

  deployment:
    type: OS::Heat::SoftwareDeployment
    properties:
      config:
        get_resource: config
      server:
        get_resource: server
      signal_transport: NO_SIGNAL

All resources are successfully created

| config        | 43a7b6b7-1f56-4034-8d88-429fd6f8ff8a | OS::Heat::SoftwareConfig     | CREATE_COMPLETE | 2016-09-05T15:43:20 |
| deployment    | d061caa9-8101-4414-b97c-f956ccd622bd | OS::Heat::SoftwareDeployment | CREATE_COMPLETE | 2016-09-05T15:43:20 |
| some_port     | 84bdac40-34dc-4098-9e3e-75d87f4aa72c | OS::Neutron::Port            | CREATE_COMPLETE | 2016-09-05T15:43:20 |
| server        | 51c53179-60f1-4261-8951-8748e8ad43da | OS::Nova::Server             | CREATE_COMPLETE | 2016-09-05T15:43:20 |

But the user data on the VM is empty. I'm logging to the VM and mounting the cdrom (that is the config drive where metadata is mapped)

# mount /dev/sr0 /mnt/
# cat /mnt/openstack/latest/user_data
.....
--===============3431605606305300090==
Content-Type: text/x-shellscript; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="userdata"

...