2

I am trying customise new instances created within openstack mikata, using HEAT templates. Using OS::Nova::Server with a script in user_data works fine.

Next the idea is to do additional steps via OS::Heat::SoftwareConfig. The config is:

type: OS::Nova::Server
....
  user_data_format: SOFTWARE_CONFIG
  user_data:
    str_replace:
      template:
        get_file: vm_init1.sh


config1:
    type: OS::Heat::SoftwareConfig
    depends_on: vm
    properties:
      group: script
      config: |
        #!/bin/bash
        echo "Running $0 OS::Heat::SoftwareConfig look in /var/tmp/test_script.log" | tee /var/tmp/test_script.log

  deploy:
    type: OS::Heat::SoftwareDeployment
    properties:
      config:
        get_resource: config1
      server:
        get_resource: vm

The instance is setup nicely (the script vm_init1.sh above runs fine) and one can login, but he "config1" example above is never executed.

Analysis - The base image is Ubuntu 16.04, created with disk-image-create and including "vm ubuntu os-collect-config os-refresh-config os-apply-config heat-config heat-config-script" - From "openstack stack resource list $vm" one see that deployment never fisnihe, with OS::Heat::SoftwareDeployment status=CREATE_IN_PROGRESS - "openstack stack resource show $vm config1" shows resource_status=CREATE_COMPLETE - Within the vm, /var/log/cloud-init-output.log shows the output of the script vm_init1.sh, but no trace of the 'config1' script. The log os-apply-config.log is empty, is that normal?

How does one troubleshoot OS::Heat::SoftwareDeployment configs?

(I have read https://docs.openstack.org/developer/heat/template_guide/software_deployment.html#software-deployment-resources)

boran
  • 361
  • 2
  • 7

0 Answers0