CentOS Stream 8
Sponsored Link

OpenStack Yoga : Ceilometer 利用方法 (Nova Compute)2022/06/02

 
OpenStack Telemetry Service (Ceilometer) の利用方法です。
当例では以下のような環境を例に Ceilometer サービスをインストールしています。
------------+-----------------------------+-----------------------------+------------
            |                             |                             |
        eth0|10.0.0.30                eth0|10.0.0.50                eth0|10.0.0.51
+-----------+-----------+     +-----------+-----------+     +-----------+-----------+
|   [ dlp.srv.world ]   |     | [ network.srv.world ] |     |  [ node01.srv.world ] |
|     (Control Node)    |     |     (Network Node)    |     |     (Compute Node)    |
|                       |     |                       |     |                       |
|  MariaDB    RabbitMQ  |     |      Open vSwitch     |     |        Libvirt        |
|  Memcached  httpd     |     |     Neutron Server    |     |      Nova Compute     |
|  Keystone   Glance    |     |      OVN-Northd       |     |      Open vSwitch     |
|  Nova API  Cinder API |     |     Cinder Volume     |     |   OVN Metadata Agent  |
|                       |     |     Gnocchi httpd     |     |     OVN-Controller    |
|                       |     |   Ceilometer Central  |     |   Ceilometer Compute  |
+-----------------------+     +-----------------------+     +-----------------------+

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

instance_usage_audit = True
instance_usage_audit_period = hour

# 最終行へ追記
[notifications]
notify_on_state_change = vm_and_task_state

[oslo_messaging_notifications]
driver = messagingv2

[root@node01 ~]#
systemctl restart openstack-nova-compute

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

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

+--------------------------------------+------------+---------+-------------------------------------+-----------------+----------+
| ID                                   | Name       | Status  | Networks                            | Image           | Flavor   |
+--------------------------------------+------------+---------+-------------------------------------+-----------------+----------+
| fa3a20c0-f0f4-46eb-b63f-69abba312d03 | CentOS-St8 | SHUTOFF | private=10.0.0.251, 192.168.100.140 | CentOS-Stream-8 | m1.small |
+--------------------------------------+------------+---------+-------------------------------------+-----------------+----------+

[cent@dlp ~(keystone)]$
openstack server start CentOS-St8
# リソース一覧を表示
# インスタンスで一定の操作をしたのちにデータが取得される

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

+--------------------------------------+----------------------------+----------------------------------
| id                                   | type                       | project_id                       
+--------------------------------------+----------------------------+----------------------------------
| fa3a20c0-f0f4-46eb-b63f-69abba312d03 | instance                   | 3d85d1e79d654b3dade01eb5bfbf0679 
| bbd4fd1d-5a1f-5a70-aac7-81b72a8ece38 | instance_network_interface | 3d85d1e79d654b3dade01eb5bfbf0679 
| f0f7ad4d-fcc3-56e2-81fa-fb086d93d6d3 | instance_disk              | 3d85d1e79d654b3dade01eb5bfbf0679 
+--------------------------------------+----------------------------+----------------------------------
+----------------------------------+-----------------------------------------------------------------------
| user_id                          | original_resource_id                                                  
+----------------------------------+-----------------------------------------------------------------------
| ed0bc393ae81411fa1db0828e1d5e160 | fa3a20c0-f0f4-46eb-b63f-69abba312d03                                  
| ed0bc393ae81411fa1db0828e1d5e160 | instance-00000001-fa3a20c0-f0f4-46eb-b63f-69abba312d03-tapa067b36e-58 
| ed0bc393ae81411fa1db0828e1d5e160 | fa3a20c0-f0f4-46eb-b63f-69abba312d03-vda                              
+----------------------------------+-----------------------------------------------------------------------
+----------------------------------+----------+----------------------------------+--------------
| started_at                       | ended_at | revision_start                   | revision_end 
+----------------------------------+----------+----------------------------------+--------------
| 2022-06-02T02:25:09.610325+00:00 | None     | 2022-06-02T02:25:09.610337+00:00 | None         
| 2022-06-02T02:27:19.615851+00:00 | None     | 2022-06-02T02:27:19.615862+00:00 | None         
| 2022-06-02T02:27:19.684790+00:00 | None     | 2022-06-02T02:27:19.684797+00:00 | None         
+----------------------------------+----------+----------------------------------+--------------
+-------------------------------------------------------------------+
| creator                                                           |
+-------------------------------------------------------------------+
| 0101cdc1b5f64f998ec4d7541fed4771:8787527217494c6a87dd5a3b68dce1ef |
| 0101cdc1b5f64f998ec4d7541fed4771:8787527217494c6a87dd5a3b68dce1ef |
| 0101cdc1b5f64f998ec4d7541fed4771:8787527217494c6a87dd5a3b68dce1ef |
+-------------------------------------------------------------------+

# [instance] リソース詳細

[cent@dlp ~(keystone)]$
openstack metric resource show fa3a20c0-f0f4-46eb-b63f-69abba312d03

