OpenStack Juno : Ceilometer 利用方法2015/02/07 |
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 | +------------+-------+-------+--------------------------------------+---------+----------------------------------+ | image | gauge | image | 4a663fce-97eb-42d3-93d6-415e477bc0a4 | None | e8f6ac69de5f46afa189fcefd99c8a1a | | image.size | gauge | B | 4a663fce-97eb-42d3-93d6-415e477bc0a4 | None | e8f6ac69de5f46afa189fcefd99c8a1a | +------------+-------+-------+--------------------------------------+---------+----------------------------------+ |
[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_70 [root@dlp ~(keystone)]# ceilometer meter-list +---------------------+-------+----------+-----------------------+-----------------+-------------------+ | Name | Type | Unit | Resource ID | User ID | Project ID | +---------------------+-------+----------+-----------------------+-----------------+-------------------+ | disk.ephemeral.size | gauge | GB | f2784a7b-9480-4b6a... | a52762888677... | e8f6ac69de5f46... | | disk.root.size | gauge | GB | f2784a7b-9480-4b6a... | a52762888677... | e8f6ac69de5f46... | | image | gauge | image | 4a663fce-97eb-42d3... | None | e8f6ac69de5f46... | | image.size | gauge | B | 4a663fce-97eb-42d3... | None | e8f6ac69de5f46... | | instance | gauge | instance | f2784a7b-9480-4b6a... | a52762888677... | e8f6ac69de5f46... | | instance:m1.small | gauge | instance | f2784a7b-9480-4b6a... | a52762888677... | e8f6ac69de5f46... | | memory | gauge | MB | f2784a7b-9480-4b6a... | a52762888677... | e8f6ac69de5f46... | | port | gauge | port | c46f43f5-705c-4c2e... | 96b4c6f2c60d... | 9e657ab1d2344d... | | port.create | delta | port | c46f43f5-705c-4c2e... | 96b4c6f2c60d... | 9e657ab1d2344d... | | vcpus | gauge | vcpu | f2784a7b-9480-4b6a... | a52762888677... | e8f6ac69de5f46... | +---------------------+-------+----------+-----------------------+-----------------+-------------------+ |
[3] | Image Service(Glance)の監視を有効にするには以下のように設定します。 |
[root@dlp ~(keystone)]#
vi /etc/glance/glance-api.conf # 210行目:コメント解除し変更 notification_driver = messaging
# 216行目:コメント解除 rpc_backend = 'rabbit' # 220,221行目:コメント解除して RabbitMQ サーバー指定 rabbit_host= 10.0.0.30 rabbit_port=5672 # 223,224行目:RabbitMQ ユーザーIDとパスワード指定 rabbit_userid= guest rabbit_password= password
[root@dlp ~(keystone)]# systemctl restart openstack-glance-api
# 監視が有効になっているか確認 [root@dlp ~(keystone)]# ceilometer meter-list +------------+-------+-------+--------------------------------------+---------+----------------------------------+ | Name | Type | Unit | Resource ID | User ID | Project ID | +------------+-------+-------+--------------------------------------+---------+----------------------------------+ | image | gauge | image | 4a663fce-97eb-42d3-93d6-415e477bc0a4 | None | e8f6ac69de5f46afa189fcefd99c8a1a | | image.size | gauge | B | 4a663fce-97eb-42d3-93d6-415e477bc0a4 | None | e8f6ac69de5f46afa189fcefd99c8a1a | +------------+-------+-------+--------------------------------------+---------+----------------------------------+ # 試しにイメージを追加 [root@dlp ~(keystone)]# glance image-create --name="CentOS70" --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 | +--------------+-------+-------+--------------------------------------+---------+----------------------------------+ | image | gauge | image | 4a663fce-97eb-42d3-93d6-415e477bc0a4 | None | e8f6ac69de5f46afa189fcefd99c8a1a | | image | gauge | image | e093db0c-2195-49a4-bfa2-dd813e6607d6 | None | e8f6ac69de5f46afa189fcefd99c8a1a | | image.size | gauge | B | 4a663fce-97eb-42d3-93d6-415e477bc0a4 | None | e8f6ac69de5f46afa189fcefd99c8a1a | | image.size | gauge | B | e093db0c-2195-49a4-bfa2-dd813e6607d6 | None | e8f6ac69de5f46afa189fcefd99c8a1a | | image.update | delta | image | e093db0c-2195-49a4-bfa2-dd813e6607d6 | None | e8f6ac69de5f46afa189fcefd99c8a1a | | image.upload | delta | image | e093db0c-2195-49a4-bfa2-dd813e6607d6 | None | e8f6ac69de5f46afa189fcefd99c8a1a | +--------------+-------+-------+--------------------------------------+---------+----------------------------------+ # データが取得された |
[4] | Block Storage(Cinder)の監視を有効にするには以下のように設定します。 |
# [DEFAULT] セクションの中へ追記
control_exchange=cinder
notification_driver=cinder.openstack.common.notifier.rpc_notifier # 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 | 4a663fce-97eb-42d3-93d6-415e477bc0a4 | None | e8f6ac69de5f46afa189fcefd99c8a1a | | image.size | gauge | B | 4a663fce-97eb-42d3-93d6-415e477bc0a4 | None | e8f6ac69de5f46afa189fcefd99c8a1a | +------------+-------+-------+--------------------------------------+---------+----------------------------------+[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 | 4a663fce-97eb-42d3... | None | e8f6ac69de5f46afa189fcefd99c8a1a | | image.size | gauge | B | 4a663fce-97eb-42d3... | None | e8f6ac69de5f46afa189fcefd99c8a1a | | volume | gauge | volume | fc17f001-492b-4752... | a52762888677... | e8f6ac69de5f46afa189fcefd99c8a1a | | volume.size | gauge | GB | fc17f001-492b-4752... | a52762888677... | e8f6ac69de5f46afa189fcefd99c8a1a | +-------------+-------+--------+-----------------------+-----------------+----------------------------------+ # データが取得された |
[5] | Network Service(Neutron)の監視を有効にするには以下のように設定します。 |
# Control Node, Network Node, Compute Node で設定変更 [root@dlp ~(keystone)]# vi /etc/neutron/neutron.conf # 428行目:コメント解除して追記 notification_driver= neutron.openstack.common.notifier.rpc_notifier
# 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 | +------------+-------+-------+--------------------------------------+---------+----------------------------------+ | image | gauge | image | 4a663fce-97eb-42d3-93d6-415e477bc0a4 | None | e8f6ac69de5f46afa189fcefd99c8a1a | | image.size | gauge | B | 4a663fce-97eb-42d3-93d6-415e477bc0a4 | None | e8f6ac69de5f46afa189fcefd99c8a1a | +------------+-------+-------+--------------------------------------+---------+----------------------------------+[root@dlp ~(keystone)]# neutron net-create test_net [root@dlp ~(keystone)]# ceilometer meter-list [root@dlp ~(keystone)]# ceilometer meter-list +----------------+-------+---------+-----------------------+------------------+----------------------------------+ | Name | Type | Unit | Resource ID | User ID | Project ID | +----------------+-------+---------+-----------------------+------------------+----------------------------------+ | image | gauge | image | 4a663fce-97eb-42d3... | None | e8f6ac69de5f46afa189fcefd99c8a1a | | image.size | gauge | B | 4a663fce-97eb-42d3... | None | e8f6ac69de5f46afa189fcefd99c8a1a | | network | gauge | network | 438080d6-5176-4da4... | a527628886774... | e8f6ac69de5f46afa189fcefd99c8a1a | | network.create | delta | network | 438080d6-5176-4da4... | a527628886774... | e8f6ac69de5f46afa189fcefd99c8a1a | +----------------+-------+---------+-----------------------+------------------+----------------------------------+ # データが取得された |
Sponsored Link |