CentOS Stream 8
Sponsored Link

OpenStack Victoria : How to use Ceilometer (Glance)2021/03/30

 
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    |
|  Gnocchi              |   |     Heat API/Engine   |   |   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 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                       
+--------------------------------------+----------------------------+----------------------------------
| da1c8adc-4733-4ee5-a654-49d652a6aaa3 | instance                   | f1f04d774d2141fb9acabd28d0e00... 
| 21b1221b-a0db-5f1c-8c92-ae02f7064202 | instance_disk              | f1f04d774d2141fb9acabd28d0e00... 
| 23721353-784e-571f-9f47-fecb17e1c51d | instance_network_interface | f1f04d774d2141fb9acabd28d0e00... 
+--------------------------------------+----------------------------+----------------------------------

# test to add an image

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

# test to download an image

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

# list resources

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

+--------------------------------------+----------------------------+----------------------------------
| id                                   | type                       | project_id                       
+--------------------------------------+----------------------------+----------------------------------
| da1c8adc-4733-4ee5-a654-49d652a6aaa3 | instance                   | f1f04d774d2141fb9acabd28d0e00... 
| 21b1221b-a0db-5f1c-8c92-ae02f7064202 | instance_disk              | f1f04d774d2141fb9acabd28d0e00... 
| 23721353-784e-571f-9f47-fecb17e1c51d | instance_network_interface | f1f04d774d2141fb9acabd28d0e00... 
| ec41dfb1-df70-46c1-8484-508f3ab2d76a | image                      | b9bf51c6436a4c5aa7a2df05688af... 
+--------------------------------------+----------------------------+----------------------------------

# details of the resource

[root@dlp ~(keystone)]#
openstack metric resource show ec41dfb1-df70-46c1-8484-508f3ab2d76a

+-----------------------+-------------------------------------------------------------------+
| Field                 | Value                                                             |
+-----------------------+-------------------------------------------------------------------+
| created_by_project_id | affa3a6446154e37adfd233c437bacc1                                  |
| created_by_user_id    | 66a09b5dee7b451fb4cb4216ef7067be                                  |
| creator               | 66a09b5dee7b451fb4cb4216ef7067be:affa3a6446154e37adfd233c437bacc1 |
| ended_at              | None                                                              |
| id                    | ec41dfb1-df70-46c1-8484-508f3ab2d76a                              |
| metrics               | image.download: c0537b3c-4fbf-430e-ab47-6ddb72610c9e              |
|                       | image.serve: aa95cad5-ba0b-4b51-a343-f0ffbed420cf                 |
|                       | image.size: 3126dbcf-8947-488a-a191-ae665d863e36                  |
| original_resource_id  | ec41dfb1-df70-46c1-8484-508f3ab2d76a                              |
| project_id            | b9bf51c6436a4c5aa7a2df05688afb49                                  |
| revision_end          | None                                                              |
| revision_start        | 2021-03-30T07:24:31.545055+00:00                                  |
| started_at            | 2021-03-30T07:24:31.545048+00:00                                  |
| type                  | image                                                             |
| user_id               | None                                                              |
+-----------------------+-------------------------------------------------------------------+

# display image download data

[root@dlp ~(keystone)]#
openstack metric measures show c0537b3c-4fbf-430e-ab47-6ddb72610c9e

+---------------------------+-------------+--------------+
| timestamp                 | granularity |        value |
+---------------------------+-------------+--------------+
| 2021-03-30T16:20:00+09:00 |       300.0 | 3068329984.0 |
+---------------------------+-------------+--------------+

# display image size data

[root@dlp ~(keystone)]#
openstack metric measures show 3126dbcf-8947-488a-a191-ae665d863e36

+---------------------------+-------------+--------------+
| timestamp                 | granularity |        value |
+---------------------------+-------------+--------------+
| 2021-03-30T16:20:00+09:00 |       300.0 | 3068329984.0 |
+---------------------------+-------------+--------------+
Matched Content