CentOS Stream 9

OpenStack Epoxy : Configure Aodh2025/06/02

 

Install 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]

Install Gnocchi and Ceilometer first.

[2] Add users and others for Aodh in Keystone.
# create [aodh] user in [service] project

[root@dlp ~(keystone)]#
openstack user create --domain default --project service --password servicepassword aodh

+---------------------+----------------------------------+
| Field               | Value                            |
+---------------------+----------------------------------+
| default_project_id  | 03262019a5e54890be53c2fc96ed98d0 |
| domain_id           | default                          |
| email               | None                             |
| enabled             | True                             |
| id                  | 4dc0c726b93941c7b4a77621c7f19fe1 |
| name                | aodh                             |
| description         | None                             |
| password_expires_at | None                             |
+---------------------+----------------------------------+

# add [aodh] user in [admin] role

[root@dlp ~(keystone)]#
openstack role add --project service --user aodh admin
# create service entry for [aodh]

[root@dlp ~(keystone)]#
openstack service create --name aodh --description "Telemetry Alarming" alarming

+-------------+----------------------------------+
| Field       | Value                            |
+-------------+----------------------------------+
| id          | f31ea4c9b4d7454faf7524512c0b6694 |
| name        | aodh                             |
| type        | alarming                         |
| enabled     | True                             |
| description | Telemetry Alarming               |
+-------------+----------------------------------+

# define Aodh API Host

[root@dlp ~(keystone)]#
export controller=network.srv.world
# add endpoint for aodh (public)

[root@dlp ~(keystone)]#
openstack endpoint create --region RegionOne alarming public https://$controller:8042

+--------------+----------------------------------+
| Field        | Value                            |
+--------------+----------------------------------+
| enabled      | True                             |
| id           | 3b857387456f4630919beac80fea9b6f |
| interface    | public                           |
| region       | RegionOne                        |
| region_id    | RegionOne                        |
| service_id   | f31ea4c9b4d7454faf7524512c0b6694 |
| service_name | aodh                             |
| service_type | alarming                         |
| url          | https://network.srv.world:8042   |
+--------------+----------------------------------+

# add endpoint for aodh (internal)

[root@dlp ~(keystone)]#
openstack endpoint create --region RegionOne alarming internal https://$controller:8042

+--------------+----------------------------------+
| Field        | Value                            |
+--------------+----------------------------------+
| enabled      | True                             |
| id           | 933f20d10d684580acd5aee4b04afeef |
| interface    | internal                         |
| region       | RegionOne                        |
| region_id    | RegionOne                        |
| service_id   | f31ea4c9b4d7454faf7524512c0b6694 |
| service_name | aodh                             |
| service_type | alarming                         |
| url          | https://network.srv.world:8042   |
+--------------+----------------------------------+

# add endpoint for aodh (admin)

[root@dlp ~(keystone)]#
openstack endpoint create --region RegionOne alarming admin https://$controller:8042

+--------------+----------------------------------+
| Field        | Value                            |
+--------------+----------------------------------+
| enabled      | True                             |
| id           | d8667a8159e3450a97d02f1dbc545f36 |
| interface    | admin                            |
| region       | RegionOne                        |
| region_id    | RegionOne                        |
| service_id   | f31ea4c9b4d7454faf7524512c0b6694 |
| service_name | aodh                             |
| service_type | alarming                         |
| url          | https://network.srv.world:8042   |
+--------------+----------------------------------+
[3] Add a User and Database on MariaDB for Aodh.
[root@dlp ~(keystone)]#
mysql

Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 12431
Server version: 10.11.10-MariaDB MariaDB Server

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> create database aodh; 
Query OK, 1 row affected (0.00 sec)

MariaDB [(none)]> grant all privileges on aodh.* to aodh@'localhost' identified by 'password'; 
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> grant all privileges on aodh.* to aodh@'%' identified by 'password'; 
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> exit 
Bye
[4] Install Aodh on Network Node.
# install from Epoxy, EPEL

