Heat: How to delete instance every 5 minutes ?
For the realization of auto-scaling I made a template with heat and I've got e little problem. It works well but my heat template delete 1 instance after 5 minutes and not 1 instance every 5 minutes. How to do that ?
here is my tempalte.
heat_template_version: 2014-10-16
description: A simple auto scaling group.
resources:
group:
type: OS::Heat::AutoScalingGroup
properties:
desired_capacity: 1
max_size: 5
min_size: 1
resource:
type: OS::Nova::Server::Cirros
scaleup_policy:
type: OS::Heat::ScalingPolicy
properties:
adjustment_type: change_in_capacity
auto_scaling_group_id: { get_resource: group }
cooldown: 60
scaling_adjustment: 2
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:
description: Scale-up if the average CPU > 50% for 1 minute
meter_name: cpu_util
statistic: avg
period: 60
evaluation_periods: 1
threshold: 50
alarm_actions:
- {get_attr: [scaleup_policy, alarm_url]}
comparison_operator: gt
cpu_alarm_low:
type: OS::Ceilometer::Alarm
properties:
description: Scale-down if the average CPU < 20% for 5 minutes
meter_name: cpu_util
statistic: avg
period: 300
evaluation_periods: 1
threshold: 20
alarm_actions:
- {get_attr: [scaledown_policy, alarm_url]}
comparison_operator: lt
Could you please clarify your problem? The following is unclear.
"It works well but my heat template delete 1 instance after 5 minutes and not 1 instance every 5 minutes. How to do that ?"
Heat create 2 instances when the average CPU > 50% and if CPU stay above 50% my template still create instances. But when the average CPU < 20% heat delete only 1 instance after 5min and nothing more. Below 20% I'd like to delete 1 instance every 5 min not just 1. What's wrong on my template ?