e4062f3146
Now Ceilometer does not support cpu_util metric. Thats why it was needed to rewrite existing test_autoscaling to use another metric (network.incoming.bytes). Change-Id: I2cfda7624c9736e68d1d2fde4cdc37457cf5a593 Closes-bug:#1538166
72 lines
1.9 KiB
YAML
72 lines
1.9 KiB
YAML
heat_template_version: 2013-05-23
|
|
|
|
parameters:
|
|
KeyName:
|
|
type: string
|
|
InstanceType:
|
|
type: string
|
|
ImageId:
|
|
type: string
|
|
SecurityGroup:
|
|
type: string
|
|
|
|
resources:
|
|
my_asg:
|
|
type: OS::Heat::AutoScalingGroup
|
|
properties:
|
|
resource:
|
|
type: OS::Nova::Server
|
|
properties:
|
|
metadata: {"metering.stack": {get_param: "OS::stack_id"}}
|
|
key_name: { get_param: KeyName }
|
|
image: { get_param: ImageId }
|
|
flavor: { get_param: InstanceType }
|
|
security_groups:
|
|
- get_param: SecurityGroup
|
|
min_size: 1
|
|
max_size: 3
|
|
|
|
scale_up_policy:
|
|
type: OS::Heat::ScalingPolicy
|
|
properties:
|
|
adjustment_type: change_in_capacity
|
|
auto_scaling_group_id: {get_resource: my_asg}
|
|
cooldown: 60
|
|
scaling_adjustment: 2
|
|
|
|
scale_down_policy:
|
|
type: OS::Heat::ScalingPolicy
|
|
properties:
|
|
adjustment_type: change_in_capacity
|
|
auto_scaling_group_id: {get_resource: my_asg}
|
|
cooldown: 60
|
|
scaling_adjustment: '-1'
|
|
|
|
cpu_alarm_high:
|
|
type: OS::Ceilometer::Alarm
|
|
properties:
|
|
description: Scale-up if count of instance <= 1 for 1 minute
|
|
meter_name: network.incoming.bytes
|
|
statistic: count
|
|
period: 60
|
|
evaluation_periods: 1
|
|
threshold: 1
|
|
alarm_actions:
|
|
- {get_attr: [scale_up_policy, alarm_url]}
|
|
matching_metadata: {'metadata.user_metadata.stack': {get_param: "OS::stack_id"}}
|
|
comparison_operator: le
|
|
|
|
cpu_alarm_low:
|
|
type: OS::Ceilometer::Alarm
|
|
properties:
|
|
description: Scale-down if maximum count of instance > 2 for 1 minutes
|
|
meter_name: network.incoming.bytes
|
|
statistic: count
|
|
period: 60
|
|
evaluation_periods: 1
|
|
threshold: 2
|
|
alarm_actions:
|
|
- {get_attr: [scale_down_policy, alarm_url]}
|
|
matching_metadata: {'metadata.user_metadata.stack': {get_param: "OS::stack_id"}}
|
|
comparison_operator: gt
|