Ubuntu 22.04
Sponsored Link

OpenStack Caracal : How to use Ceilometer (Nova Compute)2024/04/11

 
This is how to use OpenStack Telemetry Service (Ceilometer) for Nova Compute service.
This example is based on the environment 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  |  |  Neutron L2/L3 Agent  |  |        Libvirt        |
|  Memcached  Nginx     |  |   Neutron Metadata    |  |      Nova Compute     |
|  Keystone   httpd     |  |     Open vSwitch      |  |    Neutron L2 Agent   |
|  Glance     Nova API  |  |     iSCSI Target      |  |      Open vSwitch     |
|  Neutron Server       |  |     Cinder Volume     |  |   Ceilometer Compute  |
|  Neutron Metadata     |  |     httpd  Gnocchi    |  |                       |
|  Cinder API           |  |   Ceilometer Central  |  |                       |
+-----------------------+  +-----------------------+  +-----------------------+

[1] Change settings for Nova Compute service to enable Telemetry data collection like follows.
root@node01:~#
vi /etc/nova/nova.conf
# add follows into [DEFAULT] section
instance_usage_audit = True
instance_usage_audit_period = hour

# add to last line
[notifications]
notify_on_state_change = vm_and_task_state

[oslo_messaging_notifications]
driver = messagingv2

root@node01:~#
systemctl restart nova-compute

[2] It's some example to display metrics and meters.
# start an instance

ubuntu@dlp ~(keystone)$
openstack server list

+--------------+-------------+---------+--------------+------------+----------+
| ID           | Name        | Status  | Networks     | Image      | Flavor   |
+--------------+-------------+---------+--------------+------------+----------+
| e7feb65c-    | Ubuntu-2204 | SHUTOFF | private=10.0 | Ubuntu2204 | m1.small |
| 1482-48a9-   |             |         | .0.250, 192. |            |          |
| 9d45-        |             |         | 168.100.188  |            |          |
| e74196a5ea92 |             |         |              |            |          |
+--------------+-------------+---------+--------------+------------+----------+

ubuntu@dlp ~(keystone)$
openstack server start Ubuntu-2204

# display resources
# after doing some operations on instance, metrics data are gotten

ubuntu@dlp ~(keystone)$
openstack metric resource list

+----------+----------+------------+----------+----------------------+------------+----------+----------------+--------------+---------------+
| id       | type     | project_id | user_id  | original_resource_id | started_at | ended_at | revision_start | revision_end | creator       |
+----------+----------+------------+----------+----------------------+------------+----------+----------------+--------------+---------------+
| 1a96a3e7 | instance | 2bcdd2fecf | e6828434 | instance-00000001-   | 2024-04-   | None     | 2024-04-       | None         | 470c2a45c1fc4 |
| -c719-   | _network | 1d4a8c8faf | 92a44937 | e7feb65c-1482-48a9-  | 11T04:22:0 |          | 11T04:22:06.61 |              | fcf9f921d2a20 |
| 549e-    | _interfa | 87f1232cf3 | b745ef94 | 9d45-e74196a5ea92-   | 6.611445+0 |          | 1451+00:00     |              | fd7982:c9a28e |
| b2bb-    | ce       | 65         | 5bfacf70 | tapc1f40f45-6f       | 0:00       |          |                |              | 6f0f794ccf889 |
| 68aa936a |          |            |          |                      |            |          |                |              | c115bb9c2872c |
| 369f     |          |            |          |                      |            |          |                |              |               |
| 9702027c | instance | 2bcdd2fecf | e6828434 | e7feb65c-1482-48a9-  | 2024-04-   | None     | 2024-04-       | None         | 470c2a45c1fc4 |
| -b96a-   | _disk    | 1d4a8c8faf | 92a44937 | 9d45-e74196a5ea92-   | 11T04:22:0 |          | 11T04:22:06.68 |              | fcf9f921d2a20 |
| 552a-    |          | 87f1232cf3 | b745ef94 | vda                  | 6.686566+0 |          | 6572+00:00     |              | fd7982:c9a28e |
| a3ec-    |          | 65         | 5bfacf70 |                      | 0:00       |          |                |              | 6f0f794ccf889 |
| 774ca64f |          |            |          |                      |            |          |                |              | c115bb9c2872c |
| 422c     |          |            |          |                      |            |          |                |              |               |
| e7feb65c | instance | 2bcdd2fecf | e6828434 | e7feb65c-1482-48a9-  | 2024-04-   | None     | 2024-04-       | None         | 470c2a45c1fc4 |
| -1482-   |          | 1d4a8c8faf | 92a44937 | 9d45-e74196a5ea92    | 11T04:22:0 |          | 11T04:22:06.78 |              | fcf9f921d2a20 |
| 48a9-    |          | 87f1232cf3 | b745ef94 |                      | 6.785588+0 |          | 5593+00:00     |              | fd7982:c9a28e |
| 9d45-    |          | 65         | 5bfacf70 |                      | 0:00       |          |                |              | 6f0f794ccf889 |
| e74196a5 |          |            |          |                      |            |          |                |              | c115bb9c2872c |
| ea92     |          |            |          |                      |            |          |                |              |               |
+----------+----------+------------+----------+----------------------+------------+----------+----------------+--------------+---------------+

