OpenStack Yoga : How to use Ceilometer (Nova Compute)2022/05/07 |
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 httpd | | Neutron Server | | Nova Compute | | Keystone Glance | | OVN-Northd | | Open vSwitch | | Nova API Cinder API | | Cinder Volume | | OVN Metadata Agent | | | | Gnocchi httpd | | OVN-Controller | | | | Ceilometer Central | | Ceilometer Compute | +-----------------------+ +-----------------------+ +-----------------------+ |
[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 | +--------------------------------------+-------------+---------+-------------------------------------+------------+----------+ | 6781b9c7-19c6-4419-a910-d0ae43c7526c | Ubuntu-2204 | SHUTOFF | private=10.0.0.203, 192.168.100.164 | Ubuntu2204 | m1.small | +--------------------------------------+-------------+---------+-------------------------------------+------------+----------+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 +--------------------------------------+----------------------------+---------------------------------- | 6781b9c7-19c6-4419-a910-d0ae43c7526c | instance | 66102fdb888d4556a59dcff8b631ffdf | e540d3c4-7e04-5ef8-8399-5b66d78d1056 | instance_network_interface | 66102fdb888d4556a59dcff8b631ffdf | a302db56-ba64-5f36-9182-f3a9572aab1d | instance_disk | 66102fdb888d4556a59dcff8b631ffdf +--------------------------------------+----------------------------+---------------------------------- +----------------------------------+----------------------------------------------------------------------- | user_id | original_resource_id +----------------------------------+----------------------------------------------------------------------- | 74a373164921492ca35d32fea0fd2d86 | 6781b9c7-19c6-4419-a910-d0ae43c7526c | 74a373164921492ca35d32fea0fd2d86 | instance-00000001-6781b9c7-19c6-4419-a910-d0ae43c7526c-tapa1d93d65-68 | 74a373164921492ca35d32fea0fd2d86 | 6781b9c7-19c6-4419-a910-d0ae43c7526c-vda +----------------------------------+----------------------------------------------------------------------- +----------------------------------+----------+----------------------------------+-------------- | started_at | ended_at | revision_start | revision_end +----------------------------------+----------+----------------------------------+-------------- | 2022-05-05T15:31:25.767200+00:00 | None | 2022-05-05T15:31:25.767212+00:00 | None | 2022-05-05T15:35:38.619516+00:00 | None | 2022-05-05T15:35:38.619523+00:00 | None | 2022-05-05T15:35:38.629433+00:00 | None | 2022-05-05T15:35:38.629441+00:00 | None +----------------------------------+----------+----------------------------------+-------------- +-------------------------------------------------------------------+ | creator | +-------------------------------------------------------------------+ | 66d094f65ddd49ebb6e27f48ed2c6448:c1c4d9a5313f43bd9f6f555e2d34ab28 | | 66d094f65ddd49ebb6e27f48ed2c6448:c1c4d9a5313f43bd9f6f555e2d34ab28 | | 66d094f65ddd49ebb6e27f48ed2c6448:c1c4d9a5313f43bd9f6f555e2d34ab28 | +-------------------------------------------------------------------+ # details of the [instance] resource ubuntu@dlp ~(keystone)$ openstack metric resource show 6781b9c7-19c6-4419-a910-d0ae43c7526c +-----------------------+-------------------------------------------------------------------+ | Field | Value | +-----------------------+-------------------------------------------------------------------+ | created_by_project_id | c1c4d9a5313f43bd9f6f555e2d34ab28 | | created_by_user_id | 66d094f65ddd49ebb6e27f48ed2c6448 | | creator | 66d094f65ddd49ebb6e27f48ed2c6448:c1c4d9a5313f43bd9f6f555e2d34ab28 | | ended_at | None | | id | 6781b9c7-19c6-4419-a910-d0ae43c7526c | | metrics | cpu: cbd8fc75-0599-42b3-a843-f2185d7b9107 | | | disk.ephemeral.size: 7c3b61e8-0a51-491e-8536-83dbcb300974 | | | disk.root.size: d6d48c4f-b6a8-418d-81f1-19d041e2f162 | | | memory.usage: 76b9c892-96fb-4460-9304-15d4eddd6c86 | | | memory: 477d55b6-d03e-41f0-8b88-1cb03e6b131c | | | vcpus: 36195803-7a1c-443c-bef1-a20b5a067949 | | original_resource_id | 6781b9c7-19c6-4419-a910-d0ae43c7526c | | project_id | 66102fdb888d4556a59dcff8b631ffdf | | revision_end | None | | revision_start | 2022-05-05T15:31:25.767212+00:00 | | started_at | 2022-05-05T15:31:25.767200+00:00 | | type | instance | | user_id | 74a373164921492ca35d32fea0fd2d86 | +-----------------------+-------------------------------------------------------------------+ # CPU ubuntu@dlp ~(keystone)$ openstack metric measures show cbd8fc75-0599-42b3-a843-f2185d7b9107 +---------------------------+-------------+---------------+ | timestamp | granularity | value | +---------------------------+-------------+---------------+ | 2022-05-05T15:35:00+00:00 | 300.0 | 82240000000.0 | +---------------------------+-------------+---------------+ # memory usage ubuntu@dlp ~(keystone)$ openstack metric measures show 76b9c892-96fb-4460-9304-15d4eddd6c86 +---------------------------+-------------+--------------+ | timestamp | granularity | value | +---------------------------+-------------+--------------+ | 2022-05-05T15:35:00+00:00 | 300.0 | 339.12109375 | +---------------------------+-------------+--------------+ # details of [instance_network_interface] ubuntu@dlp ~(keystone)$ openstack metric resource show e540d3c4-7e04-5ef8-8399-5b66d78d1056 +-----------------------+-----------------------------------------------------------------------+ | Field | Value | +-----------------------+-----------------------------------------------------------------------+ | created_by_project_id | c1c4d9a5313f43bd9f6f555e2d34ab28 | | created_by_user_id | 66d094f65ddd49ebb6e27f48ed2c6448 | | creator | 66d094f65ddd49ebb6e27f48ed2c6448:c1c4d9a5313f43bd9f6f555e2d34ab28 | | ended_at | None | | id | e540d3c4-7e04-5ef8-8399-5b66d78d1056 | | metrics | network.incoming.bytes: 403c2121-6164-4be1-9c77-fe3994f19900 | | | network.incoming.packets: a2b000aa-bf4c-4eb7-a35d-9b44dda68072 | | | network.outgoing.bytes: aa133fdd-107b-4fc7-ac9e-4c1edc01e2ff | | | network.outgoing.packets: 9d0e5e4e-1b55-453e-b956-0c7b00c526f6 | | original_resource_id | instance-00000001-6781b9c7-19c6-4419-a910-d0ae43c7526c-tapa1d93d65-68 | | project_id | 66102fdb888d4556a59dcff8b631ffdf | | revision_end | None | | revision_start | 2022-05-05T15:35:38.619523+00:00 | | started_at | 2022-05-05T15:35:38.619516+00:00 | | type | instance_network_interface | | user_id | 74a373164921492ca35d32fea0fd2d86 | +-----------------------+-----------------------------------------------------------------------+ # display network incoming bytes ubuntu@dlp ~(keystone)$ openstack metric measures show 403c2121-6164-4be1-9c77-fe3994f19900 +---------------------------+-------------+----------+ | timestamp | granularity | value | +---------------------------+-------------+----------+ | 2022-05-05T15:35:00+00:00 | 300.0 | 351330.0 | +---------------------------+-------------+----------+ # display network outgoing bytes ubuntu@dlp ~(keystone)$ openstack metric measures show aa133fdd-107b-4fc7-ac9e-4c1edc01e2ff +---------------------------+-------------+------------+ | timestamp | granularity | value | +---------------------------+-------------+------------+ | 2022-05-05T15:35:00+00:00 | 300.0 | 23891607.0 | +---------------------------+-------------+------------+ |
Sponsored Link |