[Openstack] [Heat/Ceilometer/Havana]: Auto scaling, alarm_actions, alarm notifications
Jay Cromer
jcromer at hotmail.com
Tue Apr 1 03:49:16 UTC 2014
Hello all,
I am running Havana on Ubuntu 12.04. I have created a template which creates a stack that autoscales based on cpu utilization. I am able to successfully create the stack thru Horizon by importing a template that I have created. The problem is my alarm action is not working properly. In the ceiloemeter-alarm-notifier log I am seeing the following errror: 2014-03-27 21:56:14.617 11258 ERROR ceilometer.alarm.service [req-94c6c466-760d-4b63-a186-a994bcb881ce None None] Action for alarm 636a4dc3-a15d-4093-97a8-d4e9f6c50cf4 is unknown, cannot notifyIt appears that this is the code from service.py that is generating the error in the logfile:try:
notifier = self.notifiers[action.scheme].obj
except KeyError:
scheme = action.scheme
LOG.error(
_("Action %(scheme)s for alarm %(alarm_id)s is unknown, "
"cannot notify"),
{'scheme': scheme, 'alarm_id': alarm_id})
returnI freely admit I am no python expert and was able to find this bit of code thru some searching of the repository.My Template is as follows: HeatTemplateFormatVersion: '2012-12-12'
Description: Autoscaling demo using Ceilometer.
Parameters:
KeyName:
Description: Name of an existing EC2 KeyPair to enable SSH access to the instances
Type: String
InstanceType:
Description: WebServer EC2 instance type
Type: String
Default: m1.small
AllowedValues: [m1.tiny, m1.small, m1.medium, m1.large, m1.xlarge]
ConstraintDescription: must be a valid EC2 instance type.
ImageId:
Description: the name or uuid of the image in glance
Type: String
Default: d947c1fa-6099-4a02-914e-0cc74f79bbce
Resources:
Group_A:
Type: AWS::AutoScaling::AutoScalingGroup
Properties:
AvailabilityZones: {'Fn::GetAZs': ''}
LaunchConfigurationName: {Ref: LaunchConfig}
MinSize: '1'
MaxSize: '4'
VPCZoneIdentifier: [5b17524d-8483-48d2-836f-00124e1ca64d]
WebServerScaleUpPolicy:
Type: AWS::AutoScaling::ScalingPolicy
Properties:
AdjustmentType: ChangeInCapacity
AutoScalingGroupName: {Ref: Group_A}
Cooldown: '60'
ScalingAdjustment: '1'
WebServerScaleDownPolicy:
Type: AWS::AutoScaling::ScalingPolicy
Properties:
AdjustmentType: ChangeInCapacity
AutoScalingGroupName: {Ref: Group_A}
Cooldown: '60'
ScalingAdjustment: '-1'
CPUAlarmHigh:
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:
- {"Fn::GetAtt": [WebServerScaleUpPolicy, AlarmUrl]}
matching_metadata: {'metadata.user_metadata.groupname': {Ref: 'Group_A'}}
comparison_operator: gt
repeat_actions: True
CPUAlarmLow:
Type: OS::Ceilometer::Alarm
Properties:
description: Scale-down if the average CPU < 15% for 1 minute
meter_name: cpu_util
statistic: avg
period: '60'
evaluation_periods: '1'
threshold: '15'
alarm_actions:
- {"Fn::GetAtt": [WebServerScaleDownPolicy, AlarmUrl]}
matching_metadata: {'metadata.user_metadata.groupname': {Ref: 'Group_A'}}
comparison_operator: lt
repeat_actions: True
LaunchConfig:
Type: AWS::AutoScaling::LaunchConfiguration
Properties:
ImageId: {Ref: ImageId}
InstanceType: {Ref: InstanceType}
KeyName: {Ref: KeyName}
Outputs:
ServerList:
Description: List of Instances
Value:
- Instance_List: {'Fn::GetAtt': [Group_A, InstanceList]}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack/attachments/20140331/46509432/attachment.html>
More information about the Openstack
mailing list