CentOS 8
Sponsored Link

OpenStack Ussuri : How to use Ceilometer (Glance)2020/06/11

 
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     |   |        L2 Agent       |   |     Nova Compute      |
|  Keystone   Glance    |   |        L3 Agent       |   |      Open vSwitch     |
|  Nova API  Cinder API |   |     Metadata Agent    |   |        L2 Agent       |
|  Neutron Server       |   |     Cinder Volume     |   |  Ceilometer Compute   |
|  Metadata Agent       |   |        Heat API       |   |                       |
|  Gnocchi              |   |      Heat Engine      |   |                       |
|  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                       
+--------------------------------------+----------------------------+----------------------------------
| cffa1ff3-6d1f-46d8-b98b-d488724972c3 | instance                   | d9c8c215499949cfb249b28bdaba8... 
| 38e60146-7914-51f2-97f3-fb2cb5885289 | instance_network_interface | d9c8c215499949cfb249b28bdaba8... 
| 2e00f938-8e21-54ff-967f-b69d9d74b4ba | instance_disk              | d9c8c215499949cfb249b28bdaba8... 
+--------------------------------------+----------------------------+----------------------------------

# test to add an image

[root@dlp ~(keystone)]#
openstack image create "CentOS81" --file /var/kvm/images/centos8.qcow2 --disk-format qcow2 --container-format bare --public

# test to download an image

[root@dlp ~(keystone)]#
openstack image save --file centos81.qcow2 CentOS81

# list resources

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

+--------------------------------------+----------------------------+----------------------------------
| id                                   | type                       | project_id                       
+--------------------------------------+----------------------------+----------------------------------
| cffa1ff3-6d1f-46d8-b98b-d488724972c3 | instance                   | d9c8c215499949cfb249b28bdaba8... 
| 38e60146-7914-51f2-97f3-fb2cb5885289 | instance_network_interface | d9c8c215499949cfb249b28bdaba8... 
| 2e00f938-8e21-54ff-967f-b69d9d74b4ba | instance_disk              | d9c8c215499949cfb249b28bdaba8... 
| c7aa769c-dc7b-4344-b2fd-09521e5d3634 | image                      | 9cffeca6beec4a39ab6b076ec2bdd... 
+--------------------------------------+----------------------------+----------------------------------

# details of the resource

[root@dlp ~(keystone)]#
openstack metric resource show c7aa769c-dc7b-4344-b2fd-09521e5d3634

+-----------------------+-------------------------------------------------------------------+
| Field                 | Value                                                             |
+-----------------------+-------------------------------------------------------------------+
| created_by_project_id | 03fc3b5cc0434f748ec562dd74866396                                  |
| created_by_user_id    | 97a80018ee3e41ceafc0c8caa42c9b82                                  |
| creator               | 97a80018ee3e41ceafc0c8caa42c9b82:03fc3b5cc0434f748ec562dd74866396 |
| ended_at              | None                                                              |
| id                    | c7aa769c-dc7b-4344-b2fd-09521e5d3634                              |
| metrics               | image.download: 9e78e28a-820c-4a9a-b321-973f2ccc7bde              |
|                       | image.serve: a8c52f38-577c-4914-939c-71e0f7722914                 |
|                       | image.size: 1c367f4c-ea8a-40f1-8736-fd3e28ab8a66                  |
| original_resource_id  | c7aa769c-dc7b-4344-b2fd-09521e5d3634                              |
| project_id            | 9cffeca6beec4a39ab6b076ec2bdd0c9                                  |
| revision_end          | None                                                              |
| revision_start        | 2020-06-10T07:30:21.959521+00:00                                  |
| started_at            | 2020-06-10T07:30:21.959508+00:00                                  |
| type                  | image                                                             |
| user_id               | None                                                              |
+-----------------------+-------------------------------------------------------------------+

# display image download data

[root@dlp ~(keystone)]#
openstack metric measures show 9e78e28a-820c-4a9a-b321-973f2ccc7bde

+---------------------------+-------------+--------------+
| timestamp                 | granularity |        value |
+---------------------------+-------------+--------------+
| 2020-06-10T16:30:00+09:00 |       300.0 | 9665380352.0 |
+---------------------------+-------------+--------------+

# display image size data

[root@dlp ~(keystone)]#
openstack metric measures show 1c367f4c-ea8a-40f1-8736-fd3e28ab8a66

+---------------------------+-------------+--------------+
| timestamp                 | granularity |        value |
+---------------------------+-------------+--------------+
| 2020-06-10T16:30:00+09:00 |       300.0 | 9665380352.0 |
+---------------------------+-------------+--------------+
Matched Content