CentOS 7
Sponsored Link

OpenStack Stein : Ceilometer 利用方法(Nova Compute)2019/05/17

 
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] Compute サービスの各種データ収集を有効にするには、Compute ノードの Nova Compute を以下のように設定します。
[root@node01 ~]#
vi /etc/nova/nova.conf
# [DEFAULT] セクション内の任意の場所へ追記

instance_usage_audit = True
instance_usage_audit_period = hour
notify_on_state_change = vm_and_task_state
# 最終行へ追記

[oslo_messaging_notifications]
driver = messagingv2
[root@node01 ~]#
systemctl restart openstack-nova-compute

[2] 任意のユーザーでインスタンスを作成/起動した場合に収集されるデータの表示例です。
# インスタンス作成 & 起動

[cent@dlp ~(keystone)]$
Int_Net_ID=$(openstack network list | grep int_net | awk '{ print $2 }')

[cent@dlp ~(keystone)]$
openstack server create --flavor m1.small --image CentOS7 --security-group secgroup01 --nic net-id=$Int_Net_ID --key-name mykey CentOS_7

# リソース一覧

[cent@dlp ~(keystone)]$
openstack metric resource list

+--------------------------------------+----------------------------+----------------------------------
| id                                   | type                       | project_id                       
+--------------------------------------+----------------------------+----------------------------------
| aced428a-2d16-4679-9798-50e69c7aaf1d | instance                   | caab6ec580994e6481cd104b9d210f3f 
| a2e7b8cf-003d-4431-a4cc-c898169645d6 | instance                   | caab6ec580994e6481cd104b9d210f3f 
| 549a0c66-9dd0-5356-90c8-c742f46d46ca | instance_network_interface | caab6ec580994e6481cd104b9d210f3f 
| 291bfeb0-05f2-5918-8a0d-be2e6fdc0f6f | instance_disk              | caab6ec580994e6481cd104b9d210f3f 
+--------------------------------------+----------------------------+----------------------------------
+----------------------------------+-----------------------------------------------------------------------
| user_id                          | original_resource_id                                                  
+----------------------------------+-----------------------------------------------------------------------
| b5dd128c2fd744c892ad7d1fb39d21a0 | aced428a-2d16-4679-9798-50e69c7aaf1d                                  
| b5dd128c2fd744c892ad7d1fb39d21a0 | a2e7b8cf-003d-4431-a4cc-c898169645d6                                  
| b5dd128c2fd744c892ad7d1fb39d21a0 | instance-00000003-a2e7b8cf-003d-4431-a4cc-c898169645d6-tap96a0ed26-8c 
| b5dd128c2fd744c892ad7d1fb39d21a0 | a2e7b8cf-003d-4431-a4cc-c898169645d6-vda                              
+----------------------------------+-----------------------------------------------------------------------
+----------------------------------+----------+----------------------------------+--------------
| started_at                       | ended_at | revision_start                   | revision_end 
+----------------------------------+----------+----------------------------------+--------------
| 2019-05-17T06:37:46.374470+00:00 | None     | 2019-05-17T06:37:46.374513+00:00 | None         
| 2019-05-17T06:37:55.543117+00:00 | None     | 2019-05-17T06:37:55.543153+00:00 | None         
| 2019-05-17T06:39:45.996924+00:00 | None     | 2019-05-17T06:39:45.996965+00:00 | None         
| 2019-05-17T06:39:46.029387+00:00 | None     | 2019-05-17T06:39:46.029422+00:00 | None         
+----------------------------------+----------+----------------------------------+--------------
+-------------------------------------------------------------------+
| creator                                                           |
+-------------------------------------------------------------------+
| afc534e952064ca2b16fc3e242c15665:c5e87c9b460e4f16801b4102019c97e6 |
| afc534e952064ca2b16fc3e242c15665:c5e87c9b460e4f16801b4102019c97e6 |
| afc534e952064ca2b16fc3e242c15665:c5e87c9b460e4f16801b4102019c97e6 |
| afc534e952064ca2b16fc3e242c15665:c5e87c9b460e4f16801b4102019c97e6 |
+-------------------------------------------------------------------+

# instance リソース詳細

[cent@dlp ~(keystone)]$
openstack metric resource show a2e7b8cf-003d-4431-a4cc-c898169645d6

