Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

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

click to hide/show revision 2
No.2 Revision

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

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

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

-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

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

lt