# details of the [instance] resource

ubuntu@dlp ~(keystone)$
openstack metric resource show e7feb65c-1482-48a9-9d45-e74196a5ea92

+-----------------------+------------------------------------------------------+
| Field                 | Value                                                |
+-----------------------+------------------------------------------------------+
| created_by_project_id | c9a28e6f0f794ccf889c115bb9c2872c                     |
| created_by_user_id    | 470c2a45c1fc4fcf9f921d2a20fd7982                     |
| creator               | 470c2a45c1fc4fcf9f921d2a20fd7982:c9a28e6f0f794ccf889 |
|                       | c115bb9c2872c                                        |
| ended_at              | None                                                 |
| id                    | e7feb65c-1482-48a9-9d45-e74196a5ea92                 |
| metrics               | cpu: 564da281-dd87-4adf-a0a7-fa2d3ef709d1            |
|                       | memory.usage: 22e52f1b-a5f7-4a98-8dd7-d095dd568745   |
| original_resource_id  | e7feb65c-1482-48a9-9d45-e74196a5ea92                 |
| project_id            | 2bcdd2fecf1d4a8c8faf87f1232cf365                     |
| revision_end          | None                                                 |
| revision_start        | 2024-04-11T04:22:06.785593+00:00                     |
| started_at            | 2024-04-11T04:22:06.785588+00:00                     |
| type                  | instance                                             |
| user_id               | e682843492a44937b745ef945bfacf70                     |
+-----------------------+------------------------------------------------------+

# CPU

ubuntu@dlp ~(keystone)$
openstack metric measures show 564da281-dd87-4adf-a0a7-fa2d3ef709d1

+---------------------------+-------------+----------------+
| timestamp                 | granularity |          value |
+---------------------------+-------------+----------------+
| 2024-04-11T13:20:00+09:00 |       300.0 | 214700000000.0 |
+---------------------------+-------------+----------------+

# memory usage

ubuntu@dlp ~(keystone)$
openstack metric measures show 22e52f1b-a5f7-4a98-8dd7-d095dd568745

+---------------------------+-------------+--------------+
| timestamp                 | granularity |        value |
+---------------------------+-------------+--------------+
| 2024-04-11T13:20:00+09:00 |       300.0 | 432.01171875 |
+---------------------------+-------------+--------------+

# details of [instance_network_interface]

ubuntu@dlp ~(keystone)$
openstack metric resource show 1a96a3e7-c719-549e-b2bb-68aa936a369f

+-----------------------+------------------------------------------------------+
| Field                 | Value                                                |
+-----------------------+------------------------------------------------------+
| created_by_project_id | c9a28e6f0f794ccf889c115bb9c2872c                     |
| created_by_user_id    | 470c2a45c1fc4fcf9f921d2a20fd7982                     |
| creator               | 470c2a45c1fc4fcf9f921d2a20fd7982:c9a28e6f0f794ccf889 |
|                       | c115bb9c2872c                                        |
| ended_at              | None                                                 |
| id                    | 1a96a3e7-c719-549e-b2bb-68aa936a369f                 |
| metrics               | network.incoming.bytes:                              |
|                       | 4a3a6109-01fa-47fa-9e28-e4fe1ec9a373                 |
|                       | network.incoming.packets:                            |
|                       | 21ff53c9-d04d-4f52-b06c-272d19bc05ac                 |
|                       | network.outgoing.bytes:                              |
|                       | 2fcda438-1a3e-41db-8010-cb8e743c1533                 |
|                       | network.outgoing.packets:                            |
|                       | 3028e113-7ec2-4011-8e3b-218b6ec5110e                 |
| original_resource_id  | instance-00000001-e7feb65c-1482-48a9-9d45-           |
|                       | e74196a5ea92-tapc1f40f45-6f                          |
| project_id            | 2bcdd2fecf1d4a8c8faf87f1232cf365                     |
| revision_end          | None                                                 |
| revision_start        | 2024-04-11T04:22:06.611451+00:00                     |
| started_at            | 2024-04-11T04:22:06.611445+00:00                     |
| type                  | instance_network_interface                           |
| user_id               | e682843492a44937b745ef945bfacf70                     |
+-----------------------+------------------------------------------------------+

# display network incoming bytes

ubuntu@dlp ~(keystone)$
openstack metric measures show 4a3a6109-01fa-47fa-9e28-e4fe1ec9a373

+---------------------------+-------------+-----------+
| timestamp                 | granularity |     value |
+---------------------------+-------------+-----------+
| 2024-04-11T13:20:00+09:00 |       300.0 | 1876840.0 |
+---------------------------+-------------+-----------+

# display network outgoing bytes

ubuntu@dlp ~(keystone)$
openstack metric measures show 2fcda438-1a3e-41db-8010-cb8e743c1533

+---------------------------+-------------+------------+
| timestamp                 | granularity |      value |
+---------------------------+-------------+------------+
| 2024-04-11T13:20:00+09:00 |       300.0 | 33855168.0 |
+---------------------------+-------------+------------+
Matched Content