-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathautoscale-heat-stack.yaml
81 lines (75 loc) · 2.01 KB
/
autoscale-heat-stack.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
heat_template_version: 2015-10-15
description: template to autoscale a simple instance
parameters:
server_image:
type: string
label: Image name or ID
description: Image to be used for compute instance
default: cirros
server_flavor:
type: string
label: Flavor
description: Type of flavor to be used
default: small
server_key:
type: string
label: Key name
description: Name of key-pair to be used for compute instance
default: demokey
server_network:
type: string
label: Private network name or ID
description: Network to attach instance to.
default: tenant-network
resources:
group:
type: OS::Heat::AutoScalingGroup
properties:
cooldown: 60
desired_capacity: 1
max_size: 5
min_size: 1
resource:
type: OS::Nova::Server
properties:
image: { get_param: server_image }
flavor: { get_param: server_flavor }
key_name: { get_param: server_key }
networks:
- network: { get_param: server_network }
scaleup_policy:
type: OS::Heat::ScalingPolicy
properties:
adjustment_type: change_in_capacity
auto_scaling_group_id: { get_resource: group }
cooldown: 60
scaling_adjustment: 1
scaledown_policy:
type: OS::Heat::ScalingPolicy
properties:
adjustment_type: change_in_capacity
auto_scaling_group_id: { get_resource: group }
cooldown: 60
scaling_adjustment: -1
cpu_alarm_high:
type: OS::Ceilometer::Alarm
properties:
meter_name: cpu_util
statistic: avg
period: 600
evaluation_periods: 1
threshold: 75
alarm_actions:
- {get_attr: [scaleup_policy, alarm_url]}
comparison_operator: gt
cpu_alarm_low:
type: OS::Ceilometer::Alarm
properties:
meter_name: cpu_util
statistic: avg
period: 600
evaluation_periods: 1
threshold: 25
alarm_actions:
- {get_attr: [scaledown_policy, alarm_url]}
comparison_operator: lt