CentOS 7
Sponsored Link

OpenStack Stein : How to use Ceilometer (Glance)2019/05/17

 
This is how to use OpenStack Telemetry Service (Ceilometer) for Glance service.
This example is based on the emvironment 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                       | user_id   
+--------------------------------------+----------------------------+----------------------------------+-----------
| aced428a-2d16-4679-9798-50e69c7aaf1d | instance                   | caab6ec580994e6481cd104b9d210f3f | b5dd128...
| 549a0c66-9dd0-5356-90c8-c742f46d46ca | instance_network_interface | caab6ec580994e6481cd104b9d210f3f | b5dd128...
| 291bfeb0-05f2-5918-8a0d-be2e6fdc0f6f | instance_disk              | caab6ec580994e6481cd104b9d210f3f | b5dd128...
| a2e7b8cf-003d-4431-a4cc-c898169645d6 | instance                   | caab6ec580994e6481cd104b9d210f3f | b5dd128...
+--------------------------------------+----------------------------+----------------------------------+-----------

# test to add an image

[root@dlp ~(keystone)]#
openstack image create "CentOS76" --file centos76.qcow2 --disk-format qcow2 --container-format bare --public

# test to download an image

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

# list resources

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

+--------------------------------------+----------------------------+----------------------------------+--------------
| id                                   | type                       | project_id                       | user_id      
+--------------------------------------+----------------------------+----------------------------------+--------------
| aced428a-2d16-4679-9798-50e69c7aaf1d | instance                   | caab6ec580994e6481cd104b9d210f3f | b5dd128c2f...
| 549a0c66-9dd0-5356-90c8-c742f46d46ca | instance_network_interface | caab6ec580994e6481cd104b9d210f3f | b5dd128c2f...
| 291bfeb0-05f2-5918-8a0d-be2e6fdc0f6f | instance_disk              | caab6ec580994e6481cd104b9d210f3f | b5dd128c2f...
| a2e7b8cf-003d-4431-a4cc-c898169645d6 | instance                   | caab6ec580994e6481cd104b9d210f3f | b5dd128c2f...
| b158e164-0752-42c7-983f-fc16e58692b0 | image                      | 183a5ed32a77427986038c176b605d73 | None         
+--------------------------------------+----------------------------+----------------------------------+--------------

# details of the resource

[root@dlp ~(keystone)]#
openstack metric resource show b158e164-0752-42c7-983f-fc16e58692b0

+-----------------------+-------------------------------------------------------------------+
| Field                 | Value                                                             |
+-----------------------+-------------------------------------------------------------------+
| created_by_project_id | c5e87c9b460e4f16801b4102019c97e6                                  |
| created_by_user_id    | afc534e952064ca2b16fc3e242c15665                                  |
| creator               | afc534e952064ca2b16fc3e242c15665:c5e87c9b460e4f16801b4102019c97e6 |
| ended_at              | None                                                              |
| id                    | b158e164-0752-42c7-983f-fc16e58692b0                              |
| metrics               | image.download: c9671729-d54a-4a49-910f-f3188f86efa3              |
|                       | image.serve: 5b7fb72e-83cf-4bab-9773-9fd238458398                 |
|                       | image.size: 79f3aff5-6af4-469a-bcaf-d9fb86437265                  |
| original_resource_id  | b158e164-0752-42c7-983f-fc16e58692b0                              |
| project_id            | 183a5ed32a77427986038c176b605d73                                  |
| revision_end          | None                                                              |
| revision_start        | 2019-05-17T06:51:10.153899+00:00                                  |
| started_at            | 2019-05-17T06:51:10.153857+00:00                                  |
| type                  | image                                                             |
| user_id               | None                                                              |
+-----------------------+-------------------------------------------------------------------+

# display image download

[root@dlp ~(keystone)]#
openstack metric measures show c9671729-d54a-4a49-910f-f3188f86efa3

+---------------------------+-------------+--------------+
| timestamp                 | granularity |        value |
+---------------------------+-------------+--------------+
| 2019-05-17T15:50:00+09:00 |       300.0 | 1459617792.0 |
+---------------------------+-------------+--------------+

# display image size

[root@dlp ~(keystone)]#
openstack metric measures show 79f3aff5-6af4-469a-bcaf-d9fb86437265

+---------------------------+-------------+--------------+
| timestamp                 | granularity |        value |
+---------------------------+-------------+--------------+
| 2019-05-17T15:50:00+09:00 |       300.0 | 1459617792.0 |
+---------------------------+-------------+--------------+
Matched Content