Ubuntu 24.04
Sponsored Link

OpenStack Caracal : How to use Ceilometer (Nova Compute)2024/05/23

 

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   |
+--------------+-------------+---------+--------------+------------+----------+
| 7fbc24c1-    | Ubuntu-2404 | SHUTOFF | private=10.0 | Ubuntu2404 | m1.small |
| c0d1-43d6-   |             |         | .0.208, 192. |            |          |
| 87aa-        |             |         | 168.100.130  |            |          |
| 68df83597b57 |             |         |              |            |          |
+--------------+-------------+---------+--------------+------------+----------+

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

# 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       |
+----------+----------+------------+----------+----------------------+------------+----------+----------------+--------------+---------------+
| f69d1834 | instance | 18ede7365b | b9371d01 | 7fbc24c1-c0d1-43d6-  | 2024-05-   | None     | 2024-05-       | None         | 65be1bdf8db24 |
| -9dc1-   | _disk    | dc430093e8 | 5e0d43dc | 87aa-68df83597b57-   | 23T01:17:1 |          | 23T01:17:17.29 |              | 41e8670bf362e |
| 544c-    |          | fd4a90f773 | a74f2916 | vda                  | 7.291969+0 |          | 1974+00:00     |              | 844176:ab9749 |
| 82df-    |          | 69         | 1448ffd2 |                      | 0:00       |          |                |              | e59bdb48e4807 |
| 82a2b49c |          |            |          |                      |            |          |                |              | a18abb83c9f99 |
| ad84     |          |            |          |                      |            |          |                |              |               |
| a9867d26 | instance | 18ede7365b | b9371d01 | instance-00000002-   | 2024-05-   | None     | 2024-05-       | None         | 65be1bdf8db24 |
| -81a4-   | _network | dc430093e8 | 5e0d43dc | 7fbc24c1-c0d1-43d6-  | 23T01:17:1 |          | 23T01:17:17.41 |              | 41e8670bf362e |
| 5eca-    | _interfa | fd4a90f773 | a74f2916 | 87aa-68df83597b57-   | 7.413053+0 |          | 3059+00:00     |              | 844176:ab9749 |
| b871-    | ce       | 69         | 1448ffd2 | tape810be8a-45       | 0:00       |          |                |              | e59bdb48e4807 |
| f50efe37 |          |            |          |                      |            |          |                |              | a18abb83c9f99 |
| 4561     |          |            |          |                      |            |          |                |              |               |
| 7fbc24c1 | instance | 18ede7365b | b9371d01 | 7fbc24c1-c0d1-43d6-  | 2024-05-   | None     | 2024-05-       | None         | 65be1bdf8db24 |
| -c0d1-   |          | dc430093e8 | 5e0d43dc | 87aa-68df83597b57    | 23T01:17:1 |          | 23T01:17:17.42 |              | 41e8670bf362e |
| 43d6-    |          | fd4a90f773 | a74f2916 |                      | 7.423541+0 |          | 3545+00:00     |              | 844176:ab9749 |
| 87aa-    |          | 69         | 1448ffd2 |                      | 0:00       |          |                |              | e59bdb48e4807 |
| 68df8359 |          |            |          |                      |            |          |                |              | a18abb83c9f99 |
| 7b57     |          |            |          |                      |            |          |                |              |               |
+----------+----------+------------+----------+----------------------+------------+----------+----------------+--------------+---------------+

# details of the [instance] resource

ubuntu@dlp ~(keystone)$
openstack metric resource show 7fbc24c1-c0d1-43d6-87aa-68df83597b57

