OpenStack Epoxy : How to use Aodh |
This is how to use OpenStack Alarming Service (Aodh). This example is based on the emvironment like follows. ------------+--------------------------+--------------------------+------------
| | |
eth0|10.0.0.30 eth0|10.0.0.50 eth0|10.0.0.51
+-----------+-----------+ +-----------+-----------+ +-----------+-----------+
| [ dlp.srv.world ] | | [ network.srv.world ] | | [ node01.srv.world ] |
| (Control Node) | | (Network Node) | | (Compute Node) |
| | | | | |
| MariaDB RabbitMQ | | Open vSwitch | | Libvirt |
| Memcached Nginx | | Neutron Server | | Nova Compute |
| Keystone httpd | | OVN-Northd | | Open vSwitch |
| Glance Nova API | | Nginx iSCSI Target | | OVN Metadata Agent |
| Cinder API | | Cinder Volume | | OVN-Controller |
| | | Gnocchi httpd | | Ceilometer Compute |
| | | Ceilometer Central | | |
| | | Aodh Services | | |
+-----------------------+ +-----------------------+ +-----------------------+
|
| [1] | Login as a user you'd like to set Alarm for your own Instances. For example, create an Alarm which alarms the cpu_util of an instance is over 70%. |
| debian@dlp ~(keystone)$ openstack server list +----------------+-----------+---------+-----------------+----------+----------+ | ID | Name | Status | Networks | Image | Flavor | +----------------+-----------+---------+-----------------+----------+----------+ | 2deabceb-e220- | Debian-13 | SHUTOFF | private=10.0.0. | Debian13 | m1.small | | 4e5c-b8dd- | | | 249, | | | | 320683d0bf0b | | | 192.168.100.39 | | | +----------------+-----------+---------+-----------------+----------+----------+ # for example, set an alarm to occur when the instance's CPU metric exceeds [100000000000.0 ns] debian@dlp ~(keystone)$ INSTANS_ID=$(openstack server list | grep Debian-13 | awk '{print $2}') debian@dlp ~(keystone)$ openstack alarm create \
--name cpu_hi \
--type gnocchi_resources_threshold \
--description 'CPU High' \
--metric cpu \
--threshold 100000000000.0 \
--comparison-operator gt \
--aggregation-method mean \
--granularity 300 \
--evaluation-periods 1 \
--resource-type instance \
--resource-id $INSTANS_ID
+---------------------------+--------------------------------------+
| Field | Value |
+---------------------------+--------------------------------------+
| alarm_id | 8910b119-c5be-4518-a0ed-7ac940ad6c7e |
| name | cpu_hi |
| description | CPU High |
| enabled | True |
| ok_actions | [] |
| alarm_actions | [] |
| insufficient_data_actions | [] |
| repeat_actions | False |
| type | gnocchi_resources_threshold |
| time_constraints | [] |
| project_id | ecfa98ba82de421e8f16c3d862b5ab04 |
| user_id | da64c3c335434563b66eb2e8af260392 |
| timestamp | 2025-09-03T05:18:39.594441 |
| state | insufficient data |
| state_timestamp | 2025-09-03T05:18:39.594441 |
| state_reason | Not evaluated yet |
| severity | low |
| evaluate_timestamp | 2025-09-03T05:18:39.603964 |
| metric | cpu |
| resource_id | 2deabceb-e220-4e5c-b8dd-320683d0bf0b |
| resource_type | instance |
| comparison_operator | gt |
| threshold | 100000000000.0 |
| aggregation_method | mean |
| evaluation_periods | 1 |
| granularity | 300 |
+---------------------------+--------------------------------------+
# after creating, [state] is [insufficient data] because meters are not evaluated yet debian@dlp ~(keystone)$ openstack alarm list +---------------+---------------+--------+----------------+----------+---------+ | alarm_id | type | name | state | severity | enabled | +---------------+---------------+--------+----------------+----------+---------+ | 8910b119- | gnocchi_resou | cpu_hi | insufficient | low | True | | c5be-4518- | rces_threshol | | data | | | | a0ed- | d | | | | | | 7ac940ad6c7e | | | | | | +---------------+---------------+--------+----------------+----------+---------+ # data of the target instance is evaluated and if it does not exceed the threshold, the state is [ok] debian@dlp ~(keystone)$ openstack alarm list +-------------------+--------------------+--------+-------+----------+---------+ | alarm_id | type | name | state | severity | enabled | +-------------------+--------------------+--------+-------+----------+---------+ | 8910b119-c5be- | gnocchi_resources_ | cpu_hi | ok | low | True | | 4518-a0ed- | threshold | | | | | | 7ac940ad6c7e | | | | | | +-------------------+--------------------+--------+-------+----------+---------+debian@dlp ~(keystone)$ openstack metric measures show $(openstack metric resource show $(openstack metric resource list | awk '{print $2,$4}' | grep -w 'instance' | awk '{print $1}') | grep 'cpu:' | awk '{print $5}') +---------------------------+-------------+----------------+ | timestamp | granularity | value | +---------------------------+-------------+----------------+ | 2025-09-03T12:30:00+09:00 | 300.0 | 28660000000.0 | | 2025-09-03T12:35:00+09:00 | 300.0 | 29640000000.0 | | 2025-09-03T14:20:00+09:00 | 300.0 | 12180000000.0 | | 2025-09-03T14:25:00+09:00 | 300.0 | 13690000000.0 | +---------------------------+-------------+----------------+ # when the CPU metric of the target instance exceeds the set threshold, state turns to [alarm] debian@dlp ~(keystone)$ openstack alarm list +-------------------+--------------------+--------+-------+----------+---------+ | alarm_id | type | name | state | severity | enabled | +-------------------+--------------------+--------+-------+----------+---------+ | 8910b119-c5be- | gnocchi_resources_ | cpu_hi | ok | low | True | | 4518-a0ed- | threshold | | | | | | 7ac940ad6c7e | | | | | | +-------------------+--------------------+--------+-------+----------+---------+debian@dlp ~(keystone)$ openstack metric measures show $(openstack metric resource show $(openstack metric resource list | awk '{print $2,$4}' | grep -w 'instance' | awk '{print $1}') | grep 'cpu:' | awk '{print $5}') +---------------------------+-------------+----------------+ | timestamp | granularity | value | +---------------------------+-------------+----------------+ | 2025-09-03T12:30:00+09:00 | 300.0 | 28660000000.0 | | 2025-09-03T12:35:00+09:00 | 300.0 | 29640000000.0 | | 2025-09-03T14:20:00+09:00 | 300.0 | 12180000000.0 | | 2025-09-03T14:25:00+09:00 | 300.0 | 13690000000.0 | | 2025-09-03T14:30:00+09:00 | 300.0 | 253570000000.0 | +---------------------------+-------------+----------------+ # if the target instance is stopped, [state] is [insufficient data] debian@dlp ~(keystone)$ openstack alarm list +---------------+---------------+--------+----------------+----------+---------+ | alarm_id | type | name | state | severity | enabled | +---------------+---------------+--------+----------------+----------+---------+ | 8910b119- | gnocchi_resou | cpu_hi | insufficient | low | True | | c5be-4518- | rces_threshol | | data | | | | a0ed- | d | | | | | | 7ac940ad6c7e | | | | | | +---------------+---------------+--------+----------------+----------+---------+ # show histories of an alarm debian@dlp ~(keystone)$ openstack alarm-history show 8910b119-c5be-4518-a0ed-7ac940ad6c7e +-------------------+------------------+-------------------+-------------------+
| timestamp | type | detail | event_id |
+-------------------+------------------+-------------------+-------------------+
| 2025-09- | state transition | {"state": | 636d78de-37fd- |
| 03T05:45:03.82551 | | "insufficient | 480c-9027- |
| 1 | | data", "transitio | 401b7e7d48d1 |
| | | n_reason": "No | |
| | | datapoint for | |
| | | granularity 300"} | |
| 2025-09- | state transition | {"state": | 67cb6eea-1000- |
| 03T05:31:03.91423 | | "alarm", "transit | 4a5a-9acf- |
| 3 | | ion_reason": | 781171b90a39 |
| | | "Transition to | |
| | | alarm due to 1 | |
| | | samples outside | |
| | | threshold, most | |
| | | recent: | |
| | | 253570000000.0"} | |
| 2025-09- | state transition | {"state": "ok", " | 5456b867-a8b8- |
| 03T05:21:03.82876 | | transition_reason | 41e7-b197- |
| 8 | | ": "Transition to | 0b559b2c8613 |
| | | ok due to 1 | |
| | | samples inside | |
| | | threshold, most | |
| | | recent: | |
| | | 12180000000.0"} | |
| 2025-09- | creation | {"alarm_id": "891 | dda89763-01b1- |
| 03T05:18:39.59444 | | 0b119-c5be-4518- | 43e8-a570- |
| 1 | | a0ed- | 510e1f5a503b |
| | | 7ac940ad6c7e", | |
| | | "type": "gnocchi_ | |
| | | resources_thresho | |
| | | ld", "enabled": | |
| | | true, "name": | |
| | | "cpu_hi", | |
| | | "description": | |
| | | "CPU High", | |
| | | "timestamp": "202 | |
| | | 5-09- | |
| | | 03T05:18:39.59444 | |
| | | 1", "user_id": "d | |
| | | a64c3c335434563b6 | |
| | | 6eb2e8af260392", | |
| | | "project_id": "ec | |
| | | fa98ba82de421e8f1 | |
| | | 6c3d862b5ab04", | |
| | | "state": | |
| | | "insufficient | |
| | | data", "state_tim | |
| | | estamp": "2025- | |
| | | 09- | |
| | | 03T05:18:39.59444 | |
| | | 1", | |
| | | "state_reason": | |
| | | "Not evaluated | |
| | | yet", | |
| | | "ok_actions": [], | |
| | | "alarm_actions": | |
| | | [], "insufficient | |
| | | _data_actions": | |
| | | [], | |
| | | "repeat_actions": | |
| | | false, "time_cons | |
| | | traints": [], | |
| | | "severity": | |
| | | "low", "rule": | |
| | | {"granularity": | |
| | | 300, "comparison_ | |
| | | operator": "gt", | |
| | | "threshold": | |
| | | 100000000000.0, " | |
| | | aggregation_metho | |
| | | d": "mean", "eval | |
| | | uation_periods": | |
| | | 1, "metric": | |
| | | "cpu", | |
| | | "resource_id": "2 | |
| | | deabceb-e220- | |
| | | 4e5c-b8dd- | |
| | | 320683d0bf0b", | |
| | | "resource_type": | |
| | | "instance"}} | |
+-------------------+------------------+-------------------+-------------------+
|
Matched Content
No comments:
Post a Comment