From c24e130618bb6aa15baf2aaed0d9648c03ee85ed Mon Sep 17 00:00:00 2001 From: Anant Patil Date: Mon, 20 Apr 2015 13:31:33 +0530 Subject: [PATCH] Sample HOT template to create instance group An example template to create multiple instances. Change-Id: I7b9314be0d11207c152e2fd8bec4aa7f43b82e9f --- hot/instance_group.yaml | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 hot/instance_group.yaml diff --git a/hot/instance_group.yaml b/hot/instance_group.yaml new file mode 100644 index 00000000..6aa42edd --- /dev/null +++ b/hot/instance_group.yaml @@ -0,0 +1,39 @@ +heat_template_version: 2013-05-23 +description: > + Template to create multiple instances. + +parameters: + image_id: + type: string + description: Image used for servers + key_name: + type: string + description: Name of SSH key to connect to the servers + instance_type: + type: string + description: flavor used by the servers + default: m1.small + constraints: + - custom_constraint: nova.flavor + num_instances: + type: number + description: Number of instances to create + default: 1 + +resources: + server_group: + type: OS::Heat::InstanceGroup + properties: + LaunchConfigurationName: { get_resource: server_config } + AvailabilityZones: [] + Size: { get_param: num_instances } + server_config: + type: AWS::AutoScaling::LaunchConfiguration + properties: + ImageId: { get_param: image_id } + InstanceType: { get_param: instance_type} + KeyName: { get_param: key_name } + +outputs: + server_group_addresses: + value: { get_attr: [server_group, InstanceList] }