Alex | 17e4a59 | 2021-07-13 15:59:33 -0500 | [diff] [blame] | 1 | heat_template_version: 2016-10-14 |
| 2 | description: A simple auto scaling group. |
| 3 | |
| 4 | resources: |
| 5 | group: |
| 6 | type: OS::Heat::AutoScalingGroup |
| 7 | properties: |
| 8 | cooldown: 60 |
| 9 | desired_capacity: 2 |
| 10 | max_size: 5 |
| 11 | min_size: 1 |
| 12 | resource: |
| 13 | type: OS::Nova::Server::Ubuntu |
| 14 | properties: |
| 15 | metadata: {"metering.server_group": {get_param: "OS::stack_id"}} |
| 16 | |
| 17 | scaleup_policy: |
| 18 | type: OS::Heat::ScalingPolicy |
| 19 | properties: |
| 20 | adjustment_type: change_in_capacity |
| 21 | auto_scaling_group_id: { get_resource: group } |
| 22 | cooldown: 60 |
| 23 | scaling_adjustment: 1 |
| 24 | |
| 25 | cpu_alarm_high: |
| 26 | type: OS::Aodh::GnocchiAggregationByResourcesAlarm |
| 27 | properties: |
| 28 | description: Scale up if CPU time spent >10000 ns |
| 29 | metric: cpu |
| 30 | aggregation_method: mean |
| 31 | granularity: 60 |
| 32 | evaluation_periods: 1 |
| 33 | threshold: 10000 |
| 34 | resource_type: instance |
| 35 | comparison_operator: gt |
| 36 | alarm_actions: |
| 37 | - str_replace: |
| 38 | template: trust+url |
| 39 | params: |
| 40 | url: {get_attr: [scaleup_policy, signal_url]} |
| 41 | query: |
| 42 | list_join: |
| 43 | - '' |
| 44 | - - {'=': {server_group: {get_param: "OS::stack_id"}}} |
| 45 | |
| 46 | outputs: |
| 47 | scaleup_policy_signal_url: |
Alex | e4772c2 | 2021-07-14 09:09:23 -0500 | [diff] [blame] | 48 | value: {get_attr: [ scaleup_policy, signal_url ]} |