Ask Your Question
1

heat SoftwareDeployment executed twice when depends_on property used

asked 2015-02-05 08:25:05 -0500

ZJ gravatar image

Hi,

I noticed the following problem with software deplotment resources dependency (I'm working on Juno 2014.1).

When I create softwareDeployment resources which depends on each other (defined by "depends_on" property"), e.g.:

  config:
    type: OS::Heat::SoftwareConfig
    properties:
      group: script
      config:
          get_file: python_script

  deployment:
    type: OS::Heat::SoftwareDeployment
    properties:
      config: { get_resource: config }
      server: { get_resource: server }
      signal_transport: CFN_SIGNAL

  config_2:
    type: OS::Heat::SoftwareConfig
    properties:
      group: script
      config: |
        #!/bin/bash
        echo "BASH" >> /var/tmp/bash.out


  deployment_2:
    type: OS::Heat::SoftwareDeployment
    properties:
      config: { get_resource: config_2 }
      server: { get_resource: server }
      signal_transport: CFN_SIGNAL
    depends_on: deployment

First deploment is executed twice. I saw in /var/run/heat-config that "inputs" are duplicated (two records for "deployment"), I suppose this is the reason but i don't know if it is caused by incorrect configuration or there is some other reason. Any ideas?

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted
1

answered 2015-02-15 23:20:43 -0500

Steve Baker gravatar image

If you update your heat-templates from git and rebuild your custom image then this issue should no longer be a problem.

It was fixed in this heat-templates change

edit flag offensive delete link more

Comments

Steve, thank You! Could you just confirm that the only change was made in "55-heat-config" file (I'm not using disk image builder so such information can be very useful for me)?

ZJ gravatar imageZJ ( 2015-02-16 01:44:53 -0500 )edit

I tested new version but I noticed that already deployed configs are never executed again. I think they should be executed if "SoftwareDeployment" action is "UPDATE" every time when stack-update is executed, am I wrong? I created stack - configs executed, I called stack-update - configs not executed

ZJ gravatar imageZJ ( 2015-04-03 08:50:30 -0500 )edit

Summarry: I would like execute two software deployments every time when I call heat stack-update. Second deployment waits until first is completed until executes. I would like to execute each deployment only once in single heat stack-update call.

ZJ gravatar imageZJ ( 2015-04-03 08:57:41 -0500 )edit

A deployment will only be re-executed if something changes in the config or deployment resource definitions when you run stack-update.

If you want to re-trigger the deployment on every stack-update then you will need to:

Steve Baker gravatar imageSteve Baker ( 2015-04-06 15:33:55 -0500 )edit
  1. add a parameter to the stack and get_param that parameter somewhere in your deployment resource (eg, input_values)
  2. pass a unique value (such as a timestamp) to that parameter whenever you call stack-update.

This also gives you the flexibility to not retrigger on a stack-update, if desired

Steve Baker gravatar imageSteve Baker ( 2015-04-06 15:36:28 -0500 )edit
0

answered 2015-02-15 08:02:28 -0500

Qiming gravatar image

That behavior was intended. The design philosophy was to make SoftwareConfig executions idempotent. If you are using a latest version of Heat, the behavior may change. Each SoftwareDeployment may be executed exactly once if the referenced SoftwareConfig, inputs, environments have not changed.

edit flag offensive delete link more

Comments

Is there a way to avoid such behaviour? I would like to execute few deployments in specified order but each of them should be executed only once.

ZJ gravatar imageZJ ( 2015-02-15 14:19:31 -0500 )edit

The easiest way to avoid that would be detect the script execution your self. Leave a trace somewhere if it has been executed. Detect that trace when starting to execute your script.

Qiming gravatar imageQiming ( 2015-02-15 19:28:46 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2015-02-05 08:25:05 -0500

Seen: 590 times

Last updated: Feb 15 '15