Sample HOT template to create instance group

An example template to create multiple instances.

Change-Id: I7b9314be0d11207c152e2fd8bec4aa7f43b82e9f
This commit is contained in:
Anant Patil 2015-04-20 13:31:33 +05:30
parent a3f38b393e
commit c24e130618
1 changed files with 39 additions and 0 deletions

39
hot/instance_group.yaml Normal file
View File

@ -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] }