OpenStack Antelope : How to use Ceilometer (Nova Compute)2023/03/29 |
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 +-----------+-----------+ +-----------+-----------+ +-----------+-----------+ | [ dlp.srv.world ] | | [ network.srv.world ] | | [ node01.srv.world ] | | (Control Node) | | (Network Node) | | (Compute Node) | | | | | | | | MariaDB RabbitMQ | | Open vSwitch | | Libvirt | | Memcached Nginx | | Neutron Server | | Nova Compute | | Keystone httpd | | OVN-Northd | | Open vSwitch | | Glance Nova API | | Nginx iSCSI Target | | OVN Metadata Agent | | Cinder API | | Cinder Volume | | OVN-Controller | | | | Gnocchi httpd | | Ceilometer Compute | | | | Ceilometer Central | | | +-----------------------+ +-----------------------+ +-----------------------+ |
[1] | Change settings for Nova Compute service to enable Telemetry data collection like follows. |
root@node01:~#
vi /etc/nova/nova.conf # add follows into [DEFAULT] section instance_usage_audit = True instance_usage_audit_period = hour # add to the end [notifications] notify_on_state_change = vm_and_task_state [oslo_messaging_notifications] driver = messagingv2 systemctl restart nova-compute |
[2] | It's some example to display metrics and meters. |
# start an instance ubuntu@dlp ~(keystone)$ openstack server list +--------------------------------------+-------------+---------+-------------------------------------+------------+-----------+ | ID | Name | Status | Networks | Image | Flavor | +--------------------------------------+-------------+---------+-------------------------------------+------------+-----------+ | 11987eec-fb38-4de1-a386-3d1d6001bbd3 | Ubuntu-2204 | SHUTOFF | private=10.0.0.252, 192.168.100.100 | Ubuntu2204 | m1.medium | +--------------------------------------+-------------+---------+-------------------------------------+------------+-----------+ubuntu@dlp ~(keystone)$ openstack server start Ubuntu-2204 # display resources # after doing some operations on instance, metrics data are gotten ubuntu@dlp ~(keystone)$ openstack metric resource list +--------------------------------------+----------------------------+---------------------------------- | id | type | project_id +--------------------------------------+----------------------------+---------------------------------- | 11987eec-fb38-4de1-a386-3d1d6001bbd3 | instance | e294bd7c00314facacdb46c36fb54ee9 | 29b605b9-5568-5534-b3c4-470045cbcbe0 | instance_network_interface | e294bd7c00314facacdb46c36fb54ee9 | 55b09db0-31af-58e5-ab82-da9b1d35c949 | instance_disk | e294bd7c00314facacdb46c36fb54ee9 +--------------------------------------+----------------------------+---------------------------------- +----------------------------------+----------------------------------------------------------------------- | user_id | original_resource_id +----------------------------------+----------------------------------------------------------------------- | 85236576a97e492791abe70c217c8898 | 11987eec-fb38-4de1-a386-3d1d6001bbd3 | 85236576a97e492791abe70c217c8898 | instance-00000001-11987eec-fb38-4de1-a386-3d1d6001bbd3-tap6b961da5-d0 | 85236576a97e492791abe70c217c8898 | 11987eec-fb38-4de1-a386-3d1d6001bbd3-vda +----------------------------------+----------------------------------------------------------------------- +----------------------------------+----------+----------------------------------+-------------- | started_at | ended_at | revision_start | revision_end +----------------------------------+----------+----------------------------------+-------------- | 2023-03-29T02:05:56.850715+00:00 | None | 2023-03-29T02:05:56.850722+00:00 | None | 2023-03-29T02:10:11.914313+00:00 | None | 2023-03-29T02:10:11.914318+00:00 | None | 2023-03-29T02:10:11.998661+00:00 | None | 2023-03-29T02:10:11.998666+00:00 | None +----------------------------------+----------+----------------------------------+-------------- +-------------------------------------------------------------------+ | creator | +-------------------------------------------------------------------+ | f88cfb33fa07437ca440ee5ef5642c95:d3dd87fb1a034f7883539a6a4f83781f | | f88cfb33fa07437ca440ee5ef5642c95:d3dd87fb1a034f7883539a6a4f83781f | | f88cfb33fa07437ca440ee5ef5642c95:d3dd87fb1a034f7883539a6a4f83781f | +-------------------------------------------------------------------+ # details of the [instance] resource ubuntu@dlp ~(keystone)$ openstack metric resource show 11987eec-fb38-4de1-a386-3d1d6001bbd3 +-----------------------+-------------------------------------------------------------------+ | Field | Value | +-----------------------+-------------------------------------------------------------------+ | created_by_project_id | d3dd87fb1a034f7883539a6a4f83781f | | created_by_user_id | f88cfb33fa07437ca440ee5ef5642c95 | | creator | f88cfb33fa07437ca440ee5ef5642c95:d3dd87fb1a034f7883539a6a4f83781f | | ended_at | None | | id | 11987eec-fb38-4de1-a386-3d1d6001bbd3 | | metrics | cpu: 803974fc-fbd0-4775-8f02-4543f38f2ab4 | | | disk.ephemeral.size: 2b734907-8695-4b9a-aa99-f0c47d1d825d | | | disk.root.size: 2b058968-0615-47e3-8dcd-1f8baaf9e5af | | | memory.usage: ef18d67f-993f-4204-925d-cc49d4d2621c | | | memory: 99c08173-8966-4e79-bcba-3db7ed690977 | | | vcpus: 500db462-982f-4947-8df8-8f205fb4a26b | | original_resource_id | 11987eec-fb38-4de1-a386-3d1d6001bbd3 | | project_id | e294bd7c00314facacdb46c36fb54ee9 | | revision_end | None | | revision_start | 2023-03-29T02:05:56.850722+00:00 | | started_at | 2023-03-29T02:05:56.850715+00:00 | | type | instance | | user_id | 85236576a97e492791abe70c217c8898 | +-----------------------+-------------------------------------------------------------------+ # CPU ubuntu@dlp ~(keystone)$ openstack metric measures show 803974fc-fbd0-4775-8f02-4543f38f2ab4 +---------------------------+-------------+----------------+ | timestamp | granularity | value | +---------------------------+-------------+----------------+ | 2023-03-29T11:10:00+09:00 | 300.0 | 121690000000.0 | +---------------------------+-------------+----------------+ # memory usage ubuntu@dlp ~(keystone)$ openstack metric measures show ef18d67f-993f-4204-925d-cc49d4d2621c +---------------------------+-------------+--------------+ | timestamp | granularity | value | +---------------------------+-------------+--------------+ | 2023-03-29T11:10:00+09:00 | 300.0 | 453.44921875 | +---------------------------+-------------+--------------+ # details of [instance_network_interface] ubuntu@dlp ~(keystone)$ openstack metric resource show 29b605b9-5568-5534-b3c4-470045cbcbe0 +-----------------------+-----------------------------------------------------------------------+ | Field | Value | +-----------------------+-----------------------------------------------------------------------+ | created_by_project_id | d3dd87fb1a034f7883539a6a4f83781f | | created_by_user_id | f88cfb33fa07437ca440ee5ef5642c95 | | creator | f88cfb33fa07437ca440ee5ef5642c95:d3dd87fb1a034f7883539a6a4f83781f | | ended_at | None | | id | 29b605b9-5568-5534-b3c4-470045cbcbe0 | | metrics | network.incoming.bytes: bd75940e-66ed-4ab5-9382-a523b15d83b2 | | | network.incoming.packets: fe203610-ba5c-457f-af66-a2aac99c10ef | | | network.outgoing.bytes: f204ab01-10bd-4305-a40e-c6dc692436be | | | network.outgoing.packets: b8f1b2a3-b9c5-4fa0-bb85-2a3984884594 | | original_resource_id | instance-00000001-11987eec-fb38-4de1-a386-3d1d6001bbd3-tap6b961da5-d0 | | project_id | e294bd7c00314facacdb46c36fb54ee9 | | revision_end | None | | revision_start | 2023-03-29T02:10:11.914318+00:00 | | started_at | 2023-03-29T02:10:11.914313+00:00 | | type | instance_network_interface | | user_id | 85236576a97e492791abe70c217c8898 | +-----------------------+-----------------------------------------------------------------------+ # display network incoming bytes ubuntu@dlp ~(keystone)$ openstack metric measures show bd75940e-66ed-4ab5-9382-a523b15d83b2 +---------------------------+-------------+----------+ | timestamp | granularity | value | +---------------------------+-------------+----------+ | 2023-03-29T11:10:00+09:00 | 300.0 | 812237.0 | +---------------------------+-------------+----------+ # display network outgoing bytes ubuntu@dlp ~(keystone)$ openstack metric measures show f204ab01-10bd-4305-a40e-c6dc692436be +---------------------------+-------------+------------+ | timestamp | granularity | value | +---------------------------+-------------+------------+ | 2023-03-29T11:10:00+09:00 | 300.0 | 55614415.0 | +---------------------------+-------------+------------+ |
Sponsored Link |