Ubuntu 18.04
Sponsored Link

OpenStack Stein : How to use Ceilometer (Glance)2019/04/18

 
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)#
systemctl restart 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                       
+--------------------------------------+----------------------------+----------------------------------
| f8355134-f8eb-4779-840a-0c003eb57259 | instance                   | 82d4792327294948a047ed59e265b...
| 933faac4-688a-55a5-8f62-927898cc9297 | instance_network_interface | ff03eefa265b423aa3375acb46a8e...
| 26de0c76-9999-5e9b-b3e3-758a1af1b5e3 | instance_disk              | ff03eefa265b423aa3375acb46a8e...
| f92025e7-33b7-4a63-bc25-8b7d206773d9 | instance                   | ff03eefa265b423aa3375acb46a8e...
+--------------------------------------+----------------------------+----------------------------------

# test to add an image

root@dlp ~(keystone)#
openstack image create "Ubuntu180402" --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 Ubuntu180402

# list resources

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

+--------------------------------------+----------------------------+----------------------------------
| id                                   | type                       | project_id                       
+--------------------------------------+----------------------------+----------------------------------
| f8355134-f8eb-4779-840a-0c003eb57259 | instance                   | 82d4792327294948a047ed59e265b...
| 933faac4-688a-55a5-8f62-927898cc9297 | instance_network_interface | ff03eefa265b423aa3375acb46a8e...
| 26de0c76-9999-5e9b-b3e3-758a1af1b5e3 | instance_disk              | ff03eefa265b423aa3375acb46a8e...
| f92025e7-33b7-4a63-bc25-8b7d206773d9 | instance                   | ff03eefa265b423aa3375acb46a8e...
| c04649fd-33d3-47ef-9aba-2ddf6a7925c9 | image                      | e52584cf60234bc090c7d437b8ca7...
+--------------------------------------+----------------------------+----------------------------------

# details of the image resource

root@dlp ~(keystone)#
openstack metric resource show c04649fd-33d3-47ef-9aba-2ddf6a7925c9

+-----------------------+-------------------------------------------------------------------+
| Field                 | Value                                                             |
+-----------------------+-------------------------------------------------------------------+
| created_by_project_id | efc5c6a05d444cae80c0a80f49ba87d4                                  |
| created_by_user_id    | ad726bcc13b9436d8fecb2336e9a5dae                                  |
| creator               | ad726bcc13b9436d8fecb2336e9a5dae:efc5c6a05d444cae80c0a80f49ba87d4 |
| ended_at              | None                                                              |
| id                    | c04649fd-33d3-47ef-9aba-2ddf6a7925c9                              |
| metrics               | image.download: 2acb5964-e412-4e5e-96da-2e03967d3f8a              |
|                       | image.serve: 1eb271e9-d8b9-4ca7-858d-0c3758e9475b                 |
|                       | image.size: af56b092-fd24-40b0-a9d1-2217590f440d                  |
| original_resource_id  | c04649fd-33d3-47ef-9aba-2ddf6a7925c9                              |
| project_id            | e52584cf60234bc090c7d437b8ca7b62                                  |
| revision_end          | None                                                              |
| revision_start        | 2019-04-18T03:51:02.906291+00:00                                  |
| started_at            | 2019-04-18T03:51:02.906259+00:00                                  |
| type                  | image                                                             |
| user_id               | None                                                              |
+-----------------------+-------------------------------------------------------------------+

# display image download data

root@dlp ~(keystone)#
openstack metric measures show 2acb5964-e412-4e5e-96da-2e03967d3f8a

+---------------------------+-------------+--------------+
| timestamp                 | granularity |        value |
+---------------------------+-------------+--------------+
| 2019-04-18T12:50:00+09:00 |       300.0 | 3131965440.0 |
+---------------------------+-------------+--------------+

# display image size data

root@dlp ~(keystone)#
openstack metric measures show af56b092-fd24-40b0-a9d1-2217590f440d

+---------------------------+-------------+--------------+
| timestamp                 | granularity |        value |
+---------------------------+-------------+--------------+
| 2019-04-18T12:50:00+09:00 |       300.0 | 3131965440.0 |
+---------------------------+-------------+--------------+
Matched Content