CentOS 7
Sponsored Link

OpenStack Train : How to use Ceilometer (Glance)2019/10/29

 
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                       
+--------------------------------------+----------------------------+----------------------------------
| b3c21241-2800-4109-831b-6fd69d20ecf8 | instance                   | 67b2b71cee384d69939e6b3963e0b... 
| d54dd550-9c14-4cf2-a2d6-ab14f888154a | instance                   | 67b2b71cee384d69939e6b3963e0b... 
| 43264c22-f988-5ea1-be0a-3b9ff866bf42 | instance_disk              | 67b2b71cee384d69939e6b3963e0b... 
| 5709365d-ea09-55b4-b95b-eda98ea55cf3 | instance_network_interface | 67b2b71cee384d69939e6b3963e0b... 
+--------------------------------------+----------------------------+----------------------------------

# test to add an image

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

# test to download an image

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

# list resources

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

+--------------------------------------+----------------------------+----------------------------------
| id                                   | type                       | project_id                       
+--------------------------------------+----------------------------+----------------------------------
| b3c21241-2800-4109-831b-6fd69d20ecf8 | instance                   | 67b2b71cee384d69939e6b3963e0b... 
| d54dd550-9c14-4cf2-a2d6-ab14f888154a | instance                   | 67b2b71cee384d69939e6b3963e0b... 
| 43264c22-f988-5ea1-be0a-3b9ff866bf42 | instance_disk              | 67b2b71cee384d69939e6b3963e0b... 
| 5709365d-ea09-55b4-b95b-eda98ea55cf3 | instance_network_interface | 67b2b71cee384d69939e6b3963e0b... 
| a7c1503b-f1a2-47e1-b3ab-ce287c15b4d7 | image                      | 4f93fd3e6e184c859641b01711501...
+--------------------------------------+----------------------------+----------------------------------

# details of the resource

[root@dlp ~(keystone)]#
openstack metric resource show a7c1503b-f1a2-47e1-b3ab-ce287c15b4d7

+-----------------------+-------------------------------------------------------------------+
| Field                 | Value                                                             |
+-----------------------+-------------------------------------------------------------------+
| created_by_project_id | 2b9c4eda462e40a4a3d03b0a38f12bf1                                  |
| created_by_user_id    | 30440c39a3d0472c94e30fbf13ee91a2                                  |
| creator               | 30440c39a3d0472c94e30fbf13ee91a2:2b9c4eda462e40a4a3d03b0a38f12bf1 |
| ended_at              | None                                                              |
| id                    | a7c1503b-f1a2-47e1-b3ab-ce287c15b4d7                              |
| metrics               | image.download: a92b5c74-4335-4281-a0b6-d19b0325544a              |
|                       | image.serve: d3628c06-562a-46ba-8fd1-4d9e019dc94b                 |
|                       | image.size: 813d61bd-e817-4b43-a163-e94ab1424ac0                  |
| original_resource_id  | a7c1503b-f1a2-47e1-b3ab-ce287c15b4d7                              |
| project_id            | 4f93fd3e6e184c859641b017115016a4                                  |
| revision_end          | None                                                              |
| revision_start        | 2019-10-29T02:12:08.444864+00:00                                  |
| started_at            | 2019-10-29T02:12:08.444850+00:00                                  |
| type                  | image                                                             |
| user_id               | None                                                              |
+-----------------------+-------------------------------------------------------------------+

# display image download

[root@dlp ~(keystone)]#
openstack metric measures show a92b5c74-4335-4281-a0b6-d19b0325544a

+---------------------------+-------------+--------------+
| timestamp                 | granularity |        value |
+---------------------------+-------------+--------------+
| 2019-10-29T11:10:00+09:00 |       300.0 | 1695154176.0 |
+---------------------------+-------------+--------------+

# display image size

[root@dlp ~(keystone)]#
openstack metric measures show 813d61bd-e817-4b43-a163-e94ab1424ac0

+---------------------------+-------------+--------------+
| timestamp                 | granularity |        value |
+---------------------------+-------------+--------------+
| 2019-10-29T11:10:00+09:00 |       300.0 | 1695154176.0 |
+---------------------------+-------------+--------------+
Matched Content