CentOS Stream 9
Sponsored Link

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

 
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 openstack-glance-api

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

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

+--------------------------------------+----------------------------+----------------------------------
| id                                   | type                       | project_id                       
+--------------------------------------+----------------------------+----------------------------------
| 284a5b69-7b76-49c3-8180-c9b22284d429 | instance                   | 40aa0807595447f0bd8d5b2dbfa18... 
| 9e9a6284-5040-5642-ba3b-25542d7f87ac | instance_disk              | 40aa0807595447f0bd8d5b2dbfa18... 
| 783023d9-7b04-538f-9a5e-74098a7da99a | instance_network_interface | 40aa0807595447f0bd8d5b2dbfa18... 
+--------------------------------------+----------------------------+----------------------------------

[root@dlp ~(keystone)]#
openstack image list

+--------------------------------------+----------------+--------+
| ID                                   | Name           | Status |
+--------------------------------------+----------------+--------+
| 17d50b54-c009-45ff-96ed-58086f79065f | CentOS-Stream9 | active |
+--------------------------------------+----------------+--------+

# test to download an image

[root@dlp ~(keystone)]#
openstack image save --file centos-st9.qcow2 CentOS-Stream9

# test to add an image

[root@dlp ~(keystone)]#
openstack image create "CentOS-ST9" --file centos-st9.qcow2 --disk-format qcow2 --container-format bare --public

# list resources

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

+--------------------------------------+----------------------------+----------------------------------
| id                                   | type                       | project_id                       
+--------------------------------------+----------------------------+----------------------------------
| 284a5b69-7b76-49c3-8180-c9b22284d429 | instance                   | 40aa0807595447f0bd8d5b2dbfa18... 
| 9e9a6284-5040-5642-ba3b-25542d7f87ac | instance_disk              | 40aa0807595447f0bd8d5b2dbfa18... 
| 783023d9-7b04-538f-9a5e-74098a7da99a | instance_network_interface | 40aa0807595447f0bd8d5b2dbfa18... 
| 2203c888-763a-4b28-9fc4-f61fb5b6d152 | image                      | fa1902e20298477e9e065c0a330e1... 
+--------------------------------------+----------------------------+----------------------------------

# details of the resource

[root@dlp ~(keystone)]#
openstack metric resource show 2203c888-763a-4b28-9fc4-f61fb5b6d152

+-----------------------+-------------------------------------------------------------------+
| Field                 | Value                                                             |
+-----------------------+-------------------------------------------------------------------+
| created_by_project_id | 6d680c2574034967ab496a59d1319a65                                  |
| created_by_user_id    | 372e97ed646e48ddb41c769a446d2094                                  |
| creator               | 372e97ed646e48ddb41c769a446d2094:6d680c2574034967ab496a59d1319a65 |
| ended_at              | None                                                              |
| id                    | 2203c888-763a-4b28-9fc4-f61fb5b6d152                              |
| metrics               | image.size: 7f2dd5b2-700c-4418-83ce-c29a2fa3aca5                  |
| original_resource_id  | 2203c888-763a-4b28-9fc4-f61fb5b6d152                              |
| project_id            | fa1902e20298477e9e065c0a330e1b6f                                  |
| revision_end          | None                                                              |
| revision_start        | 2023-04-20T01:26:03.799009+00:00                                  |
| started_at            | 2023-04-20T01:26:03.799003+00:00                                  |
| type                  | image                                                             |
| user_id               | None                                                              |
+-----------------------+-------------------------------------------------------------------+

# display image size data

[root@dlp ~(keystone)]#
openstack metric measures show 7f2dd5b2-700c-4418-83ce-c29a2fa3aca5

+---------------------------+-------------+--------------+
| timestamp                 | granularity |        value |
+---------------------------+-------------+--------------+
| 2023-04-20T10:25:00+09:00 |       300.0 | 2989621248.0 |
+---------------------------+-------------+--------------+
Matched Content