Ask Your Question
0

Ocata Aodh alarm cpu_util "insufficient data"

asked 2019-02-19 04:09:57 -0500

JeffBannister gravatar image

Hi all, I'm creating an alarm to be triggered by an autoscaling policy based on cpu_util above 50% however the alarm always shows "insufficient data". The stack creates ok and I can access the instances but it never scales - here's my stack:

heat_template_version: 2016-04-08
description: A simple auto scaling group
resources:
  group:
    type: OS::Heat::AutoScalingGroup
    properties:
      cooldown: 60
      desired_capacity: 2
      max_size: 5
      min_size: 1
      resource:
        type: OS::Nova::Server
        properties:
          image: 'cirros'
          flavor: m1.tiny
          networks:
            - network: private

  scaleup_policy:
    type: OS::Heat::ScalingPolicy
    properties:
      adjustment_type: change_in_capacity
      auto_scaling_group_id: {get_resource: group}
      cooldown: 60
      scaling_adjustment: 1

  cpu_alarm_high:
    type: OS::Aodh::GnocchiAggregationByResourcesAlarm
    properties:
        metric: cpu_util
        aggregation_method: mean
        granularity: 60
        evaluation_periods: 1
        threshold: 50
        resource_type: instance
        comparison_operator: gt
        alarm_actions:
            - str_replace:
                template: trust+url
                params:
                    url: {get_attr: [scaleup_policy, signal_url]}
        query:
            str_replace:
                template: '{"=": {"server_group": "stack_id"}}'
                params:
                    stack_id: {get_param: "OS::stack_id"}
outputs:
    scaleup_policy_signal_url:
        value: {get_attr: [scaleup_policy, signal_url]}
edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2019-02-19 10:30:50 -0500

I had the similar issue

aodh alarm show cpu-high
| evaluation_periods        | 1
| granularity               | 600
| query                     | {"and": [{"or": [{"=": {"created_by_project_id": "eaf4d8ec028c4027b02d8c67b7565d61"}}, {"and": [{"=": {"created_by_project_id": "c0580563e514461f906be948d99afe46"}}, {"=": {"project_id": "eaf4d8ec028c4027b02d8c67b7565d61"}}]}]}, {"=": {"display_name": "ub-node"}}]} |
| repeat_actions            | False

At the same time:

gnocchi measures aggregation -m cpu_util --query "project_id='eaf4d8ec028c4027b02d8c67b7565d61' and display_name='ub-node'" --resource-type instance --start 2019-02-19T18:30:00+03:00
+---------------------------+-------------+----------------+
| timestamp                 | granularity |          value |
+---------------------------+-------------+----------------+
| 2019-02-19T18:30:00+03:00 |       300.0 |  99.8654217781 |
| 2019-02-19T18:35:00+03:00 |       300.0 |  99.8822001703 |
| 2019-02-19T18:40:00+03:00 |       300.0 |  99.8669754688 |
| 2019-02-19T18:45:00+03:00 |       300.0 |  92.7373500072 |
| 2019-02-19T18:50:00+03:00 |       300.0 |  66.6870052248 |

I did not see any errors in Aodh logs

But during I was writing this post, I found out solution =)

The pretty important: The alarm granularity must match the granularities of the metric configured in Gnocchi.

As I see, you set granularity:60, check you granularity in gnocchi

edit flag offensive delete link more

Comments

Thanks for the reply. I redid it, and yes the granularity was different so I have now set it to be the same, however, it still is showing "Insufficient data"

JeffBannister gravatar imageJeffBannister ( 2019-02-21 02:52:25 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2019-02-19 04:09:57 -0500

Seen: 147 times

Last updated: Feb 19