+-----------------------+---------------------------------------------------------------------+
| Field                 | Value                                                               |
+-----------------------+---------------------------------------------------------------------+
| created_by_project_id | c5e87c9b460e4f16801b4102019c97e6                                    |
| created_by_user_id    | afc534e952064ca2b16fc3e242c15665                                    |
| creator               | afc534e952064ca2b16fc3e242c15665:c5e87c9b460e4f16801b4102019c97e6   |
| ended_at              | None                                                                |
| id                    | a2e7b8cf-003d-4431-a4cc-c898169645d6                                |
| metrics               | compute.instance.booting.time: 0ed5569d-6c34-4659-8f14-44c711609785 |
|                       | cpu: fa81fe48-ed02-4849-b29a-73589cba17d9                           |
|                       | disk.ephemeral.size: 49a345f7-21ae-41ab-b6ec-848ef3e3fabd           |
|                       | disk.root.size: b14ba586-0088-4c35-99ca-af2e3bfba771                |
|                       | memory.usage: 51969472-ab06-40b2-a30b-8efac30ccb7c                  |
|                       | memory: b7552629-7910-4a39-a6be-b13927c17d7c                        |
|                       | vcpus: 613ac432-33a7-4c49-b6a4-21ef110ed076                         |
| original_resource_id  | a2e7b8cf-003d-4431-a4cc-c898169645d6                                |
| project_id            | caab6ec580994e6481cd104b9d210f3f                                    |
| revision_end          | None                                                                |
| revision_start        | 2019-05-17T06:37:55.543153+00:00                                    |
| started_at            | 2019-05-17T06:37:55.543117+00:00                                    |
| type                  | instance                                                            |
| user_id               | b5dd128c2fd744c892ad7d1fb39d21a0                                    |
+-----------------------+---------------------------------------------------------------------+

# CPU

[cent@dlp ~(keystone)]$
openstack metric measures show fa81fe48-ed02-4849-b29a-73589cba17d9

+---------------------------+-------------+---------------+
| timestamp                 | granularity |         value |
+---------------------------+-------------+---------------+
| 2019-05-17T15:35:00+09:00 |       300.0 | 35810000000.0 |
+---------------------------+-------------+---------------+

# メモリー使用

[cent@dlp ~(keystone)]$
openstack metric measures show 51969472-ab06-40b2-a30b-8efac30ccb7c

+---------------------------+-------------+-------+
| timestamp                 | granularity | value |
+---------------------------+-------------+-------+
| 2019-05-17T15:35:00+09:00 |       300.0 | 212.0 |
+---------------------------+-------------+-------+

# instance_network_interface リソース詳細

[cent@dlp ~(keystone)]$
openstack metric resource show 549a0c66-9dd0-5356-90c8-c742f46d46ca

+-----------------------+-----------------------------------------------------------------------+
| Field                 | Value                                                                 |
+-----------------------+-----------------------------------------------------------------------+
| created_by_project_id | c5e87c9b460e4f16801b4102019c97e6                                      |
| created_by_user_id    | afc534e952064ca2b16fc3e242c15665                                      |
| creator               | afc534e952064ca2b16fc3e242c15665:c5e87c9b460e4f16801b4102019c97e6     |
| ended_at              | None                                                                  |
| id                    | 549a0c66-9dd0-5356-90c8-c742f46d46ca                                  |
| metrics               | network.incoming.bytes: 68f53626-2a0c-4c82-8175-86f80bebeb10          |
|                       | network.incoming.packets: 99eb68b9-6828-4821-914b-39134c39733c        |
|                       | network.outgoing.bytes: e3519384-7da8-42db-b291-d1ac67ee03b8          |
|                       | network.outgoing.packets: 28bb2e78-a5c9-490a-b87b-135508b6c6a2        |
| original_resource_id  | instance-00000003-a2e7b8cf-003d-4431-a4cc-c898169645d6-tap96a0ed26-8c |
| project_id            | caab6ec580994e6481cd104b9d210f3f                                      |
| revision_end          | None                                                                  |
| revision_start        | 2019-05-17T06:39:45.996965+00:00                                      |
| started_at            | 2019-05-17T06:39:45.996924+00:00                                      |
| type                  | instance_network_interface                                            |
| user_id               | b5dd128c2fd744c892ad7d1fb39d21a0                                      |
+-----------------------+-----------------------------------------------------------------------+

# ネットワーク インカミング バイト

[cent@dlp ~(keystone)]$
openstack metric measures show 68f53626-2a0c-4c82-8175-86f80bebeb10

+---------------------------+-------------+---------+
| timestamp                 | granularity |   value |
+---------------------------+-------------+---------+
| 2019-05-17T15:35:00+09:00 |       300.0 | 25703.0 |
| 2019-05-17T15:40:00+09:00 |       300.0 | 27311.0 |
+---------------------------+-------------+---------+

# ネットワーク アウトゴーイング バイト

[cent@dlp ~(keystone)]$
openstack metric measures show e3519384-7da8-42db-b291-d1ac67ee03b8

+---------------------------+-------------+---------+
| timestamp                 | granularity |   value |
+---------------------------+-------------+---------+
| 2019-05-17T15:35:00+09:00 |       300.0 | 23650.0 |
| 2019-05-17T15:40:00+09:00 |       300.0 | 25258.0 |
+---------------------------+-------------+---------+
関連コンテンツ