-
Notifications
You must be signed in to change notification settings - Fork 5
/
autoscaling.yaml
64 lines (61 loc) · 1.69 KB
/
autoscaling.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
heat_template_version: 2015-10-15
description: >
Example of using monasca resources for auto-scale testing. In this template,
sample scale-group is created with given nova instance to auto-scale
when cpu utilization varies between 15 to 50 percent for 3 times consequently.
parameters:
flavor:
type: string
description: Flavor for the instances to be created
default: m1.nano
image:
type: string
description: Name or ID of the image to use for the instances.
default: cirros-0.4.0-x86_64-disk
resources:
group:
type: ##FILLHERE##
properties:
cooldown: 60
desired_capacity: ##FILLHERE##
max_size: ##FILLHERE##
min_size: 1
resource:
type: OS::Nova::Server
properties:
flavor: { get_param: flavor }
image: { get_param: image }
metadata : {"scale_group": {get_param: "OS::stack_id"}}
networks:
- network: private
security_groups:
- testvm
# scale_up_policy:
#
# scale_down_policy:
#
# up_notification:
# type:
# properties:
# type:
# address: {get_attr: [scale_up_policy, alarm_url]}
#
# down_notification:
# type:
# properties:
# type:
# address: {get_attr: [scale_down_policy, alarm_url]}
#
# cpu_alarm_high:
# ##FILLHERE##
# str_replace:
# template: avg(cpu.utilization_perc{scale_group=##FILLHERE##}) > 50 times 3
# params:
# ##FILLHERE##: {get_param: "OS::stack_id"}
#
# cpu_alarm_low:
# ##FILLHERE##
# str_replace:
# template: avg(cpu.utilization_perc{scale_group=##FILLHERE##}) < 15 times 3
# params:
# ##FILLHERE##: {get_param: "OS::stack_id"}