Aodh alarm is not updating and not giving any error, when updating the type from event to composite

Bug #1757994 reported by Manik Bindlish
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Aodh
In Progress
Undecided
Rajat Dhasmana

Bug Description

Release: Stable Newton
Ubuntu 16.04
Environment for NFV

Aodh alarm is not updating and not giving any error, when updating the type from event to composite.

Created with event type:
root@node-1:~# aodh alarm create --name mack --type event
+---------------------------+--------------------------------------+
| Field | Value |
+---------------------------+--------------------------------------+
| alarm_actions | [] |
| alarm_id | c1a3594f-bc5d-4c3b-bb46-5d271480e128 |
| description | Alarm when * event occurred. |
| enabled | True |
| event_type | * |
| insufficient_data_actions | [] |
| name | mack |
| ok_actions | [] |
| project_id | 9a036d420925419c9066e02ae98c4f99 |
| query | |
| repeat_actions | False |
| severity | low |
| state | insufficient data |
| state_timestamp | 2017-12-28T07:17:00.228626 |
| time_constraints | [] |
| timestamp | 2017-12-28T07:17:00.228626 |
| type | event |
| user_id | 4f40ae325991476f8733358eb736ad1e |
+---------------------------+--------------------------------------+

Updating with composite type:
root@node-1:~# aodh alarm update --name mack --type composite --composite-rule '{"or": [{"threshold": 1, "meter_name": "cpu_util", "type": "threshold"}]}' --alarm-action https://requestb.in/1ivrvri1
+---------------------------+--------------------------------------+
| Field | Value |
+---------------------------+--------------------------------------+
| alarm_actions | [u'https://requestb.in/1ivrvri1'] |
| alarm_id | c1a3594f-bc5d-4c3b-bb46-5d271480e128 |
| description | Alarm when * event occurred. |
| enabled | True |
| event_type | * |
| insufficient_data_actions | [] |
| name | mack |
| ok_actions | [] |
| project_id | 9a036d420925419c9066e02ae98c4f99 |
| query | |
| repeat_actions | False |
| severity | low |
| state | insufficient data |
| state_timestamp | 2017-12-28T07:17:00.228626 |
| time_constraints | [] |
| timestamp | 2017-12-28T07:18:14.087171 |
| type | event |
| user_id | 4f40ae325991476f8733358eb736ad1e |
+---------------------------+--------------------------------------+

[[Showing old data which is of event type. Not giving any error.]]

Changed in aodh:
assignee: nobody → Rajat Dhasmana (whoami-rajat)
Revision history for this message
Rajat Dhasmana (whoami-rajat) wrote :
Download full text (7.2 KiB)

In aodh alarm update command, the following cases are missing in aodhclient code :

1) --type parameter is not parsed from CLI
2) no code for updating the type of an alarm

The server API is working fine that is verified using curl

Initially we have an alarm of type event

+---------------------------+--------------------------------------+
| Field | Value |
+---------------------------+--------------------------------------+
| alarm_actions | [u'http://example.org/notify'] |
| alarm_id | 91a6eba7-e032-4b92-9acc-73a3e6cc842a |
| description | Alarm when * event occurred. |
| enabled | True |
| event_type | * |
| insufficient_data_actions | [] |
| name | new_alarm |
| ok_actions | [] |
| project_id | 185f9d1ec3a34227b3d0eb23a3216cb8 |
| query | |
| repeat_actions | False |
| severity | low |
| state | insufficient data |
| state_reason | Not evaluated yet |
| state_timestamp | 2018-04-24T06:28:43.327075 |
| time_constraints | [] |
| timestamp | 2018-04-24T06:44:01.708380 |
| type | event |
| user_id | 8919e4c798044b4383467d88c5d4733c |
+---------------------------+--------------------------------------+

after executing curl to update type and rule of alarm

stack@ubuntu-xenial:/usr/local/lib/python2.7/dist-packages/aodhclient/v2$ curl -g -i -X PUT http://127.0.0.1:8042/v2/alarms/91a6eba7-e032-4b92-9acc-73a3e6cc842a -H "Accept: application/json, */*" -H "Content-Type: application/json" -H "User-Agent: aodh keystoneauth1/3.5.0 python-requests/2.18.4 CPython/2.7.12" -H "X-Auth-Token: gAAAAABa3tDpsvIn1kr-13sTCuxMooYpOY7NfsXARSo2Udq_CTUkSgBR-1TpVPEuyN4WNfPFvuX-b957pzHRjd1ywKZQWcf2HdiSPwDCchKgXtniyFwTl5WAuGBT5_02cQ0E3hw-Y8eyxUSqdJ4H7oueZlB14XXsNZgm6Z9UiijZwBKGfUkMsbQ" -d '{"alarm_actions": ["http://example.org/notify"], "project_id": "185f9d1ec3a34227b3d0eb23a3216cb8", "ok_actions": [], "name": "new_alarm", "timestamp": "2018-04-24T06:29:29.621336", "description": "Alarm when * event occurred.", "time_constraints": [], "enabled": true, "state_timestamp": "2018-04-24T06:28:43.327075", "state_reason": "Not evaluated yet", "alarm_id": "91a6eba7-e032-4b92-9acc-73a3e6cc842a", "state": "insufficient data", "insufficient_data_actions": [], "repeat_actions": false, "user_id": "8919e4c798044b4383467d88c5d4733c", "composite_rule": {"type":"gnocchi_aggregation_by_metrics_threshold","threshold": 6, "metrics":["80de2719-d9cc-47aa-adf7-601bd4f572a5"], "evaluation_periods": 3, "granularity": 60, "comparison_operator": "ge", "aggregatio...

Read more...

Changed in aodh:
assignee: Rajat Dhasmana (whoami-rajat) → nobody
status: New → Incomplete
status: Incomplete → Confirmed
assignee: nobody → Rajat Dhasmana (whoami-rajat)
Revision history for this message
Rajat Dhasmana (whoami-rajat) wrote :
Changed in aodh:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/python-aodhclient 1.3.0

This issue was fixed in the openstack/python-aodhclient 1.3.0 release.

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.