Ubuntu 22.04
Sponsored Link

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

 
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                       
+--------------------------------------+----------------------------+----------------------------------
| 530698ed-413e-4bda-b02e-8f6f60380bd1 | instance                   | f30cd546632e484cb24414d832076... 
| 08fd4272-e83e-5e79-8a9a-05905598f8a5 | instance_network_interface | f30cd546632e484cb24414d832076... 
| 6b32c72e-9cef-54f0-9a38-dc657e110413 | instance_disk              | f30cd546632e484cb24414d832076... 
+--------------------------------------+----------------------------+----------------------------------

root@dlp ~(keystone)#
openstack image list

+--------------------------------------+------------+--------+
| ID                                   | Name       | Status |
+--------------------------------------+------------+--------+
| 2216b5ad-eeb5-4b9a-b862-60b84fdfee1c | 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 "Ubuntu2204-2" --file ubuntu2204.qcow2 --disk-format qcow2 --container-format bare --public

# list resources

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

+--------------------------------------+----------------------------+----------------------------------
| id                                   | type                       | project_id                       
+--------------------------------------+----------------------------+----------------------------------
| 530698ed-413e-4bda-b02e-8f6f60380bd1 | instance                   | f30cd546632e484cb24414d832076... 
| 08fd4272-e83e-5e79-8a9a-05905598f8a5 | instance_network_interface | f30cd546632e484cb24414d832076... 
| 6b32c72e-9cef-54f0-9a38-dc657e110413 | instance_disk              | f30cd546632e484cb24414d832076... 
| d8ba4d4c-0ead-4624-9ae4-d8c706faec31 | image                      | 39e8c6d7a2d14ee581902f0703a53... 
+--------------------------------------+----------------------------+----------------------------------

# details of the [image] resource

root@dlp ~(keystone)#
openstack metric resource show d8ba4d4c-0ead-4624-9ae4-d8c706faec31

+-----------------------+-------------------------------------------------------------------+
| Field                 | Value                                                             |
+-----------------------+-------------------------------------------------------------------+
| created_by_project_id | 04b6d7802d9043cbb09ceb31fd68987b                                  |
| created_by_user_id    | 1a0486c8d8664739b082ae0c97fa0cc3                                  |
| creator               | 1a0486c8d8664739b082ae0c97fa0cc3:04b6d7802d9043cbb09ceb31fd68987b |
| ended_at              | None                                                              |
| id                    | d8ba4d4c-0ead-4624-9ae4-d8c706faec31                              |
| metrics               | image.size: 4238338b-cffe-4748-a138-7ff85b930cf5                  |
| original_resource_id  | d8ba4d4c-0ead-4624-9ae4-d8c706faec31                              |
| project_id            | 39e8c6d7a2d14ee581902f0703a53b66                                  |
| revision_end          | None                                                              |
| revision_start        | 2023-10-10T00:27:17.045819+00:00                                  |
| started_at            | 2023-10-10T00:27:17.045814+00:00                                  |
| type                  | image                                                             |
| user_id               | None                                                              |
+-----------------------+-------------------------------------------------------------------+

# display image size data

root@dlp ~(keystone)#
openstack metric measures show 4238338b-cffe-4748-a138-7ff85b930cf5

+---------------------------+-------------+-------------+
| timestamp                 | granularity |       value |
+---------------------------+-------------+-------------+
| 2023-10-10T09:25:00+09:00 |       300.0 | 675610624.0 |
+---------------------------+-------------+-------------+
Matched Content