[Openstack] [Heat] Template with dynamic instance count?

Steven Hardy shardy at redhat.com
Fri Apr 25 09:50:25 UTC 2014


On Thu, Apr 24, 2014 at 05:03:38PM -0700, Adam Lawson wrote:
> Does Heat support HOT templates where the user can enter the number of
> instances to launch with a specific configuration? I would think so but
> besides not finding anything other than count: <val>, and the fact that the
> resource_id parameter needs to be unique seems to suggest this approach
> isn't how to go about it.

There are a few resources which allow you to do this, the simplest being
OS::Heat::InstanceGroup

http://docs.openstack.org/developer/heat/template_guide/openstack.html#OS::Heat::InstanceGroup

Here's an example of how to use it:

https://github.com/openstack/heat-templates/blob/master/cfn/deb/MultiNode_DevStack.yaml#L119

More recent (Icehouse) versions of heat also have some additional resources
which provide somewhat more flexible (not limited to only Instance
resources and don't rely on the AWS LaunchConfiguration resource)
definition of grouped resources:

http://docs.openstack.org/developer/heat/template_guide/openstack.html#OS::Heat::ResourceGroup

http://docs.openstack.org/developer/heat/template_guide/openstack.html#OS::Heat::AutoScalingGroup

Here's an example HOT template which demonstrates using the native
AutoScalingGroup resource (the static ResourceGroup works in a similar
way):

https://github.com/openstack/heat-templates/blob/master/hot/autoscaling.yaml#L60

Hope that helps,

Steve


> 
> Thoughts?
> .
> 
> *Adam Lawson*
> AQORN, Inc.
> 427 North Tatnall Street
> Ste. 58461
> Wilmington, Delaware 19801-2230
> Toll-free: (844) 4-AQORN-NOW
> Direct: +1 (302) 268-6914

> _______________________________________________
> Mailing list: http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack
> Post to     : openstack at lists.openstack.org
> Unsubscribe : http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack


-- 
Steve Hardy
Red Hat Engineering, Cloud




More information about the Openstack mailing list