Ubuntu 22.04
Sponsored Link

OpenStack Antelope : How to use Ceilometer (Glance)2023/03/29

 
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                       
+--------------------------------------+----------------------------+----------------------------------
| 11987eec-fb38-4de1-a386-3d1d6001bbd3 | instance                   | e294bd7c00314facacdb46c36fb54... 
| 29b605b9-5568-5534-b3c4-470045cbcbe0 | instance_network_interface | e294bd7c00314facacdb46c36fb54... 
| 55b09db0-31af-58e5-ab82-da9b1d35c949 | instance_disk              | e294bd7c00314facacdb46c36fb54... 
+--------------------------------------+----------------------------+----------------------------------

root@dlp ~(keystone)#
openstack image list

+--------------------------------------+------------+--------+
| ID                                   | Name       | Status |
+--------------------------------------+------------+--------+
| 00ea6e97-0e97-4cb4-8ac4-2409c28f0289 | 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                       
+--------------------------------------+----------------------------+----------------------------------
| 11987eec-fb38-4de1-a386-3d1d6001bbd3 | instance                   | e294bd7c00314facacdb46c36fb54... 
| 29b605b9-5568-5534-b3c4-470045cbcbe0 | instance_network_interface | e294bd7c00314facacdb46c36fb54... 
| 55b09db0-31af-58e5-ab82-da9b1d35c949 | instance_disk              | e294bd7c00314facacdb46c36fb54... 
| 1bcc0947-1293-458c-8ab7-f3760b568c4d | image                      | cac657ec003e4c95aaaa30bc03218... 
+--------------------------------------+----------------------------+----------------------------------

# details of the [image] resource

root@dlp ~(keystone)#
openstack metric resource show 1bcc0947-1293-458c-8ab7-f3760b568c4d

+-----------------------+-------------------------------------------------------------------+
| Field                 | Value                                                             |
+-----------------------+-------------------------------------------------------------------+
| created_by_project_id | d3dd87fb1a034f7883539a6a4f83781f                                  |
| created_by_user_id    | f88cfb33fa07437ca440ee5ef5642c95                                  |
| creator               | f88cfb33fa07437ca440ee5ef5642c95:d3dd87fb1a034f7883539a6a4f83781f |
| ended_at              | None                                                              |
| id                    | 1bcc0947-1293-458c-8ab7-f3760b568c4d                              |
| metrics               | image.size: 8cc5f283-63a5-451f-b81a-8168693c43f4                  |
| original_resource_id  | 1bcc0947-1293-458c-8ab7-f3760b568c4d                              |
| project_id            | cac657ec003e4c95aaaa30bc0321895f                                  |
| revision_end          | None                                                              |
| revision_start        | 2023-03-29T02:20:46.439182+00:00                                  |
| started_at            | 2023-03-29T02:20:46.439177+00:00                                  |
| type                  | image                                                             |
| user_id               | None                                                              |
+-----------------------+-------------------------------------------------------------------+

# display image size data

root@dlp ~(keystone)#
openstack metric measures show 8cc5f283-63a5-451f-b81a-8168693c43f4

+---------------------------+-------------+-------------+
| timestamp                 | granularity |       value |
+---------------------------+-------------+-------------+
| 2023-03-29T11:20:00+09:00 |       300.0 | 684916736.0 |
+---------------------------+-------------+-------------+
Matched Content