CentOS 7  

 
Cách sử dụng Dịch vụ đo sáng OpenStack (Ceilometer).
Ví dụ này dựa trên môi trường như sau.
 | ------------------ | ------------------------ | [ Nút điều khiển ] | | | [ Nút mạng ] | | Đá đỉnh vòm |10.0.0.30 | 10.0.0.50| Đại lý DHCP,L3,L2 | | Nhìn thoáng qua |------------- ------------| Đại lý siêu dữ liệu | | API Nova |eth0 | eth0| Dịch vụ đo trần nhà | | Máy chủ neutron | | | | ------------------ | ------------------------- eth0|10.0.0.51 -------------------- | [ Nút tính toán ] | | Điện toán Nova | | Đại lý L2 | | Máy đo trần-Tính toán | -------------------- 
[1] Nếu bạn đã định cấu hình Máy đo trần
[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] Hiện có thể giám sát Dịch vụ điện toán (Nova). Hãy thử tạo và khởi động một phiên bản, sau đó nhập lại lệnh danh sách đồng hồ đo, sau đó các đồng hồ đo được ghi lại như sau.
[root@dlp ~(keystone)]#
neutron net-list

+--------------------------------------+------------+--------------------------------------------------+
| id                                   | name       | subnets                                          |
+--------------------------------------+------------+--------------------------------------------------+
| 1ccd61ea-f82b-42a8-bc2e-03b9c38c62c7 | sharednet1 | 641dcbd3-1eb2-45ab-b8af-4fccf009c226 10.0.0.0/24 |
+--------------------------------------+------------+--------------------------------------------------+

[root@dlp ~(keystone)]#
Int_Net_ID=`neutron net-list | grep sharednet1 | 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] Định cấu hình để bật Dịch vụ hình ảnh giám sát (Glance).
[root@dlp ~(keystone)]#
vi /etc/glance/glance-api.conf
# line 491: uncomment and change

notification_driver =
messagingv2
# line 507: uncomment

rpc_backend = rabbit
# line 1384, 1389: uncomment and specify RabbitMQ server

rabbit_host =
10.0.0.30

rabbit_port = 5672
# line 1401, 1405: RabbitMQ auth info

rabbit_userid =
guest

rabbit_password =
password
[root@dlp ~(keystone)]#
vi /etc/glance/glance-registry.conf
# line 316: uncomment and change

notification_driver =
messagingv2
# line 332: uncomment

rpc_backend = rabbit
# line 1155, 1160: uncomment and specify RabbitMQ server

rabbit_host =
10.0.0.30

rabbit_port = 5672
# line 1172, 1176: RabbitMQ auth info

rabbit_userid =
guest

rabbit_password =
password
[root@dlp ~(keystone)]#
systemctl restart openstack-glance-api openstack-glance-registry

# verify the configuration

[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... |
+-------------------+------------+----------+------------------------+---------------------+-------------------+

# try to add a new image

[root@dlp ~(keystone)]#
glance image-create --name "CentOS71" --file /var/kvm/images/centos7.img --disk-format qcow2 --container-format bare --visibility public

[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... |
+-------------------+------------+----------+------------------------+---------------------+-------------------+
# meters are loged for Image Service

[4] Định cấu hình để bật giám sát Block Storage (Cinder).
# change settings on both Control Node and Storage Node

[root@dlp ~(keystone)]#
vi /etc/cinder/cinder.conf
# add in the [DEFAULT] section

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

# verify the configuration

[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... |
+---------------------+-------+--------+------------------------+---------------------+--------------------+