OpenStack Rocky : Ceilometer 利用方法(Nova Compute)2018/09/06 |
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 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 +--------------------------------------+----------------------------+---------------------------------- | 45d4a9ba-d6ec-4263-a81c-487702f98e33 | instance | 3c9dc9d8d71149a7b835e1f5813d2eb8 | bbdaa383-5531-57a5-b411-e991064fa095 | instance_network_interface | 3c9dc9d8d71149a7b835e1f5813d2eb8 | f909ac06-3daa-566e-93d4-10141ad2ce8a | instance_disk | 3c9dc9d8d71149a7b835e1f5813d2eb8 | 5b30f928-8834-4ab5-a5ce-760c48d4c9b7 | instance | 3c9dc9d8d71149a7b835e1f5813d2eb8 +--------------------------------------+----------------------------+---------------------------------- +----------------------------------+----------------------------------------------------------------------- | user_id | original_resource_id +----------------------------------+----------------------------------------------------------------------- | e2252ff04be3409e8e823a0a3a925cad | 45d4a9ba-d6ec-4263-a81c-487702f98e33 | e2252ff04be3409e8e823a0a3a925cad | instance-00000001-5b30f928-8834-4ab5-a5ce-760c48d4c9b7-tapc06aa74c-59 | e2252ff04be3409e8e823a0a3a925cad | 5b30f928-8834-4ab5-a5ce-760c48d4c9b7-vda | e2252ff04be3409e8e823a0a3a925cad | 5b30f928-8834-4ab5-a5ce-760c48d4c9b7 +----------------------------------+----------------------------------------------------------------------- +----------------------------------+----------------------------------+---------------------------------- | started_at | ended_at | revision_start +----------------------------------+----------------------------------+---------------------------------- | 2018-09-06T05:29:12.129912+00:00 | 2018-09-06T05:29:26.563478+00:00 | 2018-09-06T05:29:28.621884+00:00 | 2018-09-06T05:30:30.641687+00:00 | None | 2018-09-06T05:30:30.641714+00:00 | 2018-09-06T05:30:30.648533+00:00 | None | 2018-09-06T05:30:30.648562+00:00 | 2018-09-06T05:35:33.287153+00:00 | None | 2018-09-06T05:35:33.287189+00:00 +----------------------------------+----------------------------------+---------------------------------- +--------------+-------------------------------------------------------------------+ | revision_end | creator | +--------------+-------------------------------------------------------------------+ | None | cfc889992c144012a0092b270bfa0fbd:ece4ac6c7e764a979e36ba0b2faf848e | | None | cfc889992c144012a0092b270bfa0fbd:ece4ac6c7e764a979e36ba0b2faf848e | | None | cfc889992c144012a0092b270bfa0fbd:ece4ac6c7e764a979e36ba0b2faf848e | | None | cfc889992c144012a0092b270bfa0fbd:ece4ac6c7e764a979e36ba0b2faf848e | +--------------+-------------------------------------------------------------------+ # instance リソース詳細 [cent@dlp ~(keystone)]$ openstack metric resource show 5b30f928-8834-4ab5-a5ce-760c48d4c9b7 +-----------------------+-------------------------------------------------------------------+ | Field | Value | +-----------------------+-------------------------------------------------------------------+ | created_by_project_id | ece4ac6c7e764a979e36ba0b2faf848e | | created_by_user_id | cfc889992c144012a0092b270bfa0fbd | | creator | cfc889992c144012a0092b270bfa0fbd:ece4ac6c7e764a979e36ba0b2faf848e | | ended_at | None | | id | 5b30f928-8834-4ab5-a5ce-760c48d4c9b7 | | metrics | cpu.delta: 792767cb-7473-442d-8641-d35b049bac7e | | | cpu: 28d25273-3b46-4744-b2c3-58b515f1df3d | | | cpu_util: 2e66bce3-e8fb-41ad-86a9-86d2ff919a3c | | | disk.ephemeral.size: 861a6f17-4d7a-427d-a9e5-54f81632e575 | | | disk.root.size: 8c355fa8-d8a3-4184-aef2-0763b0bfc9d4 | | | memory.usage: 6d806a52-2be2-4e69-8845-c3b6aa4e1f95 | | | memory: 880b055e-ec37-4c45-86fd-5f9ae1a1f5e0 | | | vcpus: 0a722e23-0356-4f87-9734-b33b3468d508 | | original_resource_id | 5b30f928-8834-4ab5-a5ce-760c48d4c9b7 | | project_id | 3c9dc9d8d71149a7b835e1f5813d2eb8 | | revision_end | None | | revision_start | 2018-09-06T05:46:12.433670+00:00 | | started_at | 2018-09-06T05:35:33.287153+00:00 | | type | instance | | user_id | e2252ff04be3409e8e823a0a3a925cad | +-----------------------+-------------------------------------------------------------------+ # CPU [cent@dlp ~(keystone)]$ openstack metric measures show 28d25273-3b46-4744-b2c3-58b515f1df3d +---------------------------+-------------+---------------+ | timestamp | granularity | value | +---------------------------+-------------+---------------+ | 2018-09-06T14:35:00+09:00 | 300.0 | 71140000000.0 | | 2018-09-06T14:40:00+09:00 | 300.0 | 2.1824e+11 | | 2018-09-06T14:45:00+09:00 | 300.0 | 2.2812e+11 | +---------------------------+-------------+---------------+ # メモリー使用 [cent@dlp ~(keystone)]$ openstack metric measures show 6d806a52-2be2-4e69-8845-c3b6aa4e1f95 +---------------------------+-------------+-------+ | timestamp | granularity | value | +---------------------------+-------------+-------+ | 2018-09-06T14:35:00+09:00 | 300.0 | 267.0 | | 2018-09-06T14:40:00+09:00 | 300.0 | 269.0 | | 2018-09-06T14:45:00+09:00 | 300.0 | 267.0 | +---------------------------+-------------+-------+ # instance_network_interface リソース詳細 [cent@dlp ~(keystone)]$ openstack metric resource show bbdaa383-5531-57a5-b411-e991064fa095 +-----------------------+-----------------------------------------------------------------------+ | Field | Value | +-----------------------+-----------------------------------------------------------------------+ | created_by_project_id | ece4ac6c7e764a979e36ba0b2faf848e | | created_by_user_id | cfc889992c144012a0092b270bfa0fbd | | creator | cfc889992c144012a0092b270bfa0fbd:ece4ac6c7e764a979e36ba0b2faf848e | | ended_at | None | | id | bbdaa383-5531-57a5-b411-e991064fa095 | | metrics | network.incoming.bytes.rate: da01d385-dc5e-4690-8a5d-a8bf9765703d | | | network.incoming.bytes: 8a4fb62e-0e70-445b-b525-e50d1ec20006 | | | network.incoming.packets.rate: 6b616ad9-8ba9-456b-b0e5-8bf6c573b134 | | | network.incoming.packets: 54bfd253-305f-489e-9ee1-347d3468ad24 | | | network.outgoing.bytes.rate: 4918bf2d-9cb0-4ab7-9ab6-74b353faec9d | | | network.outgoing.bytes: b091daa1-2420-4ecf-acb0-04a00263cb82 | | | network.outgoing.packets.rate: 5031c0b1-e10d-4bd3-ac4e-ab419690e195 | | | network.outgoing.packets: 73f304b2-0613-4509-b99c-d0ace3874f4a | | original_resource_id | instance-00000001-5b30f928-8834-4ab5-a5ce-760c48d4c9b7-tapc06aa74c-59 | | project_id | 3c9dc9d8d71149a7b835e1f5813d2eb8 | | revision_end | None | | revision_start | 2018-09-06T05:30:30.641714+00:00 | | started_at | 2018-09-06T05:30:30.641687+00:00 | | type | instance_network_interface | | user_id | e2252ff04be3409e8e823a0a3a925cad | +-----------------------+-----------------------------------------------------------------------+ # ネットワーク インカミング バイト [cent@dlp ~(keystone)]$ openstack metric measures show 8a4fb62e-0e70-445b-b525-e50d1ec20006 +---------------------------+-------------+---------+ | timestamp | granularity | value | +---------------------------+-------------+---------+ | 2018-09-06T14:30:00+09:00 | 300.0 | 6035.0 | | 2018-09-06T14:35:00+09:00 | 300.0 | 30627.0 | | 2018-09-06T14:40:00+09:00 | 300.0 | 42885.0 | | 2018-09-06T14:45:00+09:00 | 300.0 | 47381.0 | +---------------------------+-------------+---------+ # ネットワーク アウトゴーイング バイト [cent@dlp ~(keystone)]$ openstack metric measures show b091daa1-2420-4ecf-acb0-04a00263cb82 +---------------------------+-------------+---------+ | timestamp | granularity | value | +---------------------------+-------------+---------+ | 2018-09-06T14:30:00+09:00 | 300.0 | 3504.0 | | 2018-09-06T14:35:00+09:00 | 300.0 | 22653.0 | | 2018-09-06T14:40:00+09:00 | 300.0 | 32651.0 | | 2018-09-06T14:45:00+09:00 | 300.0 | 36451.0 | +---------------------------+-------------+---------+ |
Sponsored Link |