OpenStack Ussuri : How to use Ceilometer (Nova Compute)2020/06/11 |
This is how to use OpenStack Telemetry Service (Ceilometer) for Nova Compute service.
This example is based on the environment 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 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 CentOS8 --security-group secgroup01 --nic net-id=$Int_Net_ID --key-name mykey CentOS_8 # list resources # data are gotten after some operations are done on instance [cent@dlp ~(keystone)]$ openstack metric resource list +--------------------------------------+----------------------------+---------------------------------- | id | type | project_id +--------------------------------------+----------------------------+---------------------------------- | cffa1ff3-6d1f-46d8-b98b-d488724972c3 | instance | d9c8c215499949cfb249b28bdaba848a | 38e60146-7914-51f2-97f3-fb2cb5885289 | instance_network_interface | d9c8c215499949cfb249b28bdaba848a | 2e00f938-8e21-54ff-967f-b69d9d74b4ba | instance_disk | d9c8c215499949cfb249b28bdaba848a +--------------------------------------+----------------------------+---------------------------------- +----------------------------------+----------------------------------------------------------------------- | user_id | original_resource_id +----------------------------------+----------------------------------------------------------------------- | 0e4117de456a4bbaa5aac2cc6507be91 | cffa1ff3-6d1f-46d8-b98b-d488724972c3 | 0e4117de456a4bbaa5aac2cc6507be91 | instance-00000001-2929c442-26c4-41cb-b95f-98c3adceb3ef-tap35f17910-ba | 0e4117de456a4bbaa5aac2cc6507be91 | 2929c442-26c4-41cb-b95f-98c3adceb3ef-vda +----------------------------------+----------------------------------------------------------------------- +----------------------------------+----------+----------------------------------+-------------- | started_at | ended_at | revision_start | revision_end +----------------------------------+----------+----------------------------------+-------------- | 2020-06-10T06:50:05.466274+00:00 | None | 2020-06-10T06:51:21.145565+00:00 | None | 2020-06-10T06:56:14.522497+00:00 | None | 2020-06-10T06:56:14.522510+00:00 | None | 2020-06-10T06:56:14.540848+00:00 | None | 2020-06-10T06:56:14.540861+00:00 | None +----------------------------------+----------+----------------------------------+-------------- +-------------------------------------------------------------------+ | creator | +-------------------------------------------------------------------+ | 97a80018ee3e41ceafc0c8caa42c9b82:03fc3b5cc0434f748ec562dd74866396 | | 97a80018ee3e41ceafc0c8caa42c9b82:03fc3b5cc0434f748ec562dd74866396 | | 97a80018ee3e41ceafc0c8caa42c9b82:03fc3b5cc0434f748ec562dd74866396 | +-------------------------------------------------------------------+ # details of the [instance] resource [cent@dlp ~(keystone)]$ openstack metric resource show cffa1ff3-6d1f-46d8-b98b-d488724972c3 +-----------------------+---------------------------------------------------------------------+ | Field | Value | +-----------------------+---------------------------------------------------------------------+ | created_by_project_id | 03fc3b5cc0434f748ec562dd74866396 | | created_by_user_id | 97a80018ee3e41ceafc0c8caa42c9b82 | | creator | 97a80018ee3e41ceafc0c8caa42c9b82:03fc3b5cc0434f748ec562dd74866396 | | ended_at | None | | id | cffa1ff3-6d1f-46d8-b98b-d488724972c3 | | metrics | compute.instance.booting.time: 2dd3e469-4672-4ed7-840e-90307f393435 | | | cpu: 93d89c37-05f4-4c36-a267-d624098655b2 | | | disk.ephemeral.size: 228ed583-77bf-45dd-ac5f-b4990b94c06b | | | disk.root.size: fd8f34cb-ec64-4355-a9a9-8a5de275215d | | | memory.usage: 629af82e-8b60-4132-9ca3-7c635a52d990 | | | memory: dd14e35a-5d27-42b1-a83a-31ec71dae9ba | | | vcpus: 5f894c0d-de1b-4ff3-b84e-422aeb1958cd | | original_resource_id | cffa1ff3-6d1f-46d8-b98b-d488724972c3 | | project_id | d9c8c215499949cfb249b28bdaba848a | | revision_end | None | | revision_start | 2020-06-10T06:51:21.145565+00:00 | | started_at | 2020-06-10T06:50:05.466274+00:00 | | type | instance | | user_id | 0e4117de456a4bbaa5aac2cc6507be91 | +-----------------------+---------------------------------------------------------------------+ # CPU [cent@dlp ~(keystone)]$ openstack metric measures show 93d89c37-05f4-4c36-a267-d624098655b2 +---------------------------+-------------+---------------+ | timestamp | granularity | value | +---------------------------+-------------+---------------+ | 2020-06-10T15:50:00+09:00 | 300.0 | 43240000000.0 | +---------------------------+-------------+---------------+ # memory usage [cent@dlp ~(keystone)]$ openstack metric measures show 629af82e-8b60-4132-9ca3-7c635a52d990 +---------------------------+-------------+--------------+ | timestamp | granularity | value | +---------------------------+-------------+--------------+ | 2020-06-10T15:50:00+09:00 | 300.0 | 283.83203125 | +---------------------------+-------------+--------------+ # details of [instance_network_interface] [cent@dlp ~(keystone)]$ openstack metric resource show 38e60146-7914-51f2-97f3-fb2cb5885289 +-----------------------+-----------------------------------------------------------------------+ | Field | Value | +-----------------------+-----------------------------------------------------------------------+ | created_by_project_id | 03fc3b5cc0434f748ec562dd74866396 | | created_by_user_id | 97a80018ee3e41ceafc0c8caa42c9b82 | | creator | 97a80018ee3e41ceafc0c8caa42c9b82:03fc3b5cc0434f748ec562dd74866396 | | ended_at | None | | id | 38e60146-7914-51f2-97f3-fb2cb5885289 | | metrics | network.incoming.bytes: 763c86c0-9100-4902-b52e-e4bbda71461a | | | network.incoming.packets: 67015608-c8fc-41a9-b36f-9f707e1e413c | | | network.outgoing.bytes: d687ee07-8f9b-4b1d-bb7c-8305e2df7c8a | | | network.outgoing.packets: 43d07716-048f-4f1e-934c-80bd1269031e | | original_resource_id | instance-00000001-2929c442-26c4-41cb-b95f-98c3adceb3ef-tap35f17910-ba | | project_id | d9c8c215499949cfb249b28bdaba848a | | revision_end | None | | revision_start | 2020-06-10T06:56:14.522510+00:00 | | started_at | 2020-06-10T06:56:14.522497+00:00 | | type | instance_network_interface | | user_id | 0e4117de456a4bbaa5aac2cc6507be91 | +-----------------------+-----------------------------------------------------------------------+ # display network incoming bytes [cent@dlp ~(keystone)]$ openstack metric measures show 763c86c0-9100-4902-b52e-e4bbda71461a +---------------------------+-------------+-------------+ | timestamp | granularity | value | +---------------------------+-------------+-------------+ | 2020-06-10T15:55:00+09:00 | 300.0 | 268743393.0 | | 2020-06-10T16:00:00+09:00 | 300.0 | 268818321.0 | | 2020-06-10T16:05:00+09:00 | 300.0 | 268840672.0 | +---------------------------+-------------+-------------+ # display network outgoing bytes [cent@dlp ~(keystone)]$ openstack metric measures show d687ee07-8f9b-4b1d-bb7c-8305e2df7c8a +---------------------------+-------------+-----------+ | timestamp | granularity | value | +---------------------------+-------------+-----------+ | 2020-06-10T15:55:00+09:00 | 300.0 | 1885023.0 | | 2020-06-10T16:00:00+09:00 | 300.0 | 2464671.0 | | 2020-06-10T16:05:00+09:00 | 300.0 | 2473276.0 | +---------------------------+-------------+-----------+ |
Sponsored Link |
|