Bug 1258383 - Failed to update 'query' field for threshold based alarm
Failed to update 'query' field for threshold based alarm
Status: CLOSED CURRENTRELEASE
Product: Red Hat OpenStack
Classification: Red Hat
Component: python-ceilometerclient (Show other bugs)
5.0 (RHEL 7)
Unspecified Unspecified
unspecified Severity unspecified
: ---
: 5.0 (RHEL 7)
Assigned To: Pradeep Kilambi
Yurii Prokulevych
: ZStream
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-08-31 05:06 EDT by Yurii Prokulevych
Modified: 2015-12-16 10:55 EST (History)
10 users (show)

See Also:
Fixed In Version: python-ceilometerclient-1.0.14-2.el7ost
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-12-16 10:55:26 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Some debut output (25.14 KB, text/plain)
2015-08-31 05:06 EDT, Yurii Prokulevych
no flags Details

  None (edit)
Description Yurii Prokulevych 2015-08-31 05:06:56 EDT
Created attachment 1068548 [details]
Some debut output

Description of problem:
Query field for threshold based alarm can be specified during alarm creation but cannot be updated later.
ceilometer alarm-show -a 1517195f-fd22-43fa-ac92-2b932e2c8cd4
+---------------------------+--------------------------------------+
| Property                  | Value                                |
+---------------------------+--------------------------------------+
| alarm_actions             | [u'log://']                          |
| alarm_id                  | 1517195f-fd22-43fa-ac92-2b932e2c8cd4 |
| comparison_operator       | ge                                   |
| description               | Test Alarm Update 2                  |
| enabled                   | True                                 |
| evaluation_periods        | 1                                    |
| exclude_outliers          | False                                |
| insufficient_data_actions | [u'log://']                          |
| meter_name                | image.download                       |
| name                      | TestAlarm1                           |
| ok_actions                | [u'http://127.0.0.1:5000']           |
| period                    | 60                                   |
| project_id                | 2790ac1340294cf4bfb041ccf37a6b2c     |
| query                     |                                      |
| repeat_actions            | False                                |
| state                     | insufficient data                    |
| statistic                 | count                                |
| threshold                 | 3.0                                  |
| type                      | threshold                            |
| user_id                   | 245f374675e04aaaa6928d994a93c497     |
+---------------------------+--------------------------------------+

ceilometer  alarm-threshold-update \
-q 'resource_id=954adc14-8475-4c4e-93b3-17b05733f599' \
-a 1517195f-fd22-43fa-ac92-2b932e2c8cd4

+---------------------------+--------------------------------------+
| Property                  | Value                                |
+---------------------------+--------------------------------------+
| alarm_actions             | [u'log://']                          |
| alarm_id                  | 1517195f-fd22-43fa-ac92-2b932e2c8cd4 |
| comparison_operator       | ge                                   |
| description               | Test Alarm Update 2                  |
| enabled                   | True                                 |
| evaluation_periods        | 1                                    |
| exclude_outliers          | False                                |
| insufficient_data_actions | [u'log://']                          |
| meter_name                | image.download                       |
| name                      | TestAlarm1                           |
| ok_actions                | [u'http://127.0.0.1:5000']           |
| period                    | 60                                   |
| project_id                | 2790ac1340294cf4bfb041ccf37a6b2c     |
| query                     |                                      |
| repeat_actions            | False                                |
| state                     | insufficient data                    |
| statistic                 | count                                |
| threshold                 | 3.0                                  |
| type                      | threshold                            |
| user_id                   | 245f374675e04aaaa6928d994a93c497     |
+---------------------------+--------------------------------------+

ceilometer alarm-history -a 1517195f-fd22-43fa-ac92-2b932e2c8cd4 | tail
| rule change      | 2015-08-31T08:47:45.015000 | rule: image.download >= 3.0 during 1 x 60s  |
| rule change      | 2015-08-31T08:48:05.404000 | repeat_actions: True                        |
| rule change      | 2015-08-31T08:48:13.485000 | repeat_actions: False                       |
| rule change      | 2015-08-31T08:48:36.237000 | rule: image.download >= 3.0 during 1 x 60s  |
| rule change      | 2015-08-31T08:48:47.192000 | rule: image.download >= 3.0 during 1 x 60s  |
| rule change      | 2015-08-31T08:49:59.847000 | rule: image.download >= 5.0 during 1 x 60s  |
| rule change      | 2015-08-31T08:50:05.425000 | rule: image.download >= 3.0 during 1 x 60s  |
| rule change      | 2015-08-31T08:59:20.968000 |                                             |
+------------------+----------------------------+---------------------------------------------+

Version-Release number of selected component (if applicable):
openstack-ceilometer-central-2014.1.5-1.el7ost.noarch
python-ceilometer-2014.1.5-1.el7ost.noarch
python-ceilometerclient-1.0.10-1.el7ost.noarch
openstack-ceilometer-compute-2014.1.5-1.el7ost.noarch
openstack-ceilometer-notification-2014.1.5-1.el7ost.noarch
openstack-ceilometer-alarm-2014.1.5-1.el7ost.noarch
openstack-ceilometer-common-2014.1.5-1.el7ost.noarch
openstack-ceilometer-collector-2014.1.5-1.el7ost.noarch
openstack-ceilometer-api-2014.1.5-1.el7ost.noarch


Expected results:
Query field is updated.
Comment 3 Eoghan Glynn 2015-08-31 08:06:31 EDT
Seem like a python-ceilometerclient oversight, as the threshold_rule query is not set appropriately in the outgoing PUT request.
Comment 4 Yurii Prokulevych 2015-08-31 09:33:06 EDT
Same behaviour while updating user_id or project_id.

Regards,
Yurii
Comment 5 Chris Dent 2015-09-01 09:47:20 EDT
The issue with user_id and project_id is something that has been fixed in a relatively recent version of ceilometerclient (one that is later than Kilo): https://bugs.launchpad.net/python-ceilometerclient/+bug/1395932

Given that this is a pretty long standing bug I'm not sure of the process there?

I'm still working through the issue with query.
Comment 6 Chris Dent 2015-09-01 13:21:55 EDT
To make sure the error is where we think it is, I confirmed that the tests cases work with modern python-ceilometerclient (installed from pypi) and a rhos5 setup. I'm still trying to find the relevant change. It is non obvious. :(
Comment 7 Chris Dent 2015-09-01 13:59:08 EDT
Some more information. The fix was at the commit linked to this bug: https://bugs.launchpad.net/python-ceilometerclient/+bug/1313676

The basic problem is that the v2/shell.py is not assigning the query string to the right destination so it is dropped.

The version of ceilometerclient in rhos5 is 1.0.10. The fix is in 1.0.11 and 1.0.12. The branch tagged 1.0.12 is also tagged 'icehouse-eol'.

Can we just update to a newer packaging of the client? If so, how?

Note You need to log in before you can comment on or make changes to this bug.