Ubuntu 20.04
Sponsored Link

OpenStack Yoga : How to use Ceilometer (Nova Compute)2022/04/12

 
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
+-----------+-----------+   +-----------+-----------+   +-----------+-----------+
|    [ Control Node ]   |   |    [ Storage Node ]   |   |    [ Compute Node ]   |
|                       |   |                       |   |                       |
|  MariaDB    RabbitMQ  |   |      Open vSwitch     |   |        Libvirt        |
|  Memcached  httpd     |   |     Neutron Server    |   |     Nova Compute      |
|  Keystone   Glance    |   |       OVN-Northd      |   |      Open vSwitch     |
|  Nova API             |   |     Cinder Volume     |   |   OVN Metadata Agent  |
|  Cinder API           |   |    Heat API/Engine    |   |     OVN-Controller    |
|                       |   |    Gnocchi   httpd    |   |   Ceilometer Compute  |
|                       |   |   Ceilometer Central  |   |                       |
+-----------------------+   +-----------------------+   +-----------------------+

[1] Change settings for Nova Compute service to enable Telemetry data collention 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 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   |
+--------------------------------------+-------------+---------+------------------------------------+------------+----------+
| 7ea894ee-3a91-4541-96ba-717ff45917c5 | Ubuntu-2004 | SHUTOFF | private=10.0.0.230, 192.168.100.12 | Ubuntu2004 | m1.small |
+--------------------------------------+-------------+---------+------------------------------------+------------+----------+

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

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

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

+--------------------------------------+----------------------------+----------------------------------
| id                                   | type                       | project_id                       
+--------------------------------------+----------------------------+----------------------------------
| 7ea894ee-3a91-4541-96ba-717ff45917c5 | instance                   | d3434f55aa5541cfab5f13916da0697d 
| 250af39c-0514-5aab-b416-7f01b8b01e19 | instance_disk              | d3434f55aa5541cfab5f13916da0697d 
| cb389274-fbb8-536a-9df0-a8d5d6bc8a2f | instance_network_interface | d3434f55aa5541cfab5f13916da0697d 
+--------------------------------------+----------------------------+----------------------------------
+----------------------------------+-----------------------------------------------------------------------
| user_id                          | original_resource_id                                                  
+----------------------------------+-----------------------------------------------------------------------
| 95f196a1851c4b93b016871f7d5ded82 | 7ea894ee-3a91-4541-96ba-717ff45917c5                                  
| 95f196a1851c4b93b016871f7d5ded82 | 7ea894ee-3a91-4541-96ba-717ff45917c5-vda                              
| 95f196a1851c4b93b016871f7d5ded82 | instance-00000001-7ea894ee-3a91-4541-96ba-717ff45917c5-tapa64b94f9-0d 
+----------------------------------+-----------------------------------------------------------------------
+----------------------------------+----------+----------------------------------+--------------
| started_at                       | ended_at | revision_start                   | revision_end 
+----------------------------------+----------+----------------------------------+--------------
| 2022-04-12T00:22:21.134406+00:00 | None     | 2022-04-12T00:22:21.134415+00:00 | None         
| 2022-04-12T00:26:27.656086+00:00 | None     | 2022-04-12T00:26:27.656092+00:00 | None         
| 2022-04-12T00:26:27.674702+00:00 | None     | 2022-04-12T00:26:27.674711+00:00 | None         
+----------------------------------+----------+----------------------------------+--------------
+-------------------------------------------------------------------+
| creator                                                           |
+-------------------------------------------------------------------+
| 4dde18e4717d4936ad5dea946de3d41f:c043fb355eff47e69642adfcd7a55620 |
| 4dde18e4717d4936ad5dea946de3d41f:c043fb355eff47e69642adfcd7a55620 |
| 4dde18e4717d4936ad5dea946de3d41f:c043fb355eff47e69642adfcd7a55620 |
+-------------------------------------------------------------------+

# details of the [instance] resource

ubuntu@dlp ~(keystone)$
openstack metric resource show 7ea894ee-3a91-4541-96ba-717ff45917c5

