Ubuntu 22.04
Sponsored Link

OpenStack Zed : How to use Ceilometer (Glance)2022/10/11

 
This is how to use OpenStack Telemetry Service (Ceilometer) for Glance 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 Glance service to enable Telemetry data collection like follows.
root@dlp ~(keystone)#
vi /etc/glance/glance-api.conf
# add to the end

[oslo_messaging_notifications]
driver = messagingv2
# RabbitMQ connection info
transport_url = rabbit://openstack:password@dlp.srv.world
root@dlp ~(keystone)#
systemctl restart glance-api

[2] It's some example to display metrics and meters.
# display resources

root@dlp ~(keystone)#
openstack metric resource list

+--------------------------------------+----------------------------+----------------------------------
| id                                   | type                       | project_id                       
+--------------------------------------+----------------------------+----------------------------------
| a456ee32-b105-4c5e-8eae-ddccb48f913e | instance                   | 4dd1e1f6bac441ff9c77002c3ab4c58a 
| dff4e871-53dc-5531-a1f2-3da5e7f69191 | instance_network_interface | 4dd1e1f6bac441ff9c77002c3ab4c58a 
| d90cfa81-9edd-51cb-8521-ac01203c3797 | instance_disk              | 4dd1e1f6bac441ff9c77002c3ab4c58a 
+--------------------------------------+----------------------------+----------------------------------

root@dlp ~(keystone)#
openstack image list

+--------------------------------------+------------+--------+
| ID                                   | Name       | Status |
+--------------------------------------+------------+--------+
| 126bc335-fc00-478d-b84a-a9e79eba2574 | Ubuntu2204 | active |
+--------------------------------------+------------+--------+

# test to download an image

root@dlp ~(keystone)#
openstack image save --file ubuntu2204.qcow2 Ubuntu2204

# test to add an image

root@dlp ~(keystone)#
openstack image create "Ubuntu22040-2" --file ubuntu2204.qcow2 --disk-format qcow2 --container-format bare --public

# list resources

root@dlp ~(keystone)#
openstack metric resource list

+--------------------------------------+----------------------------+----------------------------------
| id                                   | type                       | project_id                       
+--------------------------------------+----------------------------+----------------------------------
| a456ee32-b105-4c5e-8eae-ddccb48f913e | instance                   | 4dd1e1f6bac441ff9c77002c3ab4c58a 
| dff4e871-53dc-5531-a1f2-3da5e7f69191 | instance_network_interface | 4dd1e1f6bac441ff9c77002c3ab4c58a 
| d90cfa81-9edd-51cb-8521-ac01203c3797 | instance_disk              | 4dd1e1f6bac441ff9c77002c3ab4c58a 
| ce8f7bc5-5731-428e-baae-48a15d29a8ef | image                      | 231a529f51394426b07c56f2c5ec580e 
+--------------------------------------+----------------------------+----------------------------------

# details of the [image] resource

root@dlp ~(keystone)#
openstack metric resource show d78f9dee-5f23-4fc7-9c17-9a58935ec561

+-----------------------+-------------------------------------------------------------------+
| Field                 | Value                                                             |
+-----------------------+-------------------------------------------------------------------+
| created_by_project_id | ee51c09c765e4a4d958c2bcc4dbb5665                                  |
| created_by_user_id    | 1070f194127a4a52aca630dab3365662                                  |
| creator               | 1070f194127a4a52aca630dab3365662:ee51c09c765e4a4d958c2bcc4dbb5665 |
| ended_at              | None                                                              |
| id                    | ce8f7bc5-5731-428e-baae-48a15d29a8ef                              |
| metrics               | image.size: da2fa9e3-536c-4633-9717-7f3f8e77c7ec                  |
| original_resource_id  | ce8f7bc5-5731-428e-baae-48a15d29a8ef                              |
| project_id            | 231a529f51394426b07c56f2c5ec580e                                  |
| revision_end          | None                                                              |
| revision_start        | 2022-10-11T00:43:24.055007+00:00                                  |
| started_at            | 2022-10-11T00:43:24.055001+00:00                                  |
| type                  | image                                                             |
| user_id               | None                                                              |
+-----------------------+-------------------------------------------------------------------+

# display image size data

root@dlp ~(keystone)#
openstack metric measures show da2fa9e3-536c-4633-9717-7f3f8e77c7ec

+---------------------------+-------------+-------------+
| timestamp                 | granularity |       value |
+---------------------------+-------------+-------------+
| 2022-10-11T00:40:00+00:00 |       300.0 | 661716992.0 |
+---------------------------+-------------+-------------+
Matched Content