CentOS Stream 9
Sponsored Link

OpenStack Bobcat : How to use Ceilometer (Glance)2023/10/27

 
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                       
+--------------------------------------+----------------------------+----------------------------------
| 78b8c394-be14-4312-84e8-06eeebbd74f3 | instance                   | f4598dfd3b8a47149234b6892d18d... 
| c9aff847-aa53-5449-b384-1fcd612499fd | instance_network_interface | f4598dfd3b8a47149234b6892d18d... 
| e2b0e7f8-a93f-5ec4-851f-9e98ec9cd596 | instance_disk              | f4598dfd3b8a47149234b6892d18d... 
+--------------------------------------+----------------------------+----------------------------------

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

+--------------------------------------+----------------+--------+
| ID                                   | Name           | Status |
+--------------------------------------+----------------+--------+
| bcbaa323-2438-4f5e-9473-49f633bb8f9b | 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                       
+--------------------------------------+----------------------------+----------------------------------
| 78b8c394-be14-4312-84e8-06eeebbd74f3 | instance                   | f4598dfd3b8a47149234b6892d18d... 
| c9aff847-aa53-5449-b384-1fcd612499fd | instance_network_interface | f4598dfd3b8a47149234b6892d18d... 
| e2b0e7f8-a93f-5ec4-851f-9e98ec9cd596 | instance_disk              | f4598dfd3b8a47149234b6892d18d... 
| ad123651-8777-4397-8006-c6dc58dceefb | image                      | d9d13fdc603c42f69a0ea034b64a3... 
+--------------------------------------+----------------------------+----------------------------------

# details of the resource

[root@dlp ~(keystone)]#
openstack metric resource show ad123651-8777-4397-8006-c6dc58dceefb

+-----------------------+-------------------------------------------------------------------+
| Field                 | Value                                                             |
+-----------------------+-------------------------------------------------------------------+
| created_by_project_id | 5d97881520b34e6bbf1f15e778c82fe4                                  |
| created_by_user_id    | be0b90dfc5d24277ae1bfd45e4cac1f8                                  |
| creator               | be0b90dfc5d24277ae1bfd45e4cac1f8:5d97881520b34e6bbf1f15e778c82fe4 |
| ended_at              | None                                                              |
| id                    | ad123651-8777-4397-8006-c6dc58dceefb                              |
| metrics               | image.size: ef84a4bc-49a2-4f64-a81c-1019de973b24                  |
| original_resource_id  | ad123651-8777-4397-8006-c6dc58dceefb                              |
| project_id            | d9d13fdc603c42f69a0ea034b64a3cdb                                  |
| revision_end          | None                                                              |
| revision_start        | 2023-10-27T01:03:00.043566+00:00                                  |
| started_at            | 2023-10-27T01:03:00.043559+00:00                                  |
| type                  | image                                                             |
| user_id               | None                                                              |
+-----------------------+-------------------------------------------------------------------+

# display image size data

[root@dlp ~(keystone)]#
openstack metric measures show ef84a4bc-49a2-4f64-a81c-1019de973b24

+---------------------------+-------------+--------------+
| timestamp                 | granularity |        value |
+---------------------------+-------------+--------------+
| 2023-10-27T10:00:00+09:00 |       300.0 | 3478323200.0 |
+---------------------------+-------------+--------------+
Matched Content