CentOS Stream 8
Sponsored Link

OpenStack Xena : How to use Ceilometer (Glance)2021/11/25

 
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 ]   |   |    [ Network 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           |   |      iSCSI Target     |   |     OVN-Controller    |
|                       |   |     Heat API/Engine   |   |   Ceilometer Compute  |
|                       |   |     Gnocchi httpd     |   |                       |
|                       |   |   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 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                       
+--------------------------------------+----------------------------+----------------------------------
| a6180855-77cf-476f-9f26-4fc79baa38c2 | instance                   | 2decda8bcd724687a1cf05064ab21... 
| 5624383f-677b-598e-a43b-4eb1a1cb5afd | instance_disk              | 2decda8bcd724687a1cf05064ab21... 
| d83f7af1-8e5c-52a0-b151-0a0ee0978e9a | instance_network_interface | 2decda8bcd724687a1cf05064ab21... 
+--------------------------------------+----------------------------+----------------------------------

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

+--------------------------------------+-----------------+--------+
| ID                                   | Name            | Status |
+--------------------------------------+-----------------+--------+
| cfce605e-151b-43dd-b743-2c7988d69e96 | CentOS-Stream-8 | active |
+--------------------------------------+-----------------+--------+

# test to download an image

[root@dlp ~(keystone)]#
openstack image save --file centos-st8.qcow2 CentOS-Stream-8

# test to add an image

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

# list resources

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

+--------------------------------------+----------------------------+----------------------------------
| id                                   | type                       | project_id                       
+--------------------------------------+----------------------------+----------------------------------
| a6180855-77cf-476f-9f26-4fc79baa38c2 | instance                   | 2decda8bcd724687a1cf05064ab21... 
| 5624383f-677b-598e-a43b-4eb1a1cb5afd | instance_disk              | 2decda8bcd724687a1cf05064ab21... 
| d83f7af1-8e5c-52a0-b151-0a0ee0978e9a | instance_network_interface | 2decda8bcd724687a1cf05064ab21... 
| a8685e47-742b-45cd-89c5-d7c2c7f82f6e | image                      | b12f95625664420ca31949963b75b... 
+--------------------------------------+----------------------------+----------------------------------

# details of the resource

[root@dlp ~(keystone)]#
openstack metric resource show a8685e47-742b-45cd-89c5-d7c2c7f82f6e

+-----------------------+-------------------------------------------------------------------+
| Field                 | Value                                                             |
+-----------------------+-------------------------------------------------------------------+
| created_by_project_id | 7e53ef14eb894f379ea1929f5defc949                                  |
| created_by_user_id    | 1bbca96b926645e18c83df974aafc98f                                  |
| creator               | 1bbca96b926645e18c83df974aafc98f:7e53ef14eb894f379ea1929f5defc949 |
| ended_at              | None                                                              |
| id                    | a8685e47-742b-45cd-89c5-d7c2c7f82f6e                              |
| metrics               | image.size: 936fca06-3011-42c2-8532-11e5d932d10b                  |
| original_resource_id  | a8685e47-742b-45cd-89c5-d7c2c7f82f6e                              |
| project_id            | b12f95625664420ca31949963b75b74f                                  |
| revision_end          | None                                                              |
| revision_start        | 2021-11-25T06:20:54.977999+00:00                                  |
| started_at            | 2021-11-25T06:20:54.977991+00:00                                  |
| type                  | image                                                             |
| user_id               | None                                                              |
+-----------------------+-------------------------------------------------------------------+

# display image size data

[root@dlp ~(keystone)]#
openstack metric measures show 936fca06-3011-42c2-8532-11e5d932d10b

+---------------------------+-------------+--------------+
| timestamp                 | granularity |        value |
+---------------------------+-------------+--------------+
| 2021-11-25T15:20:00+09:00 |       300.0 | 2574581760.0 |
+---------------------------+-------------+--------------+
Matched Content