CentOS 7
Sponsored Link

OpenStack Train : Ceilometer 利用方法(Glance)
2019/10/29
 
OpenStack Telemetry Service (Ceilometer) の利用方法です。
当例では以下のような環境を例に Ceilometer サービスをインストールしています。
------------+---------------------------+---------------------------+------------
            |                           |                           |
        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] Image サービスの各種データ収集を有効にするには、Glance を以下のように設定します。
[root@dlp ~(keystone)]#
vi /etc/glance/glance-api.conf
# 最終行へ追記

[oslo_messaging_notifications]
driver = messagingv2
# RabbitMQ 接続情報
transport_url = rabbit://openstack:password@10.0.0.30
[root@dlp ~(keystone)]#
systemctl restart openstack-glance-api

[2] イメージを追加等した場合に収集されるデータの表示例です。
# リソース一覧

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

+--------------------------------------+----------------------------+----------------------------------
| id                                   | type                       | project_id                       
+--------------------------------------+----------------------------+----------------------------------
| b3c21241-2800-4109-831b-6fd69d20ecf8 | instance                   | 67b2b71cee384d69939e6b3963e0b... 
| d54dd550-9c14-4cf2-a2d6-ab14f888154a | instance                   | 67b2b71cee384d69939e6b3963e0b... 
| 43264c22-f988-5ea1-be0a-3b9ff866bf42 | instance_disk              | 67b2b71cee384d69939e6b3963e0b... 
| 5709365d-ea09-55b4-b95b-eda98ea55cf3 | instance_network_interface | 67b2b71cee384d69939e6b3963e0b... 
+--------------------------------------+----------------------------+----------------------------------

# テストとしてイメージ登録

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

# テストとしてイメージダウンロード

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

# リソース一覧

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

+--------------------------------------+----------------------------+----------------------------------
| id                                   | type                       | project_id                       
+--------------------------------------+----------------------------+----------------------------------
| b3c21241-2800-4109-831b-6fd69d20ecf8 | instance                   | 67b2b71cee384d69939e6b3963e0b... 
| d54dd550-9c14-4cf2-a2d6-ab14f888154a | instance                   | 67b2b71cee384d69939e6b3963e0b... 
| 43264c22-f988-5ea1-be0a-3b9ff866bf42 | instance_disk              | 67b2b71cee384d69939e6b3963e0b... 
| 5709365d-ea09-55b4-b95b-eda98ea55cf3 | instance_network_interface | 67b2b71cee384d69939e6b3963e0b... 
| a7c1503b-f1a2-47e1-b3ab-ce287c15b4d7 | image                      | 4f93fd3e6e184c859641b01711501...
+--------------------------------------+----------------------------+----------------------------------

# リソース詳細

[root@dlp ~(keystone)]#
openstack metric resource show a7c1503b-f1a2-47e1-b3ab-ce287c15b4d7

+-----------------------+-------------------------------------------------------------------+
| Field                 | Value                                                             |
+-----------------------+-------------------------------------------------------------------+
| created_by_project_id | 2b9c4eda462e40a4a3d03b0a38f12bf1                                  |
| created_by_user_id    | 30440c39a3d0472c94e30fbf13ee91a2                                  |
| creator               | 30440c39a3d0472c94e30fbf13ee91a2:2b9c4eda462e40a4a3d03b0a38f12bf1 |
| ended_at              | None                                                              |
| id                    | a7c1503b-f1a2-47e1-b3ab-ce287c15b4d7                              |
| metrics               | image.download: a92b5c74-4335-4281-a0b6-d19b0325544a              |
|                       | image.serve: d3628c06-562a-46ba-8fd1-4d9e019dc94b                 |
|                       | image.size: 813d61bd-e817-4b43-a163-e94ab1424ac0                  |
| original_resource_id  | a7c1503b-f1a2-47e1-b3ab-ce287c15b4d7                              |
| project_id            | 4f93fd3e6e184c859641b017115016a4                                  |
| revision_end          | None                                                              |
| revision_start        | 2019-10-29T02:12:08.444864+00:00                                  |
| started_at            | 2019-10-29T02:12:08.444850+00:00                                  |
| type                  | image                                                             |
| user_id               | None                                                              |
+-----------------------+-------------------------------------------------------------------+

# イメージ ダウンロード データ

[root@dlp ~(keystone)]#
openstack metric measures show a92b5c74-4335-4281-a0b6-d19b0325544a

+---------------------------+-------------+--------------+
| timestamp                 | granularity |        value |
+---------------------------+-------------+--------------+
| 2019-10-29T11:10:00+09:00 |       300.0 | 1695154176.0 |
+---------------------------+-------------+--------------+

# イメージ サイズ データ

[root@dlp ~(keystone)]#
openstack metric measures show 813d61bd-e817-4b43-a163-e94ab1424ac0

+---------------------------+-------------+--------------+
| timestamp                 | granularity |        value |
+---------------------------+-------------+--------------+
| 2019-10-29T11:10:00+09:00 |       300.0 | 1695154176.0 |
+---------------------------+-------------+--------------+
関連コンテンツ