Alarm action should be checked when create alarm

Bug #1408248 reported by ZhiQiang Fan
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ceilometer
Fix Released
Medium
ZhiQiang Fan

Bug Description

Test Ceilometer 2014.2 Juno release on Ubuntu 14.04 with MySQL backend

when create alarm, I could do this:

# ceilometer alarm-threshold-create --name large-action-test --threshold 1 --meter-name cpu_util --alarm-action test:// --alarm-action test:// --alarm-action test:// --alarm-action test:// --alarm-action test:// --alarm-action test:// --alarm-action test:// --alarm-action test:// --alarm-action test:// --alarm-action test://
+---------------------------+--------------------------------------------------------------------------+
| Property | Value |
+---------------------------+--------------------------------------------------------------------------+
| alarm_actions | [u'test://', u'test://', u'test://', u'test://', u'test://', u'test://', |
| | u'test://', u'test://', u'test://', u'test://'] |
| alarm_id | c955620c-f93e-41f5-8610-be66fd1fd75a |
| comparison_operator | eq |
| description | Alarm when cpu_util is eq a avg of 1.0 over 60 seconds |
| enabled | True |
| evaluation_periods | 1 |
| exclude_outliers | False |
| insufficient_data_actions | [] |
| meter_name | cpu_util |
| name | large-action-test |
| ok_actions | [] |
| period | 60 |
| project_id | d1578b5392f744b68dd8ad23412a8cd4 |
| query | |
| repeat_actions | False |
| state | insufficient data |
| statistic | avg |
| threshold | 1.0 |
| type | threshold |
| user_id | 2630d3c577df426bab9a4d9bfa986297 |
+---------------------------+--------------------------------------------------------------------------+

There are several issues:

1: test:// only add alarm's notification to memory, which is not useful for normal users, we should only allow admin user to specify such notifier
2: test notifier has no limit for notification, it will append to memory until process crash
3: duplicate action should be removed, it is no sense to notify a target twice
4: alarm action's length should be limited, otherwise, for i.e, normal user create 100 alarm (limited by alarm quota maybe), but each alarm has 10000 actions, and enable repeat actions, then ceilometer-alarm-notifier will be doomed, (I tried create 100 actions and succeed..)

will upload a series of patch to fix those issues.

ZhiQiang Fan (aji-zqfan)
Changed in ceilometer:
assignee: nobody → ZhiQiang Fan (aji-zqfan)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to ceilometer (master)

Fix proposed to branch: master
Review: https://review.openstack.org/166154

Changed in ceilometer:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to ceilometer (master)

Reviewed: https://review.openstack.org/166154
Committed: https://git.openstack.org/cgit/openstack/ceilometer/commit/?id=2d5f4e41ca530991e20291c2b6dc992cdd74da90
Submitter: Jenkins
Branch: master

commit 2d5f4e41ca530991e20291c2b6dc992cdd74da90
Author: ZhiQiang Fan <email address hidden>
Date: Thu Mar 19 12:16:40 2015 +0800

    limit alarm actions

    Currently we have alarm quotas, but user still can create a single
    alarm with thousands of actions, the worse thing is that normal
    user can create log:// and test:// notifiers which they could never
    use it, but by doing such thing, normal user can break down ceilometer
    services, then maybe the whole server. That is because log:// will
    log to local disk (by default) and test:// will continuously consume
    server's memory.

    This patch adds a configure option to let cloud administrator to
    limit each alarm's maximum actions for three states, and disables
    normal user to create log:// and test:// to avoid bad things happen.

    Change-Id: I7325ab72c94d307075f1317ee0b7b19f30a5d231
    Closes-Bug: #1408248
    DocImpact

Changed in ceilometer:
status: In Progress → Fix Committed
Eoghan Glynn (eglynn)
Changed in ceilometer:
importance: Undecided → Medium
milestone: none → liberty-1
Thierry Carrez (ttx)
Changed in ceilometer:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in ceilometer:
milestone: liberty-1 → 5.0.0
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.