+-----------------------+-------------------------------------------------------------------+
| Field                 | Value                                                             |
+-----------------------+-------------------------------------------------------------------+
| created_by_project_id | 8787527217494c6a87dd5a3b68dce1ef                                  |
| created_by_user_id    | 0101cdc1b5f64f998ec4d7541fed4771                                  |
| creator               | 0101cdc1b5f64f998ec4d7541fed4771:8787527217494c6a87dd5a3b68dce1ef |
| ended_at              | None                                                              |
| id                    | fa3a20c0-f0f4-46eb-b63f-69abba312d03                              |
| metrics               | cpu: 8cbabd21-3448-4d74-9cbe-f72fbcaca190                         |
|                       | disk.ephemeral.size: fe79c893-6062-47e0-adc6-ee54eb887724         |
|                       | disk.root.size: 2f730498-9d34-4b6f-92a8-9fff34c8b109              |
|                       | memory.usage: 979c92e0-3320-4a64-bc9f-97fe2f6d4a34                |
|                       | memory: 6ab9cbbb-63f1-42a3-88c6-ac8d61f16d4b                      |
|                       | vcpus: 52f86ccd-6469-472a-80d4-b47d1ba0b2cb                       |
| original_resource_id  | fa3a20c0-f0f4-46eb-b63f-69abba312d03                              |
| project_id            | 3d85d1e79d654b3dade01eb5bfbf0679                                  |
| revision_end          | None                                                              |
| revision_start        | 2022-06-02T02:25:09.610337+00:00                                  |
| started_at            | 2022-06-02T02:25:09.610325+00:00                                  |
| type                  | instance                                                          |
| user_id               | ed0bc393ae81411fa1db0828e1d5e160                                  |
+-----------------------+-------------------------------------------------------------------+

# CPU

[cent@dlp ~(keystone)]$
openstack metric measures show 8cbabd21-3448-4d74-9cbe-f72fbcaca190

+---------------------------+-------------+---------------+
| timestamp                 | granularity |         value |
+---------------------------+-------------+---------------+
| 2022-06-02T11:25:00+09:00 |       300.0 | 91380000000.0 |
+---------------------------+-------------+---------------+

# メモリー使用

[cent@dlp ~(keystone)]$
openstack metric measures show 979c92e0-3320-4a64-bc9f-97fe2f6d4a34

+---------------------------+-------------+------------+
| timestamp                 | granularity |      value |
+---------------------------+-------------+------------+
| 2022-06-02T11:25:00+09:00 |       300.0 | 414.765625 |
+---------------------------+-------------+------------+

# [instance_network_interface] リソース詳細

[cent@dlp ~(keystone)]$
openstack metric resource show bbd4fd1d-5a1f-5a70-aac7-81b72a8ece38

+-----------------------+-----------------------------------------------------------------------+
| Field                 | Value                                                                 |
+-----------------------+-----------------------------------------------------------------------+
| created_by_project_id | 8787527217494c6a87dd5a3b68dce1ef                                      |
| created_by_user_id    | 0101cdc1b5f64f998ec4d7541fed4771                                      |
| creator               | 0101cdc1b5f64f998ec4d7541fed4771:8787527217494c6a87dd5a3b68dce1ef     |
| ended_at              | None                                                                  |
| id                    | bbd4fd1d-5a1f-5a70-aac7-81b72a8ece38                                  |
| metrics               | network.incoming.bytes: b8034817-faff-42f2-9795-05ff848d432c          |
|                       | network.incoming.packets: 0fec50e8-70d9-4ef8-8b32-fe19c94bea2a        |
|                       | network.outgoing.bytes: ed43991e-6a4c-4d42-89ab-841c2253e1cf          |
|                       | network.outgoing.packets: ab79cbd1-4f6c-445c-a135-859a1aa46f83        |
| original_resource_id  | instance-00000001-fa3a20c0-f0f4-46eb-b63f-69abba312d03-tapa067b36e-58 |
| project_id            | 3d85d1e79d654b3dade01eb5bfbf0679                                      |
| revision_end          | None                                                                  |
| revision_start        | 2022-06-02T02:27:19.615862+00:00                                      |
| started_at            | 2022-06-02T02:27:19.615851+00:00                                      |
| type                  | instance_network_interface                                            |
| user_id               | ed0bc393ae81411fa1db0828e1d5e160                                      |
+-----------------------+-----------------------------------------------------------------------+

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

[cent@dlp ~(keystone)]$
openstack metric measures show b8034817-faff-42f2-9795-05ff848d432c

+---------------------------+-------------+---------+
| timestamp                 | granularity |   value |
+---------------------------+-------------+---------+
| 2022-06-02T11:25:00+09:00 |       300.0 | 39710.0 |
+---------------------------+-------------+---------+

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

[cent@dlp ~(keystone)]$
openstack metric measures show ed43991e-6a4c-4d42-89ab-841c2253e1cf

+---------------------------+-------------+---------+
| timestamp                 | granularity |   value |
+---------------------------+-------------+---------+
| 2022-06-02T11:25:00+09:00 |       300.0 | 46013.0 |
+---------------------------+-------------+---------+
関連コンテンツ