[Openstack] ceilometer alarm

Ja. C.A. magicboiz at hotmail.com
Fri Oct 21 07:15:17 UTC 2016


Hi

I'd try with something simply first:

alarm_1:
     type: OS::Ceilometer::Alarm
     properties:
       description: cpu_util alarm
       meter_name: cpu_util
       statistic: avg
       period: 60
       evaluation_periods: 1
       threshold: 20
       matching_metadata: {"metadata.user_metadata.stack": {get_param: 
"OS::stack_id"}}
       comparison_operator: gt


and then, I'd check "ceilometer alarm-show <alarm_id>" in both cases 
(ceilometer cli alarm definition vs heat alarm definition)


On 20/10/16 23:58, Denis Aleksandrov wrote:
> Hello,
> I user Kilo version of openstack and want to attach a ceilometer alarm
> to an instance by heat:
>
> si-vm1:
>      type: OS::Nova::Server
>      depends_on: [ instance_ip_left1, instance_ip_right1, instance_ip_mgt1 ]
>      properties:
>        name: { get_param: si_vm_name1 }
>        image: { get_param:  image }
>        flavor: { get_param: flavor }
>        availability_zone: { get_param: zone }
>        networks:
>          - port: { get_resource: vm_interface_mgt1 }
>          - port: { get_resource: vm_interface_left1 }
>          - port: { get_resource: vm_interface_right1 }
>
>    vsrx1:
>      type: OS::Ceilometer::Alarm
>      depends_on: [ si-vm1 ]
>      properties:
>        description: vsrx1
>        meter_name: cpu_util
>        statistic: avg
>        comparison_operator: gt
>        period: 60
>        evaluation_periods: 1
>        threshold: 20
>        alarm_actions: ['http://127.0.0.1:8197/alarms/api']
>        ok_actions: ['http://127.0.0.1:8197/alarms/api']
>        matching_metadata: {'resource_id': {get_resource: si-vm1}}
>        repeat_actions: False
>
> It doesn't work properly and the alarm always shows "insufficient data" state.
> Whereas if I attach alarm to the instance through python ceilometer client:
>
> ceilometer.alarms.create(name='vsrx1',
>                                           meter_name='cpu_util',
>                                           threshold='20',
>                                           comparison_operator='gt',
>                                           statistic='avg',
>                                           period='60',
>                                           evaluation_periods='1',
>
> alarm_actions=['http://127.0.0.1:8197/alarms/api'],
>
> ok_actions=['http://127.0.0.1:8197/alarms/api'],
>                                           matching_metadata={'resource_id':'
>
> a3e0aa8f-49b7-488a-9e58-06b1ae085c6c'},
>                                           project_id=
> 'bad15bda17ea45ca9598f596ebef1148')
>
> it works fine.
> Could someone suggest how to reference a Nova Instance in the Ceilometer Alarm
> heat resource?
>
>
>
> Best Regards,
> Denis Aleksandrov
>
> _______________________________________________
> Mailing list: http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack
> Post to     : openstack at lists.openstack.org
> Unsubscribe : http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack





More information about the Openstack mailing list