CentOS 6
Sponsored Link

OpenStack Icehouse : Ceilometer 利用方法2015/02/06

 
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 |
+------+------+------+-------------+---------+------------+
+------+------+------+-------------+---------+------------+
[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 CentOS6 --security_group default --nic net-id=$Int_Net_ID CentOS_66

[root@dlp ~(keystone)]#
ceilometer meter-list

+---------------------+-------+----------+-----------------------+----------------------+---------------------+
| Name                | Type  | Unit     | Resource ID           | User ID              | Project ID          |
+---------------------+-------+----------+-----------------------+----------------------+---------------------+
| disk.ephemeral.size | gauge | GB       | eaf78cd9-07f8-4820... | 709ba07202cf4e93b... | 9b15b4c4f98a40da... |
| disk.root.size      | gauge | GB       | eaf78cd9-07f8-4820... | 709ba07202cf4e93b... | 9b15b4c4f98a40da... |
| instance            | gauge | instance | eaf78cd9-07f8-4820... | 709ba07202cf4e93b... | 9b15b4c4f98a40da... |
| instance.scheduled  | delta | instance | eaf78cd9-07f8-4820... | 709ba07202cf4e93b... | 9b15b4c4f98a40da... |
| instance:m1.small   | gauge | instance | eaf78cd9-07f8-4820... | 709ba07202cf4e93b... | 9b15b4c4f98a40da... |
| memory              | gauge | MB       | eaf78cd9-07f8-4820... | 709ba07202cf4e93b... | 9b15b4c4f98a40da... |
| vcpus               | gauge | vcpu     | eaf78cd9-07f8-4820... | 709ba07202cf4e93b... | 9b15b4c4f98a40da... |
+---------------------+-------+----------+-----------------------+----------------------+---------------------+
[3] Image Service(Glance)の監視を有効にするには以下のように設定します。
[root@dlp ~(keystone)]#
vi /etc/glance/glance-api.conf
# 235行目:コメント解除し変更

notification_driver =
messaging
# 242,243行目:コメント解除, RabbitMQ サーバーのIP指定

rabbit_host=
10.0.0.30

rabbit_port=5672
# 245,246行目:コメント解除, RabbitMQ ユーザーIDとパスワード指定

rabbit_userid=
guest

rabbit_password=
password
[root@dlp ~(keystone)]#
/etc/rc.d/init.d/openstack-glance-api restart

# 監視が有効になっているか確認

[root@dlp ~(keystone)]#
ceilometer meter-list

+------+------+------+-------------+---------+------------+
| Name | Type | Unit | Resource ID | User ID | Project ID |
+------+------+------+-------------+---------+------------+
+------+------+------+-------------+---------+------------+

# 試しにイメージを追加

[root@dlp ~(keystone)]#
glance image-create --name="CentOS66" --is-public=true --disk-format=qcow2 --container-format=bare < /var/kvm/images/centos6.img

[root@dlp ~(keystone)]#
ceilometer meter-list

+---------------------+-------+----------+-----------------------+----------+---------------------+
| Name                | Type  | Unit     | Resource ID           | User ID  | Project ID          |
+---------------------+-------+----------+-----------------------+----------+---------------------+
| image.update        | delta | image    | 9cd91fe5-f449-4d9a... | None     | 9b15b4c4f98a40da... |
| image.upload        | delta | image    | 9cd91fe5-f449-4d9a... | None     | 9b15b4c4f98a40da... |
+---------------------+-------+----------+-----------------------+----------+---------------------+
# データが取得された

[4] Block Storage(Cinder)の監視を有効にするには以下のように設定します。
# Control Node, Network Node で設定変更

[root@dlp ~(keystone)]#
vi /etc/cinder/cinder.conf
# [DEFAULT] セクションの中へ追記

control_exchange=cinder
notification_driver=cinder.openstack.common.notifier.rpc_notifier
# Control Node

[root@dlp ~(keystone)]#
for service in api scheduler; do
/etc/rc.d/init.d/openstack-cinder-$service restart
done

# Network Node

[root@network ~]#
/etc/rc.d/init.d/openstack-cinder-volume restart

# 監視が有効になっているか確認

[root@dlp ~(keystone)]#
ceilometer meter-list

+------+------+------+-------------+---------+------------+
| Name | Type | Unit | Resource ID | User ID | Project ID |
+------+------+------+-------------+---------+------------+
+------+------+------+-------------+---------+------------+
[root@dlp ~(keystone)]#
cinder create --display_name disk01 10

[root@dlp ~(keystone)]#
ceilometer meter-list

+---------------------+-------+----------+-----------------------+-------------------+--------------------+
| Name                | Type  | Unit     | Resource ID           | User ID           | Project ID         |
+---------------------+-------+----------+-----------------------+-------------------+--------------------+
| volume              | gauge | volume   | 813a7145-9fb9-434c... | 709ba07202cf4e... | 9b15b4c4f98a40d... |
| volume.size         | gauge | GB       | 813a7145-9fb9-434c... | 709ba07202cf4e... | 9b15b4c4f98a40d... |
+---------------------+-------+----------+-----------------------+-------------------+--------------------+
# データが取得された

[5] Network Service(Neutron)の監視を有効にするには以下のように設定します。
# Control Node, Network Node, Compute Node で設定変更

[root@dlp ~(keystone)]#
vi /etc/neutron/neutron.conf
# 196行目:コメント解除

notification_driver=neutron.openstack.common.notifier.rpc_notifier
# Control Node

[root@dlp ~(keystone)]#
/etc/rc.d/init.d/neutron-server restart

# Network Node

[root@network ~]#
for service in dhcp-agent l3-agent metadata-agent openvswitch-agent; do
/etc/rc.d/init.d/neutron-$service restart
done

# Compute Node

[root@node01 ~]#
/etc/rc.d/init.d/neutron-openvswitch-agent restart

# 監視が有効になっているか確認

[root@dlp ~(keystone)]#
ceilometer meter-list

+------+------+------+-------------+---------+------------+
| Name | Type | Unit | Resource ID | User ID | Project ID |
+------+------+------+-------------+---------+------------+
+------+------+------+-------------+---------+------------+
[root@dlp ~(keystone)]#
neutron net-create test_net

[root@dlp ~(keystone)]#
ceilometer meter-list

+---------------------+-------+----------+-----------------------+-------------------+--------------------+
| Name                | Type  | Unit     | Resource ID           | User ID           | Project ID         |
+---------------------+-------+----------+-----------------------+-------------------+--------------------+
| network             | gauge | network  | 2de8e4fe-7fb3-4fd3... | 709ba07202cf4e... | 9b15b4c4f98a40d... |
| network.create      | delta | network  | 2de8e4fe-7fb3-4fd3... | 709ba07202cf4e... | 9b15b4c4f98a40d... |
+---------------------+-------+----------+-----------------------+-------------------+--------------------+
# データが取得された

関連コンテンツ