OpenStack Victoria : How to use Ceilometer (Nova Compute)2020/10/22 |
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 ] | | [ Network Node ] | | [ Compute Node ] | | | | | | | | MariaDB RabbitMQ | | Linux Bridge | | Libvirt | | Memcached httpd | | L2 Agent | | Nova Compute | | Keystone Glance | | L3 Agent | | Linux Bridge | | Nova_API Cinder_API | | Metadata Agent | | L2 Agent | | Neutron Server | | Cinder Volume | | Ceilometer Compute | | Metadata Agent | | Heat API | | | | | | Heat Engine | | | | | | Gnocchi httpd | | | | | | 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 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 | +--------------------------------------+-------------+--------+-------------------------------------+------------+----------+ | 10abf4e3-d5d9-4b57-a5a0-7cb767442dcc | Ubuntu_2004 | ACTIVE | private=192.168.100.188, 10.0.0.236 | Ubuntu2004 | m1.small | +--------------------------------------+-------------+--------+-------------------------------------+------------+----------+ubuntu@dlp ~(keystone)$ openstack server start Ubuntu_2004 # display resources # after doing some operations on instance, metrics data are gotten ubuntu@dlp ~(keystone)$ openstack metric resource list +--------------------------------------+----------------------------+---------------------------------- | id | type | project_id +--------------------------------------+----------------------------+---------------------------------- | 10abf4e3-d5d9-4b57-a5a0-7cb767442dcc | instance | 6c44eafd4f614985bf74b94f2aee82fb | c96d50ae-df9a-58f4-acb8-d3fbfad117dd | instance_disk | 6c44eafd4f614985bf74b94f2aee82fb | 103be51a-14ae-5fc4-8f0b-9b7458fc1bc1 | instance_network_interface | 6c44eafd4f614985bf74b94f2aee82fb +--------------------------------------+----------------------------+---------------------------------- +----------------------------------+----------------------------------------------------------------------- | user_id | original_resource_id +----------------------------------+----------------------------------------------------------------------- | a13cfae0e5eb466fae71a636a6ffb6b4 | 10abf4e3-d5d9-4b57-a5a0-7cb767442dcc | a13cfae0e5eb466fae71a636a6ffb6b4 | 10abf4e3-d5d9-4b57-a5a0-7cb767442dcc-vda | a13cfae0e5eb466fae71a636a6ffb6b4 | instance-00000003-10abf4e3-d5d9-4b57-a5a0-7cb767442dcc-tap173295b3-05 +----------------------------------+----------------------------------------------------------------------- +----------------------------------+----------+----------------------------------+-------------- | started_at | ended_at | revision_start | revision_end +----------------------------------+----------+----------------------------------+-------------- | 2020-10-22T01:10:05.332260+00:00 | None | 2020-10-22T01:10:05.332269+00:00 | None | 2020-10-22T01:12:38.530979+00:00 | None | 2020-10-22T01:12:38.532729+00:00 | None | 2020-10-22T01:12:38.569294+00:00 | None | 2020-10-22T01:12:38.569302+00:00 | None +----------------------------------+----------+----------------------------------+-------------- +-------------------------------------------------------------------+ | creator | +-------------------------------------------------------------------+ | a954b69f9b8345d9a797abbc0a949108:37197271a1954ddb90207a95d5f46488 | | a954b69f9b8345d9a797abbc0a949108:37197271a1954ddb90207a95d5f46488 | | a954b69f9b8345d9a797abbc0a949108:37197271a1954ddb90207a95d5f46488 | +-------------------------------------------------------------------+ # details of the [instance] resource ubuntu@dlp ~(keystone)$ openstack metric resource show 10abf4e3-d5d9-4b57-a5a0-7cb767442dcc +-----------------------+-------------------------------------------------------------------+ | Field | Value | +-----------------------+-------------------------------------------------------------------+ | created_by_project_id | 37197271a1954ddb90207a95d5f46488 | | created_by_user_id | a954b69f9b8345d9a797abbc0a949108 | | creator | a954b69f9b8345d9a797abbc0a949108:37197271a1954ddb90207a95d5f46488 | | ended_at | None | | id | 10abf4e3-d5d9-4b57-a5a0-7cb767442dcc | | metrics | cpu: a7e8d1bb-07c3-4ed1-ad4d-43012a248605 | | | disk.ephemeral.size: 498c16f8-5dc9-4fae-9097-75c077a2011b | | | disk.root.size: 1ecb2a39-bf65-4321-9bba-80dd2493f921 | | | memory.usage: 71d7fcd9-3eff-43b6-8e21-7eaf37670bab | | | memory: ee56add3-4faf-4234-a47c-111acca60cb5 | | | vcpus: f0f6a555-f274-4de2-af18-ffb58fc98b9b | | original_resource_id | 10abf4e3-d5d9-4b57-a5a0-7cb767442dcc | | project_id | 6c44eafd4f614985bf74b94f2aee82fb | | revision_end | None | | revision_start | 2020-10-22T01:10:05.332269+00:00 | | started_at | 2020-10-22T01:10:05.332260+00:00 | | type | instance | | user_id | a13cfae0e5eb466fae71a636a6ffb6b4 | +-----------------------+-------------------------------------------------------------------+ # CPU ubuntu@dlp ~(keystone)$ openstack metric measures show a7e8d1bb-07c3-4ed1-ad4d-43012a248605 +---------------------------+-------------+---------------+ | timestamp | granularity | value | +---------------------------+-------------+---------------+ | 2020-10-22T10:10:00+09:00 | 300.0 | 32230000000.0 | | 2020-10-22T10:15:00+09:00 | 300.0 | 56860000000.0 | +---------------------------+-------------+---------------+ # memory usage ubuntu@dlp ~(keystone)$ openstack metric measures show 71d7fcd9-3eff-43b6-8e21-7eaf37670bab +---------------------------+-------------+-------------+ | timestamp | granularity | value | +---------------------------+-------------+-------------+ | 2020-10-22T10:10:00+09:00 | 300.0 | 230.6640625 | | 2020-10-22T10:15:00+09:00 | 300.0 | 218.4453125 | | 2020-10-22T10:20:00+09:00 | 300.0 | 218.421875 | | 2020-10-22T10:25:00+09:00 | 300.0 | 218.3671875 | +---------------------------+-------------+-------------+ # details of [instance_network_interface] ubuntu@dlp ~(keystone)$ openstack metric resource show 103be51a-14ae-5fc4-8f0b-9b7458fc1bc1 +-----------------------+-----------------------------------------------------------------------+ | Field | Value | +-----------------------+-----------------------------------------------------------------------+ | created_by_project_id | 37197271a1954ddb90207a95d5f46488 | | created_by_user_id | a954b69f9b8345d9a797abbc0a949108 | | creator | a954b69f9b8345d9a797abbc0a949108:37197271a1954ddb90207a95d5f46488 | | ended_at | None | | id | 103be51a-14ae-5fc4-8f0b-9b7458fc1bc1 | | metrics | network.incoming.bytes: 063d8cde-6512-43eb-a983-cb2f0bec1696 | | | network.incoming.packets: 2c0b2371-bcec-4575-8afe-5287f792c848 | | | network.outgoing.bytes: 3e8414eb-9e8a-41b1-9145-beecec9a93f4 | | | network.outgoing.packets: cf21de37-fc47-4e8f-8f40-4c30dbea1f4b | | original_resource_id | instance-00000003-10abf4e3-d5d9-4b57-a5a0-7cb767442dcc-tap173295b3-05 | | project_id | 6c44eafd4f614985bf74b94f2aee82fb | | revision_end | None | | revision_start | 2020-10-22T01:12:38.569302+00:00 | | started_at | 2020-10-22T01:12:38.569294+00:00 | | type | instance_network_interface | | user_id | a13cfae0e5eb466fae71a636a6ffb6b4 | +-----------------------+-----------------------------------------------------------------------+ # display network incoming bytes ubuntu@dlp ~(keystone)$ openstack metric measures show 063d8cde-6512-43eb-a983-cb2f0bec1696 +---------------------------+-------------+------------+ | timestamp | granularity | value | +---------------------------+-------------+------------+ | 2020-10-22T10:10:00+09:00 | 300.0 | 26386610.0 | | 2020-10-22T10:15:00+09:00 | 300.0 | 26407574.0 | | 2020-10-22T10:20:00+09:00 | 300.0 | 26407818.0 | | 2020-10-22T10:25:00+09:00 | 300.0 | 26408062.0 | +---------------------------+-------------+------------+ # display network outgoing bytes ubuntu@dlp ~(keystone)$ openstack metric measures show 3e8414eb-9e8a-41b1-9145-beecec9a93f4 +---------------------------+-------------+----------+ | timestamp | granularity | value | +---------------------------+-------------+----------+ | 2020-10-22T10:10:00+09:00 | 300.0 | 301489.0 | | 2020-10-22T10:15:00+09:00 | 300.0 | 326523.0 | | 2020-10-22T10:20:00+09:00 | 300.0 | 326767.0 | | 2020-10-22T10:25:00+09:00 | 300.0 | 327011.0 | +---------------------------+-------------+----------+ |
Sponsored Link |
|