Ubuntu 18.04
Sponsored Link

OpenStack Rocky : How to use Ceilometer (Glance)2018/09/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)#
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                       
+--------------------------------------+----------------------------+----------------------------------
| e402a282-c5ae-4532-ad08-0a2f0d7803ac | instance                   | 5f54b0ad76274f06b13f29458cc1c... 
| 79195be1-3b66-4601-8401-489f4d7b4ee5 | instance                   | 5f54b0ad76274f06b13f29458cc1c... 
| eb34c91e-e69b-5bc5-b01b-97a0ee76832d | instance_network_interface | 5f54b0ad76274f06b13f29458cc1c... 
| 9887d1b9-c33e-5346-bc51-712db41a50f6 | instance_disk              | 5f54b0ad76274f06b13f29458cc1c... 
+--------------------------------------+----------------------------+----------------------------------

# 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                       
+--------------------------------------+----------------------------+----------------------------------
| e402a282-c5ae-4532-ad08-0a2f0d7803ac | instance                   | 5f54b0ad76274f06b13f29458cc1c... 
| 79195be1-3b66-4601-8401-489f4d7b4ee5 | instance                   | 5f54b0ad76274f06b13f29458cc1c... 
| eb34c91e-e69b-5bc5-b01b-97a0ee76832d | instance_network_interface | 5f54b0ad76274f06b13f29458cc1c... 
| 9887d1b9-c33e-5346-bc51-712db41a50f6 | instance_disk              | 5f54b0ad76274f06b13f29458cc1c... 
| 334811ef-c11b-4f8b-8b76-470fc58f4a06 | image                      | a4307ece2969492eb795f64da4006... 
+--------------------------------------+----------------------------+----------------------------------

# details of the image resource

root@dlp ~(keystone)#
openstack metric resource show 334811ef-c11b-4f8b-8b76-470fc58f4a06

+-----------------------+-------------------------------------------------------------------+
| Field                 | Value                                                             |
+-----------------------+-------------------------------------------------------------------+
| created_by_project_id | aaeee626080841a491235fb06e77f10c                                  |
| created_by_user_id    | 1473e02cb8754787a0a9e47dd7d8e0ce                                  |
| creator               | 1473e02cb8754787a0a9e47dd7d8e0ce:aaeee626080841a491235fb06e77f10c |
| ended_at              | None                                                              |
| id                    | 334811ef-c11b-4f8b-8b76-470fc58f4a06                              |
| metrics               | image.download: b5e4e666-c81f-4620-831d-0d67e7497d3a              |
|                       | image.serve: d7232eaf-485b-481a-b9c5-09cdb9687924                 |
|                       | image.size: 6d8944af-8a8c-4e62-8195-359bc9bfeb0a                  |
| original_resource_id  | 334811ef-c11b-4f8b-8b76-470fc58f4a06                              |
| project_id            | a4307ece2969492eb795f64da4006b2d                                  |
| revision_end          | None                                                              |
| revision_start        | 2018-09-18T08:00:08.377328+00:00                                  |
| started_at            | 2018-09-18T08:00:08.377307+00:00                                  |
| type                  | image                                                             |
| user_id               | None                                                              |
+-----------------------+-------------------------------------------------------------------+

# display image download data

root@dlp ~(keystone)#
openstack metric measures show b5e4e666-c81f-4620-831d-0d67e7497d3a

+---------------------------+-------------+--------------+
| timestamp                 | granularity |        value |
+---------------------------+-------------+--------------+
| 2018-09-18T17:00:00+09:00 |       300.0 | 2945646592.0 |
+---------------------------+-------------+--------------+

# display image size data

root@dlp ~(keystone)#
openstack metric measures show 6d8944af-8a8c-4e62-8195-359bc9bfeb0a

+---------------------------+-------------+--------------+
| timestamp                 | granularity |        value |
+---------------------------+-------------+--------------+
| 2018-09-18T17:00:00+09:00 |       300.0 | 2945646592.0 |
+---------------------------+-------------+--------------+
Matched Content