+-----------------------+------------------------------------------------------+
| Field                 | Value                                                |
+-----------------------+------------------------------------------------------+
| created_by_project_id | ab9749e59bdb48e4807a18abb83c9f99                     |
| created_by_user_id    | 65be1bdf8db2441e8670bf362e844176                     |
| creator               | 65be1bdf8db2441e8670bf362e844176:ab9749e59bdb48e4807 |
|                       | a18abb83c9f99                                        |
| ended_at              | None                                                 |
| id                    | 7fbc24c1-c0d1-43d6-87aa-68df83597b57                 |
| metrics               | cpu: 45b3c552-6fe4-4caa-9ae6-1c049aee6d50            |
|                       | memory.usage: f7731e61-40da-4db7-b625-f35e0482ac6f   |
| original_resource_id  | 7fbc24c1-c0d1-43d6-87aa-68df83597b57                 |
| project_id            | 18ede7365bdc430093e8fd4a90f77369                     |
| revision_end          | None                                                 |
| revision_start        | 2024-05-23T01:17:17.423545+00:00                     |
| started_at            | 2024-05-23T01:17:17.423541+00:00                     |
| type                  | instance                                             |
| user_id               | b9371d015e0d43dca74f29161448ffd2                     |
+-----------------------+------------------------------------------------------+

# CPU

ubuntu@dlp ~(keystone)$
openstack metric measures show 45b3c552-6fe4-4caa-9ae6-1c049aee6d50

+---------------------------+-------------+----------------+
| timestamp                 | granularity |          value |
+---------------------------+-------------+----------------+
| 2024-05-23T01:15:00+00:00 |       300.0 | 137680000000.0 |
+---------------------------+-------------+----------------+

# memory usage

ubuntu@dlp ~(keystone)$
openstack metric measures show f7731e61-40da-4db7-b625-f35e0482ac6f

+---------------------------+-------------+-----------+
| timestamp                 | granularity |     value |
+---------------------------+-------------+-----------+
| 2024-05-23T01:15:00+00:00 |       300.0 | 421.53125 |
+---------------------------+-------------+-----------+

# details of [instance_network_interface]

ubuntu@dlp ~(keystone)$
openstack metric resource show a9867d26-81a4-5eca-b871-f50efe374561

+-----------------------+------------------------------------------------------+
| Field                 | Value                                                |
+-----------------------+------------------------------------------------------+
| created_by_project_id | ab9749e59bdb48e4807a18abb83c9f99                     |
| created_by_user_id    | 65be1bdf8db2441e8670bf362e844176                     |
| creator               | 65be1bdf8db2441e8670bf362e844176:ab9749e59bdb48e4807 |
|                       | a18abb83c9f99                                        |
| ended_at              | None                                                 |
| id                    | a9867d26-81a4-5eca-b871-f50efe374561                 |
| metrics               | network.incoming.bytes:                              |
|                       | 2e4c3906-a0af-4306-b987-89649b97dd19                 |
|                       | network.incoming.packets:                            |
|                       | ed807b11-8a7d-47c8-bf93-f9a13f230b97                 |
|                       | network.outgoing.bytes:                              |
|                       | 4c9d2c1c-129d-49aa-8efb-918ce2008ca8                 |
|                       | network.outgoing.packets:                            |
|                       | 32fcee47-4988-438e-8e10-fcc770abe1e3                 |
| original_resource_id  | instance-00000002-7fbc24c1-c0d1-43d6-87aa-           |
|                       | 68df83597b57-tape810be8a-45                          |
| project_id            | 18ede7365bdc430093e8fd4a90f77369                     |
| revision_end          | None                                                 |
| revision_start        | 2024-05-23T01:17:17.413059+00:00                     |
| started_at            | 2024-05-23T01:17:17.413053+00:00                     |
| type                  | instance_network_interface                           |
| user_id               | b9371d015e0d43dca74f29161448ffd2                     |
+-----------------------+------------------------------------------------------+

# display network incoming bytes

ubuntu@dlp ~(keystone)$
openstack metric measures show 2e4c3906-a0af-4306-b987-89649b97dd19

+---------------------------+-------------+------------+
| timestamp                 | granularity |      value |
+---------------------------+-------------+------------+
| 2024-05-23T01:15:00+00:00 |       300.0 | 32412049.0 |
+---------------------------+-------------+------------+

# display network outgoing bytes

ubuntu@dlp ~(keystone)$
openstack metric measures show 4c9d2c1c-129d-49aa-8efb-918ce2008ca8

+---------------------------+-------------+----------+
| timestamp                 | granularity |    value |
+---------------------------+-------------+----------+
| 2024-05-23T01:15:00+00:00 |       300.0 | 590113.0 |
+---------------------------+-------------+----------+
Matched Content