Ubuntu 20.04
Sponsored Link

OpenStack Yoga : How to use Ceilometer (Glance)2022/04/12

 
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
+-----------+-----------+   +-----------+-----------+   +-----------+-----------+
|    [ Control Node ]   |   |    [ Storage Node ]   |   |    [ Compute Node ]   |
|                       |   |                       |   |                       |
|  MariaDB    RabbitMQ  |   |      Open vSwitch     |   |        Libvirt        |
|  Memcached  httpd     |   |     Neutron Server    |   |     Nova Compute      |
|  Keystone   Glance    |   |       OVN-Northd      |   |      Open vSwitch     |
|  Nova API             |   |     Cinder Volume     |   |   OVN Metadata Agent  |
|  Cinder API           |   |    Heat API/Engine    |   |     OVN-Controller    |
|                       |   |    Gnocchi   httpd    |   |   Ceilometer Compute  |
|                       |   |   Ceilometer Central  |   |                       |
+-----------------------+   +-----------------------+   +-----------------------+

[1] Change settings for Glance service to enable Telemetry data collention 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@10.0.0.30
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                       
+--------------------------------------+----------------------------+----------------------------------
| 7ea894ee-3a91-4541-96ba-717ff45917c5 | instance                   | d3434f55aa5541cfab5f13916da06... 
| 250af39c-0514-5aab-b416-7f01b8b01e19 | instance_disk              | d3434f55aa5541cfab5f13916da06... 
| cb389274-fbb8-536a-9df0-a8d5d6bc8a2f | instance_network_interface | d3434f55aa5541cfab5f13916da06... 
+--------------------------------------+----------------------------+----------------------------------

root@dlp ~(keystone)#
openstack image list

+--------------------------------------+------------+--------+
| ID                                   | Name       | Status |
+--------------------------------------+------------+--------+
| 53f6415a-1f98-485f-be0b-3f80edf523df | Ubuntu2004 | active |
+--------------------------------------+------------+--------+

# test to download an image

root@dlp ~(keystone)#
openstack image save --file ubuntu2004.qcow2 Ubuntu2004

# test to add an image

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

# list resources

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

+--------------------------------------+----------------------------+----------------------------------
| id                                   | type                       | project_id                       
+--------------------------------------+----------------------------+----------------------------------
| 7ea894ee-3a91-4541-96ba-717ff45917c5 | instance                   | d3434f55aa5541cfab5f13916da06... 
| 250af39c-0514-5aab-b416-7f01b8b01e19 | instance_disk              | d3434f55aa5541cfab5f13916da06... 
| cb389274-fbb8-536a-9df0-a8d5d6bc8a2f | instance_network_interface | d3434f55aa5541cfab5f13916da06... 
| 32165353-97a9-46b8-927b-e045a3cd8ced | image                      | ddb7c08ba73a48eea040270d13a7b... 
+--------------------------------------+----------------------------+----------------------------------

# details of the [image] resource

root@dlp ~(keystone)#
openstack metric resource show 32165353-97a9-46b8-927b-e045a3cd8ced

+-----------------------+-------------------------------------------------------------------+
| Field                 | Value                                                             |
+-----------------------+-------------------------------------------------------------------+
| created_by_project_id | c043fb355eff47e69642adfcd7a55620                                  |
| created_by_user_id    | 4dde18e4717d4936ad5dea946de3d41f                                  |
| creator               | 4dde18e4717d4936ad5dea946de3d41f:c043fb355eff47e69642adfcd7a55620 |
| ended_at              | None                                                              |
| id                    | 32165353-97a9-46b8-927b-e045a3cd8ced                              |
| metrics               | image.size: f513cd78-d93c-4e44-a682-2059fd07b010                  |
| original_resource_id  | 32165353-97a9-46b8-927b-e045a3cd8ced                              |
| project_id            | ddb7c08ba73a48eea040270d13a7b0cf                                  |
| revision_end          | None                                                              |
| revision_start        | 2022-04-12T00:38:04.527017+00:00                                  |
| started_at            | 2022-04-12T00:38:04.527006+00:00                                  |
| type                  | image                                                             |
| user_id               | None                                                              |
+-----------------------+-------------------------------------------------------------------+

# display image size data

root@dlp ~(keystone)#
openstack metric measures show f513cd78-d93c-4e44-a682-2059fd07b010

+---------------------------+-------------+-------------+
| timestamp                 | granularity |       value |
+---------------------------+-------------+-------------+
| 2022-04-12T09:35:00+09:00 |       300.0 | 593756160.0 |
+---------------------------+-------------+-------------+
Matched Content