CentOS 7
Sponsored Link

OpenStack Train : How to use Ceilometer (Nova Compute)2019/10/29

 
This is how to use OpenStack Telemetry Service (Ceilometer) for Nova Compute service.
This example is based on the emvironment like follows.
------------+---------------------------+---------------------------+------------
            |                           |                           |
        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] Change settings for Nova Compute service to enable Telemetry data collention like follows.
[root@node01 ~]#
vi /etc/nova/nova.conf
# add follows into [DEFAULT] section

instance_usage_audit = True
instance_usage_audit_period = hour
notify_on_state_change = vm_and_task_state
# add to the end

[oslo_messaging_notifications]
driver = messagingv2
[root@node01 ~]#
systemctl restart openstack-nova-compute

[2] It's some example to display metrics and meters.
# create and start an instance

[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

# list resources

[cent@dlp ~(keystone)]$
openstack metric resource list

+--------------------------------------+----------------------------+----------------------------------
| id                                   | type                       | project_id                       
+--------------------------------------+----------------------------+----------------------------------
| b3c21241-2800-4109-831b-6fd69d20ecf8 | instance                   | 67b2b71cee384d69939e6b3963e0b2db 
| d54dd550-9c14-4cf2-a2d6-ab14f888154a | instance                   | 67b2b71cee384d69939e6b3963e0b2db 
| 43264c22-f988-5ea1-be0a-3b9ff866bf42 | instance_disk              | 67b2b71cee384d69939e6b3963e0b2db 
| 5709365d-ea09-55b4-b95b-eda98ea55cf3 | instance_network_interface | 67b2b71cee384d69939e6b3963e0b2db 
+--------------------------------------+----------------------------+----------------------------------
+----------------------------------+-----------------------------------------------------------------------
| user_id                          | original_resource_id                                                  
+----------------------------------+-----------------------------------------------------------------------
| 14ad73cc98744e01a51886e13d541013 | b3c21241-2800-4109-831b-6fd69d20ecf8                                  
| 14ad73cc98744e01a51886e13d541013 | d54dd550-9c14-4cf2-a2d6-ab14f888154a                                  
| 14ad73cc98744e01a51886e13d541013 | d54dd550-9c14-4cf2-a2d6-ab14f888154a-vda                              
| 14ad73cc98744e01a51886e13d541013 | instance-0000000e-d54dd550-9c14-4cf2-a2d6-ab14f888154a-tap46350670-7e 
+----------------------------------+-----------------------------------------------------------------------
+----------------------------------+----------+----------------------------------+--------------
| started_at                       | ended_at | revision_start                   | revision_end 
+----------------------------------+----------+----------------------------------+--------------
| 2019-10-29T01:59:43.772826+00:00 | None     | 2019-10-29T01:59:43.772840+00:00 | None         
| 2019-10-29T01:59:36.067876+00:00 | None     | 2019-10-29T02:00:47.166072+00:00 | None         
| 2019-10-29T02:04:23.515341+00:00 | None     | 2019-10-29T02:04:23.515353+00:00 | None         
| 2019-10-29T02:04:24.229284+00:00 | None     | 2019-10-29T02:04:24.229297+00:00 | None         
+----------------------------------+----------+----------------------------------+--------------
+-------------------------------------------------------------------+
| creator                                                           |
+-------------------------------------------------------------------+
| 30440c39a3d0472c94e30fbf13ee91a2:2b9c4eda462e40a4a3d03b0a38f12bf1 |
| 30440c39a3d0472c94e30fbf13ee91a2:2b9c4eda462e40a4a3d03b0a38f12bf1 |
| 30440c39a3d0472c94e30fbf13ee91a2:2b9c4eda462e40a4a3d03b0a38f12bf1 |
| 30440c39a3d0472c94e30fbf13ee91a2:2b9c4eda462e40a4a3d03b0a38f12bf1 |
+-------------------------------------------------------------------+

# details of the instance resource instance

[cent@dlp ~(keystone)]$
openstack metric resource show d54dd550-9c14-4cf2-a2d6-ab14f888154a

+-----------------------+---------------------------------------------------------------------+
| Field                 | Value                                                               |
+-----------------------+---------------------------------------------------------------------+
| created_by_project_id | 2b9c4eda462e40a4a3d03b0a38f12bf1                                    |
| created_by_user_id    | 30440c39a3d0472c94e30fbf13ee91a2                                    |
| creator               | 30440c39a3d0472c94e30fbf13ee91a2:2b9c4eda462e40a4a3d03b0a38f12bf1   |
| ended_at              | None                                                                |
| id                    | d54dd550-9c14-4cf2-a2d6-ab14f888154a                                |
| metrics               | compute.instance.booting.time: f63c17a4-004f-4124-bb58-f1b7077f452e |
|                       | cpu: 21147f46-95a5-4ad7-bcfe-5ea34db7cc3d                           |
|                       | disk.ephemeral.size: d800661c-593b-4190-b5c0-853014f05024           |
|                       | disk.root.size: df84dff1-ce38-4635-a9b9-c30b6b9cff1c                |
|                       | memory.usage: 9f949b91-ce61-464f-a8d4-2cc35f0257eb                  |
|                       | memory: 6f8f47ac-6bf9-4130-a1b2-f9f06eda02c5                        |
|                       | vcpus: 02e3d855-36ee-4f9f-a5b4-34e4b50eb81b                         |
| original_resource_id  | d54dd550-9c14-4cf2-a2d6-ab14f888154a                                |
| project_id            | 67b2b71cee384d69939e6b3963e0b2db                                    |
| revision_end          | None                                                                |
| revision_start        | 2019-10-29T02:00:47.166072+00:00                                    |
| started_at            | 2019-10-29T01:59:36.067876+00:00                                    |
| type                  | instance                                                            |
| user_id               | 14ad73cc98744e01a51886e13d541013                                    |
+-----------------------+---------------------------------------------------------------------+

# CPU

[cent@dlp ~(keystone)]$
openstack metric measures show 21147f46-95a5-4ad7-bcfe-5ea34db7cc3d

+---------------------------+-------------+------------+
| timestamp                 | granularity |      value |
+---------------------------+-------------+------------+
| 2019-10-29T11:00:00+09:00 |       300.0 | 1.1651e+11 |
+---------------------------+-------------+------------+

# memory usage

[cent@dlp ~(keystone)]$
openstack metric measures show 9f949b91-ce61-464f-a8d4-2cc35f0257eb

+---------------------------+-------------+-------+
| timestamp                 | granularity | value |
+---------------------------+-------------+-------+
| 2019-10-29T11:00:00+09:00 |       300.0 | 415.0 |
+---------------------------+-------------+-------+

# details of instance_network_interface

[cent@dlp ~(keystone)]$
openstack metric resource show 5709365d-ea09-55b4-b95b-eda98ea55cf3

+-----------------------+-----------------------------------------------------------------------+
| Field                 | Value                                                                 |
+-----------------------+-----------------------------------------------------------------------+
| created_by_project_id | 2b9c4eda462e40a4a3d03b0a38f12bf1                                      |
| created_by_user_id    | 30440c39a3d0472c94e30fbf13ee91a2                                      |
| creator               | 30440c39a3d0472c94e30fbf13ee91a2:2b9c4eda462e40a4a3d03b0a38f12bf1     |
| ended_at              | None                                                                  |
| id                    | 5709365d-ea09-55b4-b95b-eda98ea55cf3                                  |
| metrics               | network.incoming.bytes: 6a2855ba-251a-4c88-b7d6-1fffc4a18ee2          |
|                       | network.incoming.packets: 381ccf17-7e98-468e-8ff0-dc83cfe703f7        |
|                       | network.outgoing.bytes: 00c63a6a-3ece-40b3-a9dd-48dab3061eeb          |
|                       | network.outgoing.packets: aa951ad3-6051-4dc9-b4e3-cf81f9357b10        |
| original_resource_id  | instance-0000000e-d54dd550-9c14-4cf2-a2d6-ab14f888154a-tap46350670-7e |
| project_id            | 67b2b71cee384d69939e6b3963e0b2db                                      |
| revision_end          | None                                                                  |
| revision_start        | 2019-10-29T02:04:24.229297+00:00                                      |
| started_at            | 2019-10-29T02:04:24.229284+00:00                                      |
| type                  | instance_network_interface                                            |
| user_id               | 14ad73cc98744e01a51886e13d541013                                      |
+-----------------------+-----------------------------------------------------------------------+

# display network incoming bytes

[cent@dlp ~(keystone)]$
openstack metric measures show 6a2855ba-251a-4c88-b7d6-1fffc4a18ee2

+---------------------------+-------------+-------------+
| timestamp                 | granularity |       value |
+---------------------------+-------------+-------------+
| 2019-10-29T11:00:00+09:00 |       300.0 | 115340740.0 |
+---------------------------+-------------+-------------+

# display network outgoing bytes

[cent@dlp ~(keystone)]$
openstack metric measures show 00c63a6a-3ece-40b3-a9dd-48dab3061eeb

+---------------------------+-------------+----------+
| timestamp                 | granularity |    value |
+---------------------------+-------------+----------+
| 2019-10-29T11:00:00+09:00 |       300.0 | 723210.0 |
+---------------------------+-------------+----------+
Matched Content