Angus Salkeld | 406bbd5 | 2015-05-13 14:24:04 +1000 | [diff] [blame] | 1 | heat_template_version: 2013-05-23 |
| 2 | resources: |
| 3 | asg: |
| 4 | type: OS::Heat::AutoScalingGroup |
| 5 | properties: |
| 6 | max_size: 5 |
| 7 | min_size: 1 |
| 8 | resource: |
| 9 | type: OS::Heat::RandomString |
| 10 | scaleup_policy: |
| 11 | type: OS::Heat::ScalingPolicy |
| 12 | properties: |
| 13 | adjustment_type: change_in_capacity |
| 14 | auto_scaling_group_id: {get_resource: asg} |
| 15 | cooldown: 0 |
| 16 | scaling_adjustment: 1 |
| 17 | alarm: |
| 18 | type: OS::Ceilometer::Alarm |
| 19 | properties: |
| 20 | description: Scale-up if the average CPU > 50% for 1 minute |
| 21 | meter_name: test_meter |
| 22 | statistic: count |
| 23 | comparison_operator: ge |
| 24 | threshold: 1 |
| 25 | period: 60 |
| 26 | evaluation_periods: 1 |
| 27 | alarm_actions: |
| 28 | - {get_attr: [scaleup_policy, alarm_url]} |
| 29 | matching_metadata: |
| 30 | metadata.metering.stack_id: {get_param: "OS::stack_id"} |
| 31 | outputs: |
| 32 | asg_size: |
| 33 | value: {get_attr: [asg, current_size]} |