[root@network ~]#
dnf --enablerepo=centos-openstack-epoxy,epel -y install openstack-aodh-api openstack-aodh-evaluator openstack-aodh-notifier openstack-aodh-listener openstack-aodh-expirer python3-aodhclient
[5] Configure Aodh.
[root@network ~]#
mv /etc/aodh/aodh.conf /etc/aodh/aodh.conf.org

[root@network ~]#
vi /etc/aodh/aodh.conf
# create new

[DEFAULT]
log_dir = /var/log/aodh
# RabbitMQ connection info
transport_url = rabbit://openstack:password@dlp.srv.world

[api]
auth_mode = keystone
gnocchi_external_project_owner = service

[database]
# MariaDB connection info
connection = mysql+pymysql://aodh:password@dlp.srv.world/aodh

# Keystone auth info
[keystone_authtoken]
www_authenticate_uri = https://dlp.srv.world:5000
auth_url = https://dlp.srv.world:5000
memcached_servers = dlp.srv.world:11211
auth_type = password
project_domain_name = Default
user_domain_name = Default
project_name = service
username = aodh
password = servicepassword
service_token_roles_required = true
# if using self-signed certs on httpd Keystone, turn to [true]
insecure = false

[service_credentials]
auth_url = https://dlp.srv.world:5000
auth_type = password
project_domain_name = Default
user_domain_name = Default
project_name = service
username = aodh
password = servicepassword
interface = public

[root@network ~]#
vi /etc/httpd/conf.d/20-aodh_wsgi.conf
# create new

Listen 127.0.0.1:8042
<VirtualHost *:8042>
    <Directory /usr/bin>
        AllowOverride None
        Require all granted
    </Directory>

    CustomLog /var/log/httpd/aodh_wsgi_access.log combined
    ErrorLog /var/log/httpd/aodh_wsgi_error.log
    WSGIApplicationGroup %{GLOBAL}
    WSGIDaemonProcess aodh display-name=aodh_wsgi user=aodh group=aodh processes=6 threads=6
    WSGIProcessGroup aodh
    WSGIScriptAlias / /usr/bin/aodh-api
</VirtualHost>

[root@network ~]#
chmod 640 /etc/aodh/aodh.conf

[root@network ~]#
chgrp aodh /etc/aodh/aodh.conf

[6] Configure Nginx for proxy settings.
[root@network ~]#
vi /etc/nginx/nginx.conf
# add into the [stream] section

stream {
    upstream neutron-api {
        server 127.0.0.1:9696;
    }
    server {
        listen 10.0.0.50:9696 ssl;
        proxy_pass neutron-api;
    }
    upstream gnocchi-api {
        server 127.0.0.1:8041;
    }
    server {
        listen 10.0.0.50:8041 ssl;
        proxy_pass gnocchi-api;
    }
    upstream aodh-api {
        server 127.0.0.1:8042;
    }
    server {
        listen 10.0.0.50:8042 ssl;
        proxy_pass aodh-api;
    }
    ssl_certificate "/etc/letsencrypt/live/network.srv.world/fullchain.pem";
    ssl_certificate_key "/etc/letsencrypt/live/network.srv.world/privkey.pem";
}
[7] If SELinux is enabled, change policy.
[root@network ~]#
semanage port -a -t http_port_t -p tcp 8042

[8] If Firewalld is running, allow service port.
[root@network ~]#
firewall-cmd --add-port=8042/tcp

success
[root@network ~]#
firewall-cmd --runtime-to-permanent

success
[9] Add Data into Database and start Gnocchi services.
[root@network ~]#
su -s /bin/bash aodh -c "aodh-dbsync"

[root@network ~]#
systemctl enable --now openstack-aodh-evaluator openstack-aodh-notifier openstack-aodh-listener

[root@network ~]#
systemctl restart httpd nginx

[10] Verify state on Control Node.
[root@dlp ~(keystone)]#
dnf --enablerepo=centos-openstack-epoxy,epel,crb -y install python3-aodhclient
[root@dlp ~(keystone)]#
openstack alarm list
# OK if no error is shown

Matched Content