CentOS Stream 9
Sponsored Link

OpenStack Antelope : How to use Ceilometer (Nova Compute)2023/04/20

 
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  |  |      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  |  |                       |
+-----------------------+  +-----------------------+  +-----------------------+

[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 the end
[notifications]
notify_on_state_change = vm_and_task_state

[oslo_messaging_notifications]
driver = messagingv2

[root@node01 ~]#
systemctl restart openstack-nova-compute

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

[cent@dlp ~(keystone)]$
openstack server list

+--------------------------------------+------------+---------+-------------------------------------+----------------+-----------+
| ID                                   | Name       | Status  | Networks                            | Image          | Flavor    |
+--------------------------------------+------------+---------+-------------------------------------+----------------+-----------+
| 284a5b69-7b76-49c3-8180-c9b22284d429 | CentOS-St9 | SHUTOFF | private=10.0.0.229, 192.168.100.140 | CentOS-Stream9 | m1.medium |
+--------------------------------------+------------+---------+-------------------------------------+----------------+-----------+

[cent@dlp ~(keystone)]$
openstack server start CentOS-St9
# list resources
# data are stored after some operations are done on instance

[cent@dlp ~(keystone)]$
openstack metric resource list

+--------------------------------------+----------------------------+----------------------------------
| id                                   | type                       | project_id                       
+--------------------------------------+----------------------------+----------------------------------
| 284a5b69-7b76-49c3-8180-c9b22284d429 | instance                   | 40aa0807595447f0bd8d5b2dbfa1839b 
| 9e9a6284-5040-5642-ba3b-25542d7f87ac | instance_disk              | 40aa0807595447f0bd8d5b2dbfa1839b 
| 783023d9-7b04-538f-9a5e-74098a7da99a | instance_network_interface | 40aa0807595447f0bd8d5b2dbfa1839b 
+--------------------------------------+----------------------------+----------------------------------
+----------------------------------+-----------------------------------------------------------------------
| user_id                          | original_resource_id                                                  
+----------------------------------+-----------------------------------------------------------------------
| 3c87f0d4e2e6413aa110a4240357cd97 | 284a5b69-7b76-49c3-8180-c9b22284d429                                  
| 3c87f0d4e2e6413aa110a4240357cd97 | 284a5b69-7b76-49c3-8180-c9b22284d429-vda                              
| 3c87f0d4e2e6413aa110a4240357cd97 | instance-00000001-284a5b69-7b76-49c3-8180-c9b22284d429-tape156b0f2-cf 
+----------------------------------+-----------------------------------------------------------------------
+----------------------------------+----------+----------------------------------+--------------
| started_at                       | ended_at | revision_start                   | revision_end 
+----------------------------------+----------+----------------------------------+--------------
| 2023-04-20T00:59:00.341301+00:00 | None     | 2023-04-20T00:59:00.341307+00:00 | None         
| 2023-04-20T01:00:01.978781+00:00 | None     | 2023-04-20T01:00:01.978787+00:00 | None         
| 2023-04-20T01:00:02.091570+00:00 | None     | 2023-04-20T01:00:02.091576+00:00 | None         
+----------------------------------+----------+----------------------------------+--------------
+-------------------------------------------------------------------+
| creator                                                           |
+-------------------------------------------------------------------+
| 372e97ed646e48ddb41c769a446d2094:6d680c2574034967ab496a59d1319a65 |
| 372e97ed646e48ddb41c769a446d2094:6d680c2574034967ab496a59d1319a65 |
| 372e97ed646e48ddb41c769a446d2094:6d680c2574034967ab496a59d1319a65 |
+-------------------------------------------------------------------+

# details of the [instance] resource

[cent@dlp ~(keystone)]$
openstack metric resource show 284a5b69-7b76-49c3-8180-c9b22284d429

+-----------------------+-------------------------------------------------------------------+
| Field                 | Value                                                             |
+-----------------------+-------------------------------------------------------------------+
| created_by_project_id | 6d680c2574034967ab496a59d1319a65                                  |
| created_by_user_id    | 372e97ed646e48ddb41c769a446d2094                                  |
| creator               | 372e97ed646e48ddb41c769a446d2094:6d680c2574034967ab496a59d1319a65 |
| ended_at              | None                                                              |
| id                    | 284a5b69-7b76-49c3-8180-c9b22284d429                              |
| metrics               | cpu: 7454deb6-154d-4ff7-bfe7-99ee7b7c57cf                         |
|                       | disk.ephemeral.size: dc8039bf-324d-41ea-9ef9-9dc0fbc1ce4b         |
|                       | disk.root.size: c933b67f-cb7a-4342-881e-3b467e030ffc              |
|                       | memory.usage: 071cae48-2ef3-49ac-9a76-4b73675ecd0b                |
|                       | memory: 0681e87a-db69-4c9e-8777-f574584ba63c                      |
|                       | vcpus: ee9a65df-a301-4d46-b7f8-1263cec2c077                       |
| original_resource_id  | 284a5b69-7b76-49c3-8180-c9b22284d429                              |
| project_id            | 40aa0807595447f0bd8d5b2dbfa1839b                                  |
| revision_end          | None                                                              |
| revision_start        | 2023-04-20T00:59:00.341307+00:00                                  |
| started_at            | 2023-04-20T00:59:00.341301+00:00                                  |
| type                  | instance                                                          |
| user_id               | 3c87f0d4e2e6413aa110a4240357cd97                                  |
+-----------------------+-------------------------------------------------------------------+

# CPU

[cent@dlp ~(keystone)]$
openstack metric measures show 7454deb6-154d-4ff7-bfe7-99ee7b7c57cf

+---------------------------+-------------+----------------+
| timestamp                 | granularity |          value |
+---------------------------+-------------+----------------+
| 2023-04-20T10:00:00+09:00 |       300.0 |  22420000000.0 |
| 2023-04-20T10:05:00+09:00 |       300.0 | 124200000000.0 |
| 2023-04-20T10:10:00+09:00 |       300.0 | 235810000000.0 |
+---------------------------+-------------+----------------+

# memory usage

[cent@dlp ~(keystone)]$
openstack metric measures show 071cae48-2ef3-49ac-9a76-4b73675ecd0b

+---------------------------+-------------+--------------+
| timestamp                 | granularity |        value |
+---------------------------+-------------+--------------+
| 2023-04-20T10:00:00+09:00 |       300.0 | 403.83984375 |
| 2023-04-20T10:05:00+09:00 |       300.0 |  659.2109375 |
| 2023-04-20T10:10:00+09:00 |       300.0 |  660.3515625 |
+---------------------------+-------------+--------------+

# details of [instance_network_interface]

[cent@dlp ~(keystone)]$
openstack metric resource show 783023d9-7b04-538f-9a5e-74098a7da99a

+-----------------------+-----------------------------------------------------------------------+
| Field                 | Value                                                                 |
+-----------------------+-----------------------------------------------------------------------+
| created_by_project_id | 6d680c2574034967ab496a59d1319a65                                      |
| created_by_user_id    | 372e97ed646e48ddb41c769a446d2094                                      |
| creator               | 372e97ed646e48ddb41c769a446d2094:6d680c2574034967ab496a59d1319a65     |
| ended_at              | None                                                                  |
| id                    | 783023d9-7b04-538f-9a5e-74098a7da99a                                  |
| metrics               | network.incoming.bytes: 6816f269-c883-4486-ae5e-2afa98cb8eed          |
|                       | network.incoming.packets: 8ae1de67-7024-475b-a7a1-2cd7d977244f        |
|                       | network.outgoing.bytes: 33584a7a-030e-48fd-b629-5ee8330b1d29          |
|                       | network.outgoing.packets: e4f7b85b-5cdc-4bd1-8b88-7c50e6d6b4d7        |
| original_resource_id  | instance-00000001-284a5b69-7b76-49c3-8180-c9b22284d429-tape156b0f2-cf |
| project_id            | 40aa0807595447f0bd8d5b2dbfa1839b                                      |
| revision_end          | None                                                                  |
| revision_start        | 2023-04-20T01:00:02.091576+00:00                                      |
| started_at            | 2023-04-20T01:00:02.091570+00:00                                      |
| type                  | instance_network_interface                                            |
| user_id               | 3c87f0d4e2e6413aa110a4240357cd97                                      |
+-----------------------+-----------------------------------------------------------------------+

# display network incoming bytes

[cent@dlp ~(keystone)]$
openstack metric measures show 6816f269-c883-4486-ae5e-2afa98cb8eed

+---------------------------+-------------+-------------+
| timestamp                 | granularity |       value |
+---------------------------+-------------+-------------+
| 2023-04-20T10:00:00+09:00 |       300.0 |      4750.0 |
| 2023-04-20T10:05:00+09:00 |       300.0 | 797485848.0 |
| 2023-04-20T10:10:00+09:00 |       300.0 | 797490172.0 |
+---------------------------+-------------+-------------+

# display network outgoing bytes

[cent@dlp ~(keystone)]$
openstack metric measures show 33584a7a-030e-48fd-b629-5ee8330b1d29

+---------------------------+-------------+-----------+
| timestamp                 | granularity |     value |
+---------------------------+-------------+-----------+
| 2023-04-20T10:00:00+09:00 |       300.0 |    2994.0 |
| 2023-04-20T10:05:00+09:00 |       300.0 | 7881294.0 |
| 2023-04-20T10:10:00+09:00 |       300.0 | 7884644.0 |
+---------------------------+-------------+-----------+
Matched Content