[Heat] How to use meta-data exchange in Heat

asked 2014-03-25 09:32:44 -0600

andreas gravatar image

updated 2014-03-25 09:41:32 -0600

Hi there,

i'd like to use the meta-data service of heat to let two nodes exchange data.

My Scenario
1. server-i writes meta-data.
2. server-ii reads that meta-data and echos it during its cloud-init execution.

Therefore, I am looking for a tag similar to get_attr: to accomplish this.

My ideal understanding is something like this:

heat_template_version: "2013-05-23"
      a: test-value
      flavor: "6"
      image: F17-i386-cfntools
      key_name: test-key
      user_data: |
          echo 'Start-Test'
          echo 'End-Test'
    type: "OS::Nova::Server"

      flavor: "6"
      image: F17-i386-cfntools
      key_name: test-key
          template: |
            echo 'Start-Test'
            echo test-value
            echo 'End-Test'
           test-value: { get_metadata: [server-i, a] }
    type: "OS::Nova::Server"

I am looking for the correct syntax for the params line in the server-ii definition element.
Therefore: How can one accomplish the above described scenario with Heat/Hot?


edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2014-04-23 12:01:05 -0600

zaneb gravatar image

I'm not 100% sure how to interpret your question... you say you want the nodes to exchange data, but in your example the data is already predefined in the template, just in a different resource.

I think what you mean is that you want the user_data script on server-i to produce some data that is then passed to the user-data script on server-ii. This is already supported, but in a non-obvious way and not using metadata. The way to do it is with a WaitCondition - server-i's user_data script can post some data to the WaitConditionHandle, which server-ii can then retrieve using get_attr on the WaitCondition.

edit flag offensive delete link more

Get to know Ask OpenStack

Resources for moderators

Question Tools



Asked: 2014-03-25 09:32:44 -0600

Seen: 628 times

Last updated: Apr 23 '14