[Openstack] ceilometer alarm

Denis Aleksandrov dnaleksandrov at gmail.com
Thu Oct 20 21:58:26 UTC 2016


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




More information about the Openstack mailing list