CentOS 7
Sponsored Link

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

 
This is how to use OpenStack Telemetry Service (Ceilometer) for Cinder 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 Cinder service to enable Telemetry data collention like follows.
Change on all Nodes Cinder services are running.
[root@dlp ~(keystone)]#
vi /etc/cinder/cinder.conf
# add to the end

[oslo_messaging_notifications]
driver = messagingv2
transport_url = rabbit://openstack:password@10.0.0.30
[root@dlp ~(keystone)]#
systemctl restart openstack-cinder-api openstack-cinder-scheduler

[2] It's some example to display metrics and meters.
# list resources

[cent@dlp ~(keystone)]$
openstack metric resource list

+--------------------------------------+----------------------------+----------------------------------+-------------
| id                                   | type                       | project_id                       | user_id     
+--------------------------------------+----------------------------+----------------------------------+-------------
| aced428a-2d16-4679-9798-50e69c7aaf1d | instance                   | caab6ec580994e6481cd104b9d210f3f | b5dd128c2...
| 549a0c66-9dd0-5356-90c8-c742f46d46ca | instance_network_interface | caab6ec580994e6481cd104b9d210f3f | b5dd128c2...
| 291bfeb0-05f2-5918-8a0d-be2e6fdc0f6f | instance_disk              | caab6ec580994e6481cd104b9d210f3f | b5dd128c2...
| a2e7b8cf-003d-4431-a4cc-c898169645d6 | instance                   | caab6ec580994e6481cd104b9d210f3f | b5dd128c2...
+--------------------------------------+----------------------------+----------------------------------+-------------

# test to create a volume

[cent@dlp ~(keystone)]$
openstack volume create --size 10 disk01

# list resources

[cent@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...
| a5def4e5-7028-40a8-bff8-8320f3af8121 | volume                     | caab6ec580994e6481cd104b9d210f3f | b5dd128c2f...
+--------------------------------------+----------------------------+----------------------------------+--------------

# details of the resource

[cent@dlp ~(keystone)]$
openstack metric resource show a5def4e5-7028-40a8-bff8-8320f3af8121

+-----------------------+-------------------------------------------------------------------+
| Field                 | Value                                                             |
+-----------------------+-------------------------------------------------------------------+
| created_by_project_id | c5e87c9b460e4f16801b4102019c97e6                                  |
| created_by_user_id    | afc534e952064ca2b16fc3e242c15665                                  |
| creator               | afc534e952064ca2b16fc3e242c15665:c5e87c9b460e4f16801b4102019c97e6 |
| ended_at              | None                                                              |
| id                    | a5def4e5-7028-40a8-bff8-8320f3af8121                              |
| metrics               | volume.size: c07d4b83-532b-4f9d-9604-6c24de484ef7                 |
| original_resource_id  | a5def4e5-7028-40a8-bff8-8320f3af8121                              |
| project_id            | caab6ec580994e6481cd104b9d210f3f                                  |
| revision_end          | None                                                              |
| revision_start        | 2019-05-17T06:57:53.329560+00:00                                  |
| started_at            | 2019-05-17T06:57:53.329481+00:00                                  |
| type                  | volume                                                            |
| user_id               | b5dd128c2fd744c892ad7d1fb39d21a0                                  |
+-----------------------+-------------------------------------------------------------------+

# display volume size

[cent@dlp ~(keystone)]$
openstack metric measures show c07d4b83-532b-4f9d-9604-6c24de484ef7

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