Ubuntu 18.04
Sponsored Link

OpenStack Queens : Ceilometer 利用方法(Glance)
2018/06/20
 
OpenStack Telemetry Service (Ceilometer) の利用方法です。
当例では以下のような環境を例に Ceilometer サービスをインストールしています。
------------+---------------------------+---------------------------+------------
            |                           |                           |
        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] 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)#
vi /etc/glance/glance-registry.conf
# 最終行へ追記

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

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

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

+--------------------------------------+----------------------------+----------------------------------
| id                                   | type                       | project_id                       
+--------------------------------------+----------------------------+----------------------------------
| bbc2a8a6-7c81-4d4e-94c5-0632ff3aa86f | instance                   | 04a16d601dc940dd845f3092ce271... 
| 3aae02ab-b9b7-4edf-81e2-fea2df72fc8e | instance                   | 04a16d601dc940dd845f3092ce271... 
| 511490b6-a731-52fb-8a08-0b26b11b4cd5 | instance_disk              | 04a16d601dc940dd845f3092ce271... 
| bbb376d5-5e6b-581d-996d-73a018efa641 | instance_network_interface | 04a16d601dc940dd845f3092ce271... 
+--------------------------------------+----------------------------+----------------------------------

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

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

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

root@dlp ~(keystone)#
openstack image save --file ubuntu1804.qcow2 Ubuntu180401

# リソース一覧

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

+--------------------------------------+----------------------------+----------------------------------
| id                                   | type                       | project_id                       
+--------------------------------------+----------------------------+----------------------------------
| bbc2a8a6-7c81-4d4e-94c5-0632ff3aa86f | instance                   | 04a16d601dc940dd845f3092ce271... 
| 3aae02ab-b9b7-4edf-81e2-fea2df72fc8e | instance                   | 04a16d601dc940dd845f3092ce271... 
| 511490b6-a731-52fb-8a08-0b26b11b4cd5 | instance_disk              | 04a16d601dc940dd845f3092ce271... 
| bbb376d5-5e6b-581d-996d-73a018efa641 | instance_network_interface | 04a16d601dc940dd845f3092ce271... 
| 5c16b474-93f4-4a29-b52f-a41897d4d312 | image                      | 12d80218a35e4c62aa0403e92b5b6... 
+--------------------------------------+----------------------------+----------------------------------

# リソース詳細

root@dlp ~(keystone)#
openstack metric resource show 5c16b474-93f4-4a29-b52f-a41897d4d312

+-----------------------+-------------------------------------------------------------------+
| Field                 | Value                                                             |
+-----------------------+-------------------------------------------------------------------+
| created_by_project_id | fa8bf7aca73e44cb9bc2c9f42859857e                                  |
| created_by_user_id    | 78ed5a8c14194fcba73206f1c0b0174f                                  |
| creator               | 78ed5a8c14194fcba73206f1c0b0174f:fa8bf7aca73e44cb9bc2c9f42859857e |
| ended_at              | None                                                              |
| id                    | 5c16b474-93f4-4a29-b52f-a41897d4d312                              |
| metrics               | image.download: 4ec3d97d-6f34-4609-b724-e15eec8a4686              |
|                       | image.serve: fe1be485-c866-4f03-8e09-5c2aae62d99b                 |
|                       | image.size: a1af55ca-805f-44c1-bc30-ef581cff837c                  |
| original_resource_id  | 5c16b474-93f4-4a29-b52f-a41897d4d312                              |
| project_id            | 12d80218a35e4c62aa0403e92b5b649a                                  |
| revision_end          | None                                                              |
| revision_start        | 2018-06-20T06:56:47.050244+00:00                                  |
| started_at            | 2018-06-20T06:56:47.050216+00:00                                  |
| type                  | image                                                             |
| user_id               | None                                                              |
+-----------------------+-------------------------------------------------------------------+

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

root@dlp ~(keystone)#
openstack metric measures show 4ec3d97d-6f34-4609-b724-e15eec8a4686

+---------------------------+-------------+--------------+
| timestamp                 | granularity |        value |
+---------------------------+-------------+--------------+
| 2018-06-20T15:55:00+09:00 |       300.0 | 2980839424.0 |
+---------------------------+-------------+--------------+

# イメージ サイズ データ

root@dlp ~(keystone)#
openstack metric measures show a1af55ca-805f-44c1-bc30-ef581cff837c

+---------------------------+-------------+--------------+
| timestamp                 | granularity |        value |
+---------------------------+-------------+--------------+
| 2018-06-20T15:55:00+09:00 |       300.0 | 2980839424.0 |
+---------------------------+-------------+--------------+
関連コンテンツ
 
Tweet