OpenStack Kilo : Ceilometer 利用方法2015/06/20 |
OpenStack Metering Service(Ceilometer)の利用方法です。
ここでは例として以下のような環境を構築しています。
| +------------------+ | +------------------------+ | [ Control Node ] | | | [ Network Node ] | | Keystone |10.0.0.30 | 10.0.0.50| DHCP,L3,L2 Agent | | Glance |------------+------------| Metadata Agent | | Nova API |eth0 | eth0| Ceilometer Services | | Neutron Server | | | | +------------------+ | +------------------------+ eth0|10.0.0.51 +--------------------+ | [ Compute Node ] | | Nova Compute | | L2 Agent | | Ceilometer-Compute | +--------------------+ |
[1] | Ceilometer の設定#1, Ceilometer の設定#2, Ceilometer の設定#3 の各ノードの設定が完了した状態で以下のコマンドを入力すると、設定に問題なければ以下のように結果が返ってきます。 |
[root@dlp ~(keystone)]# ceilometer meter-list +-------------------+------------+----------+------------------------+---------------------+-------------------+ | Name | Type | Unit | Resource ID | User ID | Project ID | +-------------------+------------+----------+------------------------+---------------------+-------------------+ | cpu | cumulative | ns | 2c7a1025-30d6-446a-... | 704a7f5cf84a4797... | 98ea1b896d3a48... | | image | gauge | image | 2aab2d1a-e1e8-45c9-... | None ... | 98ea1b896d3a48... | | image.size | gauge | B | 2aab2d1a-e1e8-45c9-... | None ... | 98ea1b896d3a48... | | instance | gauge | instance | 2c7a1025-30d6-446a-... | 704a7f5cf84a4797... | 98ea1b896d3a48... | | instance:m1.small | gauge | instance | 2c7a1025-30d6-446a-... | 704a7f5cf84a4797... | 98ea1b896d3a48... | +-------------------+------------+----------+------------------------+---------------------+-------------------+ |
[2] | ここまでの設定で、Compute Service(Nova)の監視が可能な状態となっています。インスタンスを作成して起動した後、再度 meter-list を見ると以下のように取得されたメーターが確認できます。 |
[root@dlp ~(keystone)]# Int_Net_ID=`neutron net-list | grep int_net | awk '{ print $2 }'` [root@dlp ~(keystone)]# nova boot --flavor 2 --image CentOS7 --security_group default --nic net-id=$Int_Net_ID CentOS_7 [root@dlp ~(keystone)]# ceilometer meter-list +---------------------+------------+----------+------------------------+---------------------+-------------------+ | Name | Type | Unit | Resource ID | User ID | Project ID | +---------------------+------------+----------+------------------------+---------------------+-------------------+ | cpu | cumulative | ns | 2c7a1025-30d6-446a-... | 704a7f5cf84a4797... | 98ea1b896d3a48... | | disk.ephemeral.size | gauge | GB | 0fbc0272-285a-4d97-... | 704a7f5cf84a4797... | 98ea1b896d3a48... | | disk.ephemeral.size | gauge | GB | 2c7a1025-30d6-446a-... | 704a7f5cf84a4797... | 98ea1b896d3a48... | | disk.root.size | gauge | GB | 0fbc0272-285a-4d97-... | 704a7f5cf84a4797... | 98ea1b896d3a48... | | disk.root.size | gauge | GB | 2c7a1025-30d6-446a-... | 704a7f5cf84a4797... | 98ea1b896d3a48... | | image | gauge | image | 2aab2d1a-e1e8-45c9-... | None ... | 98ea1b896d3a48... | | image.size | gauge | B | 2aab2d1a-e1e8-45c9-... | None ... | 98ea1b896d3a48... | | instance | gauge | instance | 0fbc0272-285a-4d97-... | 704a7f5cf84a4797... | 98ea1b896d3a48... | | instance | gauge | instance | 2c7a1025-30d6-446a-... | 704a7f5cf84a4797... | 98ea1b896d3a48... | | instance:m1.small | gauge | instance | 0fbc0272-285a-4d97-... | 704a7f5cf84a4797... | 98ea1b896d3a48... | | instance:m1.small | gauge | instance | 2c7a1025-30d6-446a-... | 704a7f5cf84a4797... | 98ea1b896d3a48... | | memory | gauge | MB | 0fbc0272-285a-4d97-... | 704a7f5cf84a4797... | 98ea1b896d3a48... | | memory | gauge | MB | 2c7a1025-30d6-446a-... | 704a7f5cf84a4797... | 98ea1b896d3a48... | | port | gauge | port | 188e5409-c6f4-4a7a-... | f13070920e5c477e... | 4e84300cbeeb4a... | | port.create | delta | port | 188e5409-c6f4-4a7a-... | f13070920e5c477e... | 4e84300cbeeb4a... | | vcpus | gauge | vcpu | 0fbc0272-285a-4d97-... | 704a7f5cf84a4797... | 98ea1b896d3a48... | | vcpus | gauge | vcpu | 2c7a1025-30d6-446a-... | 704a7f5cf84a4797... | 98ea1b896d3a48... | +---------------------+------------+----------+------------------------+---------------------+-------------------+ |
[3] | Image Service(Glance)の監視を有効にするには以下のように設定します。 |
[root@dlp ~(keystone)]#
vi /etc/glance/glance-api.conf # 218行目:コメント解除し変更 notification_driver = messagingv2
# 233行目:コメント解除 rpc_backend = 'rabbit' # 237-238行目:コメント解除して RabbitMQ サーバー指定 rabbit_host = 10.0.0.30 rabbit_port = 5672 # 240-241行目:RabbitMQ ユーザーIDとパスワード指定 rabbit_userid = guest rabbit_password = password
[root@dlp ~(keystone)]#
vi /etc/glance/glance-registry.conf # 88行目:コメント解除し変更 notification_driver = messagingv2
# 94行目:コメント解除 rpc_backend = 'rabbit' # 98-99行目:コメント解除して RabbitMQ サーバー指定 rabbit_host = 10.0.0.30 rabbit_port = 5672 # 101-102行目:RabbitMQ ユーザーIDとパスワード指定 rabbit_userid = guest rabbit_password = password
[root@dlp ~(keystone)]# systemctl restart openstack-glance-api openstack-glance-registry
# 監視が有効になっているか確認 [root@dlp ~(keystone)]# ceilometer meter-list +-------------------+------------+----------+------------------------+---------------------+-------------------+ | Name | Type | Unit | Resource ID | User ID | Project ID | +-------------------+------------+----------+------------------------+---------------------+-------------------+ | cpu | cumulative | ns | 2c7a1025-30d6-446a-... | 704a7f5cf84a4797... | 98ea1b896d3a48... | | cpu_util | gauge | % | 2c7a1025-30d6-446a-... | 704a7f5cf84a4797... | 98ea1b896d3a48... | | image | gauge | image | 2aab2d1a-e1e8-45c9-... | None ... | 98ea1b896d3a48... | | image.size | gauge | B | 2aab2d1a-e1e8-45c9-... | None ... | 98ea1b896d3a48... | | instance | gauge | instance | 2c7a1025-30d6-446a-... | 704a7f5cf84a4797... | 98ea1b896d3a48... | | instance:m1.small | gauge | instance | 2c7a1025-30d6-446a-... | 704a7f5cf84a4797... | 98ea1b896d3a48... | +-------------------+------------+----------+------------------------+---------------------+-------------------+ # 試しにイメージを追加 [root@dlp ~(keystone)]# glance image-create --name="CentOS71" --is-public=true --disk-format=qcow2 --container-format=bare < /var/kvm/images/centos7.img [root@dlp ~(keystone)]# ceilometer meter-list +-------------------+------------+----------+------------------------+---------------------+-------------------+ | Name | Type | Unit | Resource ID | User ID | Project ID | +-------------------+------------+----------+------------------------+---------------------+-------------------+ | cpu | cumulative | ns | 2c7a1025-30d6-446a-... | 704a7f5cf84a4797... | 98ea1b896d3a48... | | cpu_util | gauge | % | 2c7a1025-30d6-446a-... | 704a7f5cf84a4797... | 98ea1b896d3a48... | | image | gauge | image | 2aab2d1a-e1e8-45c9-... | None ... | 98ea1b896d3a48... | | image | gauge | image | 95b05349-e9cb-4e88-... | None ... | 98ea1b896d3a48... | | image.size | gauge | B | 2aab2d1a-e1e8-45c9-... | None ... | 98ea1b896d3a48... | | image.size | gauge | B | 95b05349-e9cb-4e88-... | None ... | 98ea1b896d3a48... | | image.update | delta | image | 95b05349-e9cb-4e88-... | None ... | 98ea1b896d3a48... | | image.upload | delta | image | 95b05349-e9cb-4e88-... | None ... | 98ea1b896d3a48... | | instance | gauge | instance | 2c7a1025-30d6-446a-... | 704a7f5cf84a4797... | 98ea1b896d3a48... | | instance:m1.small | gauge | instance | 2c7a1025-30d6-446a-... | 704a7f5cf84a4797... | 98ea1b896d3a48... | +-------------------+------------+----------+------------------------+---------------------+-------------------+ # データが取得された |
[4] | Block Storage(Cinder)の監視を有効にするには以下のように設定します。 |
# [DEFAULT] セクションの中へ追記
control_exchange = cinder
notification_driver = messagingv2 # Control Node [root@dlp ~(keystone)]# systemctl restart openstack-cinder-api openstack-cinder-scheduler # Network Node [root@network ~]# systemctl restart openstack-cinder-volume
# 監視が有効になっているか確認 [root@dlp ~(keystone)]# ceilometer meter-list +------------+-------+-------+------------------------+---------+----------------------+ | Name | Type | Unit | Resource ID | User ID | Project ID | +------------+-------+-------+------------------------+---------+----------------------+ | image | gauge | image | 2aab2d1a-e1e8-45c9-... | None | 98ea1b896d3a48438... | | image.size | gauge | B | 2aab2d1a-e1e8-45c9-... | None | 98ea1b896d3a48438... | +------------+-------+-------+------------------------+---------+----------------------+[root@dlp ~(keystone)]# cinder create --display_name disk01 10 [root@dlp ~(keystone)]# ceilometer meter-list +---------------------+-------+--------+------------------------+---------------------+--------------------+ | Name | Type | Unit | Resource ID | User ID | Project ID | +---------------------+-------+--------+------------------------+---------------------+--------------------+ | image | gauge | image | 2aab2d1a-e1e8-45c9-... | None | 98ea1b896d3a484... | | image.size | gauge | B | 2aab2d1a-e1e8-45c9-... | None | 98ea1b896d3a484... | | volume | gauge | volume | 1dadb51f-9acb-4845-... | 704a7f5cf84a4797... | 98ea1b896d3a484... | | volume.create.end | delta | volume | 1dadb51f-9acb-4845-... | 704a7f5cf84a4797... | 98ea1b896d3a484... | | volume.create.start | delta | volume | 1dadb51f-9acb-4845-... | 704a7f5cf84a4797... | 98ea1b896d3a484... | | volume.size | gauge | GB | 1dadb51f-9acb-4845-... | 704a7f5cf84a4797... | 98ea1b896d3a484... | +---------------------+-------+--------+------------------------+---------------------+--------------------+ |
[5] | Network Service(Neutron)の監視を有効にするには以下のように設定します。 |
# Control Node, Network Node, Compute Node で設定変更 [root@dlp ~(keystone)]# vi /etc/neutron/neutron.conf # 529行目:コメント解除して追記 notification_driver= messagingv2
# Control Node [root@dlp ~(keystone)]# systemctl restart neutron-server # Network Node [root@network ~]# systemctl restart neutron-dhcp-agent neutron-l3-agent neutron-metadata-agent neutron-openvswitch-agent # Compute Node [root@node01 ~]# systemctl restart neutron-openvswitch-agent
# 監視が有効になっているか確認 [root@dlp ~(keystone)]# ceilometer meter-list +-------------------+------------+----------+-------------------+-----------------------+---------------------+ | Name | Type | Unit | Resource ID | User ID | Project ID | +-------------------+------------+----------+-------------------+-----------------------+---------------------+ | cpu | cumulative | ns | 2c7a1025-30d6-... | 704a7f5cf84a479796... | 98ea1b896d3a4843... | | cpu_util | gauge | % | 2c7a1025-30d6-... | 704a7f5cf84a479796... | 98ea1b896d3a4843... | | image | gauge | image | 2aab2d1a-e1e8-... | None ... | 98ea1b896d3a4843... | | image.size | gauge | B | 2aab2d1a-e1e8-... | None ... | 98ea1b896d3a4843... | | instance | gauge | instance | 2c7a1025-30d6-... | 704a7f5cf84a479796... | 98ea1b896d3a4843... | | instance:m1.small | gauge | instance | 2c7a1025-30d6-... | 704a7f5cf84a479796... | 98ea1b896d3a4843... | +-------------------+------------+----------+-------------------+-----------------------+---------------------+[root@dlp ~(keystone)]# neutron net-create test_net [root@dlp ~(keystone)]# ceilometer meter-list +-------------------+------------+----------+-------------------+-----------------------+---------------------+ | Name | Type | Unit | Resource ID | User ID | Project ID | +-------------------+------------+----------+-------------------+-----------------------+---------------------+ | cpu | cumulative | ns | 2c7a1025-30d6-... | 704a7f5cf84a479796... | 98ea1b896d3a4843... | | cpu_util | gauge | % | 2c7a1025-30d6-... | 704a7f5cf84a479796... | 98ea1b896d3a4843... | | image | gauge | image | 2aab2d1a-e1e8-... | None ... | 98ea1b896d3a4843... | | image.size | gauge | B | 2aab2d1a-e1e8-... | None ... | 98ea1b896d3a4843... | | instance | gauge | instance | 2c7a1025-30d6-... | 704a7f5cf84a479796... | 98ea1b896d3a4843... | | instance:m1.small | gauge | instance | 2c7a1025-30d6-... | 704a7f5cf84a479796... | 98ea1b896d3a4843... | | network | gauge | network | c1160636-02be-... | 704a7f5cf84a479796... | 98ea1b896d3a4843... | | network.create | delta | network | c1160636-02be-... | 704a7f5cf84a479796... | 98ea1b896d3a4843... | +-------------------+------------+----------+-------------------+-----------------------+---------------------+ |
Sponsored Link |
|