Ask Your Question

Configuring Multiple Identical Nova Instances from Heat Template

asked 2015-07-03 17:43:01 -0500

Nastooh gravatar image

Created multiple identical instances, through OS::Heat::ResourceGroup. Within each instance, I am able to apply instance specific configuration, via user_data, e.g. record creation time, instance number, etc. However, after all instances are created, would like to apply global configuration to all instances, e.g., common host file. Is this possible?
I suppose a workaround would be to instantiate a short-live node that would do the configuration through ssh; however, if possible, would like to avoid this.

Any thoughts?


edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2015-07-05 17:11:08 -0500

Steve Baker gravatar image

updated 2015-07-05 17:11:54 -0500

For the following advice it is assumed you have read all of the software configuration chapter of heat's template guide and built a custom image containing the heat agent projects:

The resource OS::Heat::SoftwareDeployments allows you to apply a particular config to every server in a resource group.

It is good practice to create a nested stack and put the OS::Nova::Server resource in that rather than putting the OS::Nova::Server resource directly in the resource group definition. So assuming your resource group has a nested stack which is producing an output/attribute called nova_server_resource, and another output called nova_server_name_ip, you can create the following deployments resource:

    type: OS::Heat::SoftwareDeployments
      config: {get_resource: CommonHostConfig}
      servers: {get_attr: [ResourceGroupResource, attributes, nova_server_resource]}
        hosts: {get_attr: [ResourceGroupResource, attributes, nova_server_name_ip]}

You would need to write the script which takes the hosts data and writes out the hosts file, and include it in your template with a OS::Heat::SoftwareConfig resource called CommonHostConfig.

(Note, in Liberty the type OS::Heat::SoftwareDeployments has been renamed to OS::Heat::SoftwareDeploymentGroup, and the old name is deprecated even though it still works, so this reference documentation can still be followed )

edit flag offensive delete link more


Thank you for your reply. Are SoftwareDeployments and SoftwareConfig applicable to docker instances as well?

Nastooh gravatar imageNastooh ( 2015-07-06 23:32:17 -0500 )edit

You'll need to clarify what you mean, but you can use our docker-compose hook to define config resources which describe docker-compose yaml:

Steve Baker gravatar imageSteve Baker ( 2015-07-06 23:49:52 -0500 )edit

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower


Asked: 2015-07-03 17:43:01 -0500

Seen: 2,362 times

Last updated: Jul 05 '15