+-----------------------+-------------------------------------------------------------------+
| Field                 | Value                                                             |
+-----------------------+-------------------------------------------------------------------+
| created_by_project_id | c043fb355eff47e69642adfcd7a55620                                  |
| created_by_user_id    | 4dde18e4717d4936ad5dea946de3d41f                                  |
| creator               | 4dde18e4717d4936ad5dea946de3d41f:c043fb355eff47e69642adfcd7a55620 |
| ended_at              | None                                                              |
| id                    | 7ea894ee-3a91-4541-96ba-717ff45917c5                              |
| metrics               | cpu: b9f3ff28-1984-4c64-8008-5ea7b7ae8ad9                         |
|                       | disk.ephemeral.size: bedab3c8-5ea0-40f4-b488-cea3445761ad         |
|                       | disk.root.size: 9f38f535-18dc-402f-8efc-672b9ff1229d              |
|                       | memory.usage: 758e84bd-146b-4c8e-9178-9449e852554f                |
|                       | memory: 8e02f719-5cb6-476f-9c2b-7d40f2d90014                      |
|                       | vcpus: 6e92ddc7-7412-466f-a076-69ed39a174ea                       |
| original_resource_id  | 7ea894ee-3a91-4541-96ba-717ff45917c5                              |
| project_id            | d3434f55aa5541cfab5f13916da0697d                                  |
| revision_end          | None                                                              |
| revision_start        | 2022-04-12T00:22:21.134415+00:00                                  |
| started_at            | 2022-04-12T00:22:21.134406+00:00                                  |
| type                  | instance                                                          |
| user_id               | 95f196a1851c4b93b016871f7d5ded82                                  |
+-----------------------+-------------------------------------------------------------------+

# CPU

ubuntu@dlp ~(keystone)$
openstack metric measures show b9f3ff28-1984-4c64-8008-5ea7b7ae8ad9

+---------------------------+-------------+---------------+
| timestamp                 | granularity |         value |
+---------------------------+-------------+---------------+
| 2022-04-12T09:25:00+09:00 |       300.0 | 78590000000.0 |
+---------------------------+-------------+---------------+

# memory usage

ubuntu@dlp ~(keystone)$
openstack metric measures show 758e84bd-146b-4c8e-9178-9449e852554f

+---------------------------+-------------+-------------+
| timestamp                 | granularity |       value |
+---------------------------+-------------+-------------+
| 2022-04-12T09:25:00+09:00 |       300.0 | 324.9765625 |
+---------------------------+-------------+-------------+

# details of [instance_network_interface]

ubuntu@dlp ~(keystone)$
openstack metric resource show cb389274-fbb8-536a-9df0-a8d5d6bc8a2f

+-----------------------+-----------------------------------------------------------------------+
| Field                 | Value                                                                 |
+-----------------------+-----------------------------------------------------------------------+
| created_by_project_id | c043fb355eff47e69642adfcd7a55620                                      |
| created_by_user_id    | 4dde18e4717d4936ad5dea946de3d41f                                      |
| creator               | 4dde18e4717d4936ad5dea946de3d41f:c043fb355eff47e69642adfcd7a55620     |
| ended_at              | None                                                                  |
| id                    | cb389274-fbb8-536a-9df0-a8d5d6bc8a2f                                  |
| metrics               | network.incoming.bytes: 6ebe95d7-d98e-49b2-93c5-229f14a22872          |
|                       | network.incoming.packets: dd53b4e7-8c1b-4635-a84b-274873f327f5        |
|                       | network.outgoing.bytes: 27cb77df-9c85-460c-b9e0-929de56c9333          |
|                       | network.outgoing.packets: 9881e9b2-bf30-49ce-9cec-50857e61014d        |
| original_resource_id  | instance-00000001-7ea894ee-3a91-4541-96ba-717ff45917c5-tapa64b94f9-0d |
| project_id            | d3434f55aa5541cfab5f13916da0697d                                      |
| revision_end          | None                                                                  |
| revision_start        | 2022-04-12T00:26:27.674711+00:00                                      |
| started_at            | 2022-04-12T00:26:27.674702+00:00                                      |
| type                  | instance_network_interface                                            |
| user_id               | 95f196a1851c4b93b016871f7d5ded82                                      |
+-----------------------+-----------------------------------------------------------------------+

# display network incoming bytes

ubuntu@dlp ~(keystone)$
openstack metric measures show 6ebe95d7-d98e-49b2-93c5-229f14a22872

+---------------------------+-------------+------------+
| timestamp                 | granularity |      value |
+---------------------------+-------------+------------+
| 2022-04-12T09:25:00+09:00 |       300.0 | 42343775.0 |
+---------------------------+-------------+------------+

# display network outgoing bytes

ubuntu@dlp ~(keystone)$
openstack metric measures show 27cb77df-9c85-460c-b9e0-929de56c9333

+---------------------------+-------------+----------+
| timestamp                 | granularity |    value |
+---------------------------+-------------+----------+
| 2022-04-12T09:25:00+09:00 |       300.0 | 433816.0 |
+---------------------------+-------------+----------+
Matched Content