CentOS 8
Sponsored Link

OpenStack Victoria : How to use Ceilometer (Glance)2020/11/20

 
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 ]   |   |    [ 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 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 openstack-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                       
+--------------------------------------+----------------------------+----------------------------------
| 852fbb21-1dd6-4268-9532-54876bbc4567 | instance                   | 8cc9f93ed89f40e28a610d025462c... 
| 66daeeec-3425-5ef9-97e6-4799ce18dea5 | instance_disk              | 8cc9f93ed89f40e28a610d025462c... 
| a13ba637-1038-5ce5-9f0e-8aac70952d47 | instance_network_interface | 8cc9f93ed89f40e28a610d025462c... 
+--------------------------------------+----------------------------+----------------------------------

# test to add an image

[root@dlp ~(keystone)]#
openstack image create "CentOS82" --file /var/kvm/images/centos8.qcow2 --disk-format qcow2 --container-format bare --public

# test to download an image

[root@dlp ~(keystone)]#
openstack image save --file centos82.qcow2 CentOS82

# list resources

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

+--------------------------------------+----------------------------+----------------------------------
| id                                   | type                       | project_id                       
+--------------------------------------+----------------------------+----------------------------------
| 852fbb21-1dd6-4268-9532-54876bbc4567 | instance                   | 8cc9f93ed89f40e28a610d025462c... 
| 66daeeec-3425-5ef9-97e6-4799ce18dea5 | instance_disk              | 8cc9f93ed89f40e28a610d025462c... 
| a13ba637-1038-5ce5-9f0e-8aac70952d47 | instance_network_interface | 8cc9f93ed89f40e28a610d025462c... 
| 9b2a5d40-93e3-411a-ba27-39f81f1008c6 | image                      | bd0827a1282f45f28c4100b77289e... 
+--------------------------------------+----------------------------+----------------------------------

# details of the resource

[root@dlp ~(keystone)]#
openstack metric resource show 9b2a5d40-93e3-411a-ba27-39f81f1008c6

+-----------------------+-------------------------------------------------------------------+
| Field                 | Value                                                             |
+-----------------------+-------------------------------------------------------------------+
| created_by_project_id | 4e42859fe8704e8aaddb5369551b6c52                                  |
| created_by_user_id    | fa8f7a76bb114819950cfd6b99238fee                                  |
| creator               | fa8f7a76bb114819950cfd6b99238fee:4e42859fe8704e8aaddb5369551b6c52 |
| ended_at              | None                                                              |
| id                    | 9b2a5d40-93e3-411a-ba27-39f81f1008c6                              |
| metrics               | image.download: d553720c-8419-4f69-9df5-60abda4160b4              |
|                       | image.serve: b2abae67-f5fb-4291-be96-e8e7166a792b                 |
|                       | image.size: eb867e47-a427-4f79-a2c0-1bf67412238c                  |
| original_resource_id  | 9b2a5d40-93e3-411a-ba27-39f81f1008c6                              |
| project_id            | bd0827a1282f45f28c4100b77289eb0a                                  |
| revision_end          | None                                                              |
| revision_start        | 2020-11-20T08:05:22.559521+00:00                                  |
| started_at            | 2020-11-20T08:05:22.559511+00:00                                  |
| type                  | image                                                             |
| user_id               | None                                                              |
+-----------------------+-------------------------------------------------------------------+

# display image download data

[root@dlp ~(keystone)]#
openstack metric measures show d553720c-8419-4f69-9df5-60abda4160b4

+---------------------------+-------------+---------------+
| timestamp                 | granularity |         value |
+---------------------------+-------------+---------------+
| 2020-11-20T17:05:00+09:00 |       300.0 | 10739318784.0 |
+---------------------------+-------------+---------------+

# display image size data

[root@dlp ~(keystone)]#
openstack metric measures show eb867e47-a427-4f79-a2c0-1bf67412238c

+---------------------------+-------------+---------------+
| timestamp                 | granularity |         value |
+---------------------------+-------------+---------------+
| 2020-11-20T17:05:00+09:00 |       300.0 | 10739318784.0 |
+---------------------------+-------------+---------------+
Matched Content