CentOS Stream 8
Sponsored Link

OpenStack Victoria : How to use Ceilometer (Nova Compute)
2021/03/30
 
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 ]   |   |    [ Network 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           |   |      iSCSI Target     |   |     OVN-Controller    |
|  Gnocchi              |   |     Heat API/Engine   |   |   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
notify_on_state_change = vm_and_task_state
# add to the end

[oslo_messaging_notifications]
driver = messagingv2
[root@node01 ~]#
systemctl restart openstack-nova-compute

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

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

+--------------------------------------+-------------+---------+------------------------------------+-----------------+----------+
| ID                                   | Name        | Status  | Networks                           | Image           | Flavor   |
+--------------------------------------+-------------+---------+------------------------------------+-----------------+----------+
| da1c8adc-4733-4ee5-a654-49d652a6aaa3 | CentOS-St-8 | SHUTOFF | private=192.168.100.63, 10.0.0.253 | CentOS-Stream-8 | m1.small |
+--------------------------------------+-------------+---------+------------------------------------+-----------------+----------+

[cent@dlp ~(keystone)]$
openstack server start CentOS-St-8
# list resources

# data are gotten after some operations are done on instance

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

+--------------------------------------+----------------------------+----------------------------------
| id                                   | type                       | project_id                       
+--------------------------------------+----------------------------+----------------------------------
| da1c8adc-4733-4ee5-a654-49d652a6aaa3 | instance                   | f1f04d774d2141fb9acabd28d0e00c33 
| 21b1221b-a0db-5f1c-8c92-ae02f7064202 | instance_disk              | f1f04d774d2141fb9acabd28d0e00c33 
| 23721353-784e-571f-9f47-fecb17e1c51d | instance_network_interface | f1f04d774d2141fb9acabd28d0e00c33 
+--------------------------------------+----------------------------+----------------------------------
+----------------------------------+-----------------------------------------------------------------------
| user_id                          | original_resource_id                                                  
+----------------------------------+-----------------------------------------------------------------------
| e08c35de3b6746bd9518c97f7068a71e | da1c8adc-4733-4ee5-a654-49d652a6aaa3                                  
| e08c35de3b6746bd9518c97f7068a71e | da1c8adc-4733-4ee5-a654-49d652a6aaa3-vda                              
| e08c35de3b6746bd9518c97f7068a71e | instance-00000001-da1c8adc-4733-4ee5-a654-49d652a6aaa3-tap8f9f2096-87 
+----------------------------------+-----------------------------------------------------------------------
+----------------------------------+----------+----------------------------------+--------------
| started_at                       | ended_at | revision_start                   | revision_end 
+----------------------------------+----------+----------------------------------+--------------
| 2021-03-30T06:52:43.426925+00:00 | None     | 2021-03-30T06:52:43.426934+00:00 | None         
| 2021-03-30T06:55:02.484123+00:00 | None     | 2021-03-30T06:55:02.484131+00:00 | None         
| 2021-03-30T06:55:02.493979+00:00 | None     | 2021-03-30T06:55:02.493989+00:00 | None         
+----------------------------------+----------+----------------------------------+--------------
+-------------------------------------------------------------------+
| creator                                                           |
+-------------------------------------------------------------------+
| 66a09b5dee7b451fb4cb4216ef7067be:affa3a6446154e37adfd233c437bacc1 |
| 66a09b5dee7b451fb4cb4216ef7067be:affa3a6446154e37adfd233c437bacc1 |
| 66a09b5dee7b451fb4cb4216ef7067be:affa3a6446154e37adfd233c437bacc1 |
+-------------------------------------------------------------------+

# details of the [instance] resource

[cent@dlp ~(keystone)]$
openstack metric resource show da1c8adc-4733-4ee5-a654-49d652a6aaa3

+-----------------------+-------------------------------------------------------------------+
| Field                 | Value                                                             |
+-----------------------+-------------------------------------------------------------------+
| created_by_project_id | affa3a6446154e37adfd233c437bacc1                                  |
| created_by_user_id    | 66a09b5dee7b451fb4cb4216ef7067be                                  |
| creator               | 66a09b5dee7b451fb4cb4216ef7067be:affa3a6446154e37adfd233c437bacc1 |
| ended_at              | None                                                              |
| id                    | da1c8adc-4733-4ee5-a654-49d652a6aaa3                              |
| metrics               | cpu: 77a5da85-ee67-4c74-900c-eb62346b7000                         |
|                       | disk.ephemeral.size: 9004e80e-6b6a-4595-9876-add2bf51afda         |
|                       | disk.root.size: 23f1672d-9151-4056-a277-71a77fad0711              |
|                       | memory.usage: b381a7f7-b134-49dc-981f-55d76ad06bee                |
|                       | memory: feec4de8-45f7-4565-a475-0a372467c3a1                      |
|                       | vcpus: a6db2636-f230-47d7-9b3a-3659fdc26d62                       |
| original_resource_id  | da1c8adc-4733-4ee5-a654-49d652a6aaa3                              |
| project_id            | f1f04d774d2141fb9acabd28d0e00c33                                  |
| revision_end          | None                                                              |
| revision_start        | 2021-03-30T06:52:43.426934+00:00                                  |
| started_at            | 2021-03-30T06:52:43.426925+00:00                                  |
| type                  | instance                                                          |
| user_id               | e08c35de3b6746bd9518c97f7068a71e                                  |
+-----------------------+-------------------------------------------------------------------+

# CPU

[cent@dlp ~(keystone)]$
openstack metric measures show 77a5da85-ee67-4c74-900c-eb62346b7000

+---------------------------+-------------+----------------+
| timestamp                 | granularity |          value |
+---------------------------+-------------+----------------+
| 2021-03-30T15:55:00+09:00 |       300.0 |  33240000000.0 |
| 2021-03-30T16:00:00+09:00 |       300.0 |  34530000000.0 |
| 2021-03-30T16:05:00+09:00 |       300.0 |  36420000000.0 |
| 2021-03-30T16:10:00+09:00 |       300.0 | 178830000000.0 |
+---------------------------+-------------+----------------+

# memory usage

[cent@dlp ~(keystone)]$
openstack metric measures show b381a7f7-b134-49dc-981f-55d76ad06bee

+---------------------------+-------------+-------------+
| timestamp                 | granularity |       value |
+---------------------------+-------------+-------------+
| 2021-03-30T15:55:00+09:00 |       300.0 |  295.359375 |
| 2021-03-30T16:00:00+09:00 |       300.0 |  295.203125 |
| 2021-03-30T16:05:00+09:00 |       300.0 | 296.6484375 |
| 2021-03-30T16:10:00+09:00 |       300.0 | 310.2421875 |
+---------------------------+-------------+-------------+

# details of [instance_network_interface]

[cent@dlp ~(keystone)]$
openstack metric resource show 23721353-784e-571f-9f47-fecb17e1c51d

+-----------------------+-----------------------------------------------------------------------+
| Field                 | Value                                                                 |
+-----------------------+-----------------------------------------------------------------------+
| created_by_project_id | affa3a6446154e37adfd233c437bacc1                                      |
| created_by_user_id    | 66a09b5dee7b451fb4cb4216ef7067be                                      |
| creator               | 66a09b5dee7b451fb4cb4216ef7067be:affa3a6446154e37adfd233c437bacc1     |
| ended_at              | None                                                                  |
| id                    | 23721353-784e-571f-9f47-fecb17e1c51d                                  |
| metrics               | network.incoming.bytes: 178d4f64-179a-46ac-a4e7-ebf586dd502b          |
|                       | network.incoming.packets: e84ec059-3743-4752-97cd-d962b3cb3290        |
|                       | network.outgoing.bytes: fb907fa7-1ec6-4c11-be3c-76e9d664ea9f          |
|                       | network.outgoing.packets: 7734ef19-e3fa-46be-b568-7dff6cbad832        |
| original_resource_id  | instance-00000001-da1c8adc-4733-4ee5-a654-49d652a6aaa3-tap8f9f2096-87 |
| project_id            | f1f04d774d2141fb9acabd28d0e00c33                                      |
| revision_end          | None                                                                  |
| revision_start        | 2021-03-30T06:55:02.493989+00:00                                      |
| started_at            | 2021-03-30T06:55:02.493979+00:00                                      |
| type                  | instance_network_interface                                            |
| user_id               | e08c35de3b6746bd9518c97f7068a71e                                      |
+-----------------------+-----------------------------------------------------------------------+

# display network incoming bytes

[cent@dlp ~(keystone)]$
openstack metric measures show 178d4f64-179a-46ac-a4e7-ebf586dd502b

+---------------------------+-------------+------------+
| timestamp                 | granularity |      value |
+---------------------------+-------------+------------+
| 2021-03-30T15:55:00+09:00 |       300.0 |     4136.0 |
| 2021-03-30T16:00:00+09:00 |       300.0 |     6216.0 |
| 2021-03-30T16:05:00+09:00 |       300.0 |     7894.0 |
| 2021-03-30T16:10:00+09:00 |       300.0 | 19928976.0 |
+---------------------------+-------------+------------+

# display network outgoing bytes

[cent@dlp ~(keystone)]$
openstack metric measures show fb907fa7-1ec6-4c11-be3c-76e9d664ea9f

+---------------------------+-------------+----------+
| timestamp                 | granularity |    value |
+---------------------------+-------------+----------+
| 2021-03-30T15:55:00+09:00 |       300.0 |   3341.0 |
| 2021-03-30T16:00:00+09:00 |       300.0 |   5491.0 |
| 2021-03-30T16:05:00+09:00 |       300.0 |   7169.0 |
| 2021-03-30T16:10:00+09:00 |       300.0 | 317115.0 |
+---------------------------+-------------+----------+
Matched Content