In this article by Chandan Dutta Chowdhury and Sriram Subramanian, authors of the book OpenStack Networking Cookbook, we will explore various means to monitor the network resource utilization using Ceilometer. We will cover the following topics:
(For more resources related to this topic, see here.)
Due to the dynamic nature of virtual infrastructure and multiple users sharing the same cloud platform, the OpenStack administrator needs to track how the tenants use the resources. The data can also help in capacity planning by giving an estimate of the capacity of the physical devices and the trends of resource usage.
An OpenStack Ceilometer project provides you with telemetry service. It can measure the usage of the resources by collecting statistics across the various OpenStack components. The usage data is collected over the message bus or by polling the various components. The OpenStack Neutron provides Ceilometer with the statistics that are related to the virtual networks.
The following figure shows you how Ceilometer interacts with the Neutron and Nova services:
To implement these recipes, we will use an OpenStack setup as described in the following screenshot:
This setup has two compute nodes and one node for the controller and networking services.
OpenStack Ceilometer collects the resource utilization of virtual machines by running a Ceilometer compute agent on all the compute nodes. These agents collect the various metrics that are related to each virtual machine running on the compute node. The data that is collected is periodically sent to the Ceilometer collector over the message bus.
In this recipe, we will learn how to use the Ceilometer client to check the bandwidth utilization by a virtual machine.
For this recipe, you will need the following information:
The following steps will show you how to determine the bandwidth utilization of a virtual machine:
Ceilometer stores the port bandwidth data for the incoming and outgoing packets and the bytes and their rates.
The OpenStack Ceilometer compute agent collects the statistics related to the network port connected to the virtual machines and posts them on the message bus. These statistics are collected by the Ceilometer collector daemon. The Ceilometer client can be used to query a meter and filter the statistical data based on the resource ID.
The OpenStack Neutron provides you with metering commands in order to enable the Layer 3 (L3) traffic monitoring. The metering commands create a label that can hold a list of the packet matching rules. Neutron counts and associates any L3 packet that matches these rules with the metering label. In this recipe, we will learn how to use the L3 traffic monitoring commands of Neutron to enable packet counting.
For this recipe, we will use a virtual machine that is connected to a network that, in turn, is connected to a router. The following figure describes the topology:
We will use a network called private with CIDR of 10.10.10.0/24.
For this recipe, you will need the following information:
The following steps will show you how to enable the monitoring traffic to or from any L3 network:
The packet counting is now enabled and the bandwidth statistics can be viewed using Ceilometer.
The Neutron monitoring agent implements the packet counting meter in the L3 router. It uses iptables to implement a packet counter. The Neutron agent collects the counter statistics periodically and posts them on the message bus, which is collected by the Ceilometer collector daemon.
In this article, we learned about ways to monitor the usage of virtual and physical networking resources. The resource utilization data can be used to bill the users of a public cloud and debug the infrastructure-related problems.
Further resources on this subject: