OpenStack Bobcat : How to use Ceilometer (Nova Compute)2023/10/27 |
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 the [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 openstack-nova-compute |
[2] | It's some example to display metrics and meters. |
# start an instance [cent@dlp ~(keystone)]$ openstack server list +--------------------------------------+------------+---------+------------------------------------+----------------+-----------+ | ID | Name | Status | Networks | Image | Flavor | +--------------------------------------+------------+---------+------------------------------------+----------------+-----------+ | 78b8c394-be14-4312-84e8-06eeebbd74f3 | CentOS-St9 | SHUTOFF | private=10.0.0.208, 192.168.100.63 | CentOS-Stream9 | m1.medium | +--------------------------------------+------------+---------+------------------------------------+----------------+-----------+
[cent@dlp ~(keystone)]$
openstack server start CentOS-St9
# list resources # data are stored after some operations are done on instance [cent@dlp ~(keystone)]$ openstack metric resource list +--------------------------------------+----------------------------+---------------------------------- | id | type | project_id +--------------------------------------+----------------------------+---------------------------------- | 78b8c394-be14-4312-84e8-06eeebbd74f3 | instance | f4598dfd3b8a47149234b6892d18d5a4 | c9aff847-aa53-5449-b384-1fcd612499fd | instance_network_interface | f4598dfd3b8a47149234b6892d18d5a4 | e2b0e7f8-a93f-5ec4-851f-9e98ec9cd596 | instance_disk | f4598dfd3b8a47149234b6892d18d5a4 +--------------------------------------+----------------------------+---------------------------------- +----------------------------------+----------------------------------------------------------------------- | user_id | original_resource_id +----------------------------------+----------------------------------------------------------------------- | d70a5f7908de4cd9aa8e189b725244a9 | 78b8c394-be14-4312-84e8-06eeebbd74f3 | d70a5f7908de4cd9aa8e189b725244a9 | instance-00000001-78b8c394-be14-4312-84e8-06eeebbd74f3-tap73e294fe-61 | d70a5f7908de4cd9aa8e189b725244a9 | 78b8c394-be14-4312-84e8-06eeebbd74f3-vda +----------------------------------+----------------------------------------------------------------------- +----------------------------------+----------+---------------------------------- | started_at | ended_at | revision_start +----------------------------------+----------+---------------------------------- | 2023-10-27T00:46:12.063944+00:00 | None | 2023-10-27T00:46:12.063949+00:00 | 2023-10-27T00:48:58.483399+00:00 | None | 2023-10-27T00:48:58.483407+00:00 | 2023-10-27T00:48:58.516335+00:00 | None | 2023-10-27T00:48:58.516342+00:00 +----------------------------------+----------+---------------------------------- +--------------+-------------------------------------------------------------------+ | revision_end | creator | +--------------+-------------------------------------------------------------------+ | None | be0b90dfc5d24277ae1bfd45e4cac1f8:5d97881520b34e6bbf1f15e778c82fe4 | | None | be0b90dfc5d24277ae1bfd45e4cac1f8:5d97881520b34e6bbf1f15e778c82fe4 | | None | be0b90dfc5d24277ae1bfd45e4cac1f8:5d97881520b34e6bbf1f15e778c82fe4 | +--------------+-------------------------------------------------------------------+ # details of the [instance] resource [cent@dlp ~(keystone)]$ openstack metric resource show 78b8c394-be14-4312-84e8-06eeebbd74f3 +-----------------------+-------------------------------------------------------------------+ | Field | Value | +-----------------------+-------------------------------------------------------------------+ | created_by_project_id | 5d97881520b34e6bbf1f15e778c82fe4 | | created_by_user_id | be0b90dfc5d24277ae1bfd45e4cac1f8 | | creator | be0b90dfc5d24277ae1bfd45e4cac1f8:5d97881520b34e6bbf1f15e778c82fe4 | | ended_at | None | | id | 78b8c394-be14-4312-84e8-06eeebbd74f3 | | metrics | cpu: 7a05ff65-e8c8-4bb3-9ef8-1d7e92ef438f | | | disk.ephemeral.size: c99871a0-3322-4dcc-a14b-9bd29aaf74ec | | | disk.root.size: 2ff21655-808f-4fb7-a3ad-034027ab04a6 | | | memory.usage: beafca0e-9997-4022-b84d-f8e30b8cc46e | | | memory: dc984331-bca1-4762-bac1-c05964724be4 | | | vcpus: bd31a3c6-dca1-4b99-b5a6-4fd95c7006cb | | original_resource_id | 78b8c394-be14-4312-84e8-06eeebbd74f3 | | project_id | f4598dfd3b8a47149234b6892d18d5a4 | | revision_end | None | | revision_start | 2023-10-27T00:46:12.063949+00:00 | | started_at | 2023-10-27T00:46:12.063944+00:00 | | type | instance | | user_id | d70a5f7908de4cd9aa8e189b725244a9 | +-----------------------+-------------------------------------------------------------------+ # CPU [cent@dlp ~(keystone)]$ openstack metric measures show 7a05ff65-e8c8-4bb3-9ef8-1d7e92ef438f +---------------------------+-------------+---------------+ | timestamp | granularity | value | +---------------------------+-------------+---------------+ | 2023-10-27T09:45:00+09:00 | 300.0 | 63050000000.0 | +---------------------------+-------------+---------------+ # memory usage [cent@dlp ~(keystone)]$ openstack metric measures show beafca0e-9997-4022-b84d-f8e30b8cc46e +---------------------------+-------------+-------------+ | timestamp | granularity | value | +---------------------------+-------------+-------------+ | 2023-10-27T09:45:00+09:00 | 300.0 | 449.2890625 | +---------------------------+-------------+-------------+ # details of [instance_network_interface] [cent@dlp ~(keystone)]$ openstack metric resource show c9aff847-aa53-5449-b384-1fcd612499fd +-----------------------+-----------------------------------------------------------------------+ | Field | Value | +-----------------------+-----------------------------------------------------------------------+ | created_by_project_id | 5d97881520b34e6bbf1f15e778c82fe4 | | created_by_user_id | be0b90dfc5d24277ae1bfd45e4cac1f8 | | creator | be0b90dfc5d24277ae1bfd45e4cac1f8:5d97881520b34e6bbf1f15e778c82fe4 | | ended_at | None | | id | c9aff847-aa53-5449-b384-1fcd612499fd | | metrics | network.incoming.bytes: c5d1881a-487f-4edb-894a-be198f1433dc | | | network.incoming.packets: cad56042-e3d5-481e-9977-6dbe672c935b | | | network.outgoing.bytes: 3ef07738-5589-4b32-9b7b-338398a50565 | | | network.outgoing.packets: a5733184-b622-48a0-ae8d-b08728ef0ae8 | | original_resource_id | instance-00000001-78b8c394-be14-4312-84e8-06eeebbd74f3-tap73e294fe-61 | | project_id | f4598dfd3b8a47149234b6892d18d5a4 | | revision_end | None | | revision_start | 2023-10-27T00:48:58.483407+00:00 | | started_at | 2023-10-27T00:48:58.483399+00:00 | | type | instance_network_interface | | user_id | d70a5f7908de4cd9aa8e189b725244a9 | +-----------------------+-----------------------------------------------------------------------+ # display network incoming bytes [cent@dlp ~(keystone)]$ openstack metric measures show c5d1881a-487f-4edb-894a-be198f1433dc +---------------------------+-------------+-----------+ | timestamp | granularity | value | +---------------------------+-------------+-----------+ | 2023-10-27T09:45:00+09:00 | 300.0 | 2486616.0 | +---------------------------+-------------+-----------+ # display network outgoing bytes [cent@dlp ~(keystone)]$ openstack metric measures show 3ef07738-5589-4b32-9b7b-338398a50565 +---------------------------+-------------+----------+ | timestamp | granularity | value | +---------------------------+-------------+----------+ | 2023-10-27T09:45:00+09:00 | 300.0 | 118303.0 | +---------------------------+-------------+----------+ |
Sponsored Link |