From 18e871ba58697e651f8036cae4d41f631cf218d8 Mon Sep 17 00:00:00 2001 From: Vu Tran Date: Wed, 14 May 2014 16:11:41 -0400 Subject: heat: add example hot templates Add 2 hot templates which can be used to create heat stack for demonstrating heat stack lifecycle management and autoscaling Signed-off-by: Vu Tran --- .../python-heat/autoscaling_example.template | 66 ++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 meta-openstack/recipes-devtools/python/python-heat/autoscaling_example.template (limited to 'meta-openstack/recipes-devtools/python/python-heat/autoscaling_example.template') diff --git a/meta-openstack/recipes-devtools/python/python-heat/autoscaling_example.template b/meta-openstack/recipes-devtools/python/python-heat/autoscaling_example.template new file mode 100644 index 0000000..6391187 --- /dev/null +++ b/meta-openstack/recipes-devtools/python/python-heat/autoscaling_example.template @@ -0,0 +1,66 @@ +heat_template_version: 2014-05-06 +description: AutoScaling +parameters: + instance_type: + type: string + description: Type of the instance to be created. + default: m1.tiny + constraints: + - allowed_values: [m1.tiny, m1.small, m1.medium, m1.large] + description: + Value must be one of 'm1.tiny', 'm1.small', 'm1.medium' or 'm1.large'. + image_id: + type: string + description: ID of the image to use for the instance to be created. + default: myfirstimage +resources: + web_server_group_launch_conf: + type: AWS::AutoScaling::LaunchConfiguration + properties: + ImageId: { get_param: image_id } + InstanceType: { get_param: instance_type } + server_group: + type: AWS::AutoScaling::AutoScalingGroup + properties: + AvailabilityZones: ["RegionOne"] + MinSize: '1' + MaxSize: '3' + LaunchConfigurationName: {get_resource: web_server_group_launch_conf} + web_server_scaleup_policy: + type: AWS::AutoScaling::ScalingPolicy + properties: + AdjustmentType: ChangeInCapacity + AutoScalingGroupName: {get_resource: server_group} + Cooldown: 60 + ScalingAdjustment: 1 + web_server_scaledown_policy: + type: AWS::AutoScaling::ScalingPolicy + properties: + AdjustmentType: ChangeInCapacity + AutoScalingGroupName: {get_resource: server_group} + Cooldown: 60 + ScalingAdjustment: -1 + cpu_alarm_high: + type: OS::Ceilometer::Alarm + properties: + description: Scale-up if the average CPU > 80% for 5 minute + meter_name: cpu_util + statistic: avg + period: '300' + evaluation_periods: '1' + threshold: '80' + alarm_actions: + - {get_attr: [web_server_scaleup_policy, AlarmUrl]} + comparison_operator: gt + cpu_alarm_low: + type: OS::Ceilometer::Alarm + properties: + description: Scale-down if the average CPU < 45% for 2 minutes + meter_name: cpu_util + statistic: avg + period: '120' + evaluation_periods: '1' + threshold: '45' + alarm_actions: + - {get_attr: [web_server_scaledown_policy, AlarmUrl]} + comparison_operator: lt -- cgit v1.2.3-54-g00ecf