Ubuntu 18.04
Sponsored Link

OpenStack Queens : How to use Ceilometer (Glance)2018/06/20

 
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 ]   |   |    [ Network Node ]   |   |    [ Compute Node ]   |
 |                       |   |                       |   |                       |
 |  MariaDB    RabbitMQ  |   |      Linux Bridge     |   |        Libvirt        |
 |  Memcached  httpd     |   |        L2_Agent       |   |     Nova_Compute      |
 |  Keystone   Glance    |   |        L3_Agent       |   |      Linux Bridge     |
 |  Nova_API  Cinder_API |   |     Metadata_Agent    |   |        L2_Agent       |
 |  Neutron_Server       |   |     Cinder_Volume     |   |   Ceilometer_Compute  |
 |  Metadata_Agent       |   |        Heat_API       |   |                       |
 |                       |   |      Heat Engine      |   |                       |
 |                       |   |    Gnocchi  httpd     |   |                       |
 |                       |   |   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)#
vi /etc/glance/glance-registry.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 glance-api glance-registry

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

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

+--------------------------------------+----------------------------+----------------------------------
| id                                   | type                       | project_id                       
+--------------------------------------+----------------------------+----------------------------------
| bbc2a8a6-7c81-4d4e-94c5-0632ff3aa86f | instance                   | 04a16d601dc940dd845f3092ce271... 
| 3aae02ab-b9b7-4edf-81e2-fea2df72fc8e | instance                   | 04a16d601dc940dd845f3092ce271... 
| 511490b6-a731-52fb-8a08-0b26b11b4cd5 | instance_disk              | 04a16d601dc940dd845f3092ce271... 
| bbb376d5-5e6b-581d-996d-73a018efa641 | instance_network_interface | 04a16d601dc940dd845f3092ce271... 
+--------------------------------------+----------------------------+----------------------------------

# test to add an image

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

# test to download an image

root@dlp ~(keystone)#
openstack image save --file ubuntu1804.qcow2 Ubuntu180401

# list resources

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

+--------------------------------------+----------------------------+----------------------------------
| id                                   | type                       | project_id                       
+--------------------------------------+----------------------------+----------------------------------
| bbc2a8a6-7c81-4d4e-94c5-0632ff3aa86f | instance                   | 04a16d601dc940dd845f3092ce271... 
| 3aae02ab-b9b7-4edf-81e2-fea2df72fc8e | instance                   | 04a16d601dc940dd845f3092ce271... 
| 511490b6-a731-52fb-8a08-0b26b11b4cd5 | instance_disk              | 04a16d601dc940dd845f3092ce271... 
| bbb376d5-5e6b-581d-996d-73a018efa641 | instance_network_interface | 04a16d601dc940dd845f3092ce271... 
| 5c16b474-93f4-4a29-b52f-a41897d4d312 | image                      | 12d80218a35e4c62aa0403e92b5b6... 
+--------------------------------------+----------------------------+----------------------------------

# details of the resource

root@dlp ~(keystone)#
openstack metric resource show 5c16b474-93f4-4a29-b52f-a41897d4d312

+-----------------------+-------------------------------------------------------------------+
| Field                 | Value                                                             |
+-----------------------+-------------------------------------------------------------------+
| created_by_project_id | fa8bf7aca73e44cb9bc2c9f42859857e                                  |
| created_by_user_id    | 78ed5a8c14194fcba73206f1c0b0174f                                  |
| creator               | 78ed5a8c14194fcba73206f1c0b0174f:fa8bf7aca73e44cb9bc2c9f42859857e |
| ended_at              | None                                                              |
| id                    | 5c16b474-93f4-4a29-b52f-a41897d4d312                              |
| metrics               | image.download: 4ec3d97d-6f34-4609-b724-e15eec8a4686              |
|                       | image.serve: fe1be485-c866-4f03-8e09-5c2aae62d99b                 |
|                       | image.size: a1af55ca-805f-44c1-bc30-ef581cff837c                  |
| original_resource_id  | 5c16b474-93f4-4a29-b52f-a41897d4d312                              |
| project_id            | 12d80218a35e4c62aa0403e92b5b649a                                  |
| revision_end          | None                                                              |
| revision_start        | 2018-06-20T06:56:47.050244+00:00                                  |
| started_at            | 2018-06-20T06:56:47.050216+00:00                                  |
| type                  | image                                                             |
| user_id               | None                                                              |
+-----------------------+-------------------------------------------------------------------+

# display image download

root@dlp ~(keystone)#
openstack metric measures show 4ec3d97d-6f34-4609-b724-e15eec8a4686

+---------------------------+-------------+--------------+
| timestamp                 | granularity |        value |
+---------------------------+-------------+--------------+
| 2018-06-20T15:55:00+09:00 |       300.0 | 2980839424.0 |
+---------------------------+-------------+--------------+

# display image size

root@dlp ~(keystone)#
openstack metric measures show a1af55ca-805f-44c1-bc30-ef581cff837c

+---------------------------+-------------+--------------+
| timestamp                 | granularity |        value |
+---------------------------+-------------+--------------+
| 2018-06-20T15:55:00+09:00 |       300.0 | 2980839424.0 |
+---------------------------+-------------+--------------+
Matched Content