Ubuntu 20.04
Sponsored Link

OpenStack Ussuri : How to use Ceilometer (Glance)2020/06/18

 
This is how to use OpenStack Telemetry Service (Ceilometer) for Glance service.
This example is based on the environment 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                       
+--------------------------------------+----------------------------+----------------------------------
| 2dde6728-0e9a-4bd1-b10a-196162ec5e2a | instance                   | eaa8de359ae0451d944a6401e688f... 
| f33a56c8-468d-5973-a515-a879a8ce8a64 | instance_disk              | eaa8de359ae0451d944a6401e688f... 
| 2b500dc3-e441-5ace-8600-15761d009452 | instance_network_interface | eaa8de359ae0451d944a6401e688f... 
+--------------------------------------+----------------------------+----------------------------------

# test to add an image

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

# test to download an image

root@dlp ~(keystone)#
openstack image save --file ubuntu2004.qcow2 Ubuntu200402

# list resources

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

+--------------------------------------+----------------------------+----------------------------------
| id                                   | type                       | project_id                       
+--------------------------------------+----------------------------+----------------------------------
| 2dde6728-0e9a-4bd1-b10a-196162ec5e2a | instance                   | eaa8de359ae0451d944a6401e688f... 
| f33a56c8-468d-5973-a515-a879a8ce8a64 | instance_disk              | eaa8de359ae0451d944a6401e688f... 
| 2b500dc3-e441-5ace-8600-15761d009452 | instance_network_interface | eaa8de359ae0451d944a6401e688f... 
| 6d64d1aa-d2a9-413a-92a0-daed704e0066 | image                      | 3227cdd34d5c4d9c97eeb8f0dfdf5... 
+--------------------------------------+----------------------------+----------------------------------

# details of the [image] resource

root@dlp ~(keystone)#
openstack metric resource show 6d64d1aa-d2a9-413a-92a0-daed704e0066

+-----------------------+-------------------------------------------------------------------+
| Field                 | Value                                                             |
+-----------------------+-------------------------------------------------------------------+
| created_by_project_id | c0e098a54a4640caa9004fb8f500f554                                  |
| created_by_user_id    | 3d1f14e0843940dfb5afaeee1ec45507                                  |
| creator               | 3d1f14e0843940dfb5afaeee1ec45507:c0e098a54a4640caa9004fb8f500f554 |
| ended_at              | None                                                              |
| id                    | 6d64d1aa-d2a9-413a-92a0-daed704e0066                              |
| metrics               | image.download: 48e870df-6f85-4968-b8f3-eddfbe81366f              |
|                       | image.serve: 8213e296-d72a-4499-9455-6b853d6dabd1                 |
|                       | image.size: 8c739937-ba60-499e-8ca9-326632e03588                  |
| original_resource_id  | 6d64d1aa-d2a9-413a-92a0-daed704e0066                              |
| project_id            | 3227cdd34d5c4d9c97eeb8f0dfdf5d0e                                  |
| revision_end          | None                                                              |
| revision_start        | 2020-06-18T05:11:45.706693+00:00                                  |
| started_at            | 2020-06-18T05:11:45.706685+00:00                                  |
| type                  | image                                                             |
| user_id               | None                                                              |
+-----------------------+-------------------------------------------------------------------+

# display image download data

root@dlp ~(keystone)#
openstack metric measures show 48e870df-6f85-4968-b8f3-eddfbe81366f

+---------------------------+-------------+--------------+
| timestamp                 | granularity |        value |
+---------------------------+-------------+--------------+
| 2020-06-18T14:10:00+09:00 |       300.0 | 3137404928.0 |
+---------------------------+-------------+--------------+

# display image size data

root@dlp ~(keystone)#
openstack metric measures show 8c739937-ba60-499e-8ca9-326632e03588

+---------------------------+-------------+--------------+
| timestamp                 | granularity |        value |
+---------------------------+-------------+--------------+
| 2020-06-18T14:10:00+09:00 |       300.0 | 3137404928.0 |
+---------------------------+-------------+--------------+
Matched Content