autoscaling: Remove usage of deprecated Ceilometer API

This removes usage of deprecated Ceilometer API from the hot tempaltes
Marks as deprecated the cfn template.

This doesn't update the openshift, mistral, senlin
autoscaling/autohealing templates. Mainly because I don't have the
knowledge to change where the custom metrics are send from
Ceilometer-API to Gnocchi API.

Change-Id: I4a617daf063fb1faf01c71762d6509cb00eed0b6
This commit is contained in:
Mehdi Abaakouk 2017-05-18 07:44:21 +02:00
parent 6d2659b468
commit de990777bd
2 changed files with 32 additions and 18 deletions

View File

@ -1,5 +1,5 @@
HeatTemplateFormatVersion: '2012-12-12' HeatTemplateFormatVersion: '2012-12-12'
Description: Creates an autoscaling wordpress application using Ceilometer. Description: Creates an autoscaling wordpress application using deprecated Ceilometer API.
Parameters: Parameters:
KeyName: KeyName:
Description: Name of an existing EC2 KeyPair to enable SSH access to the instances Description: Name of an existing EC2 KeyPair to enable SSH access to the instances

View File

@ -114,31 +114,45 @@ resources:
cooldown: 60 cooldown: 60
scaling_adjustment: -1 scaling_adjustment: -1
cpu_alarm_high: cpu_alarm_high:
type: OS::Ceilometer::Alarm type: OS::Aodh::GnocchiAggregationByResourcesAlarm
properties: properties:
description: Scale-up if the average CPU > 50% for 1 minute description: Scale up if CPU > 80%
meter_name: cpu_util metric: cpu_util
statistic: avg aggregation_method: mean
period: 60 granularity: 300
evaluation_periods: 1 evaluation_periods: 1
threshold: 50 threshold: 80
alarm_actions: resource_type: instance
- {get_attr: [web_server_scaleup_policy, alarm_url]}
matching_metadata: {'metadata.user_metadata.stack': {get_param: "OS::stack_id"}}
comparison_operator: gt comparison_operator: gt
alarm_actions:
- str_replace:
template: trust+url
params:
url: {get_attr: [scaleup_policy, signal_url]}
query:
list_join:
- ''
- - {'=': {server_group: {get_param: "OS::stack_id"}}}
cpu_alarm_low: cpu_alarm_low:
type: OS::Ceilometer::Alarm type: OS::Aodh::GnocchiAggregationByResourcesAlarm
properties: properties:
description: Scale-down if the average CPU < 15% for 10 minutes description: Scale down if CPU < 15% for 5 minutes
meter_name: cpu_util metric: cpu_util
statistic: avg aggregation_method: mean
period: 600 granularity: 300
evaluation_periods: 1 evaluation_periods: 1
threshold: 15 threshold: 15
alarm_actions: resource_type: instance
- {get_attr: [web_server_scaledown_policy, alarm_url]}
matching_metadata: {'metadata.user_metadata.stack': {get_param: "OS::stack_id"}}
comparison_operator: lt comparison_operator: lt
alarm_actions:
- str_replace:
template: trust+url
params:
url: {get_attr: [scaleup_policy, signal_url]}
query:
list_join:
- ''
- - {'=': {server_group: {get_param: "OS::stack_id"}}}
monitor: monitor:
type: OS::Neutron::HealthMonitor type: OS::Neutron::HealthMonitor
properties: properties: