Ask Your Question
0

Configuring Multiple Identical Nova Instances from Heat Template

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

Nastooh gravatar image

Hi
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?

Cheers,

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

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:

  CommonHostDeployment:
    type: OS::Heat::SoftwareDeployments
    properties:
      config: {get_resource: CommonHostConfig}
      servers: {get_attr: [ResourceGroupResource, attributes, nova_server_resource]}
      input_values:
        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

Comments

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:

https://github.com/openstack/heat-tem...

Steve Baker gravatar imageSteve Baker ( 2015-07-06 23:49:52 -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-07-03 17:43:01 -0500

Seen: 2,026 times

Last updated: Jul 05 '15