Bug 988358

Summary: [RFE] Alarm state/lifecycle API
Product: Red Hat OpenStack Reporter: Eoghan Glynn <eglynn>
Component: openstack-ceilometerAssignee: Eoghan Glynn <eglynn>
Status: CLOSED ERRATA QA Contact: Kevin Whitney <kwhitney>
Severity: high Docs Contact:
Priority: high    
Version: 4.0CC: ajeain, breeler, eglynn, hateya, jruzicka, mlopes, pbrady, sgordon, srevivo, yeylon
Target Milestone: Upstream M1Keywords: FutureFeature, OtherQA
Target Release: 4.0   
Hardware: Unspecified   
OS: Unspecified   
URL: https://blueprints.launchpad.net/ceilometer/+spec/alarm-api
Whiteboard:
Fixed In Version: openstack-ceilometer-2013.2-0.2.b1.el6ost Doc Type: Enhancement
Doc Text:
A public v2 API was extended for OpenStack Metering (Ceilometer), which exposes create, retrieve, update and destroy operations for alarms. This was required because Ceilometer alarms are a user-oriented feature, reflecting the user's view of cloud resources (as opposed to the cloud operator's view of the data center fabric). Hence an alarm's lifecycle must be accessible to normal and admin users.
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-12-20 00:15:19 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 973191, 975499, 986393, 986410, 1055813    

Description Eoghan Glynn 2013-07-25 11:58:12 UTC
Provide an API to alarms to be created, retrieved, updated and destroyed.

Support analogous actions in the python-ceilometerclient libraray and CLI.

Upstream blueprint: https://blueprints.launchpad.net/ceilometer/+spec/alarm-api

Comment 5 Ami Jeain 2013-10-28 11:43:03 UTC
QANAK'ing due to QE capacity

Comment 8 Eoghan Glynn 2013-12-09 13:57:19 UTC
How To Test
===========

0. Install packstack allinone, then spin up an instance in the usual way. 

Ensure the compute agent is gathering metrics at a reasonable cadence (every 60s for example instead of every 10mins as per the default):

  sudo sed -i '/^ *name: cpu_pipeline$/ { n ; s/interval: 600$/interval: 60/ }' /etc/ceilometer/pipeline.yaml
  sudo service openstack-ceilometer-compute restart


1. Create an alarm with a threshold sufficiently low that it's guaranteed to go into alarm:

  ceilometer alarm-threshold-create --name cpu_high_bz_988358 --description 'instance running hot'  \
     --meter-name cpu_util  --threshold 0.01 --comparison-operator gt  --statistic avg \
     --period 60 --evaluation-periods 1 \
     --alarm-action 'log://' \
     --query resource_id=$INSTANCE_ID

  ALARM_ID=$(ceilometer alarm-list | grep cpu_high_bz_988358 | sed 's/^| //' | sed 's/ | .*$//')


2. Retrieve the alarm state:

  ceilometer alarm-show -a $ALARM_ID

  Ensure the reported attributes match those given on creation in step #1.


3. Ensure it transitions into the alarm state within the evaluation period:

   sleep 60 ; ceilometer alarm-show -a $ALARM_ID | grep state
 

4. Update the alarm witha threshold sufficiently high that it's guaranteed to flip out of alarm: 

  ceilometer alarm-update --threshold 99.0 -a $ALARM_ID

  Ensure the reported attributes match those given on creation in step #1, modulo the updated attribute (the threshold in this case).


5. Ensure it transitions into the ok state within the evaluation period:

   sleep 60 ; ceilometer alarm-show -a $ALARM_ID | grep state


6. Delete the alarm:

  ceilometer alarm-delete -a $ALARM_ID


7. Ensure the alarm is no longer reported:

  ceilometer alarm-list | grep $ALARM_ID
  ceilometer alarm-show -a $ALARM_ID

Comment 12 errata-xmlrpc 2013-12-20 00:15:19 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHEA-2013-1859.html