With the telemetry modules installed and configured, we can now use the Ceilometer command line to interrogate resource usage statistics. We do this by retrieving meters that were set up for our environment and in listing the data.
Ensure that you are logged into a Ubuntu host that has access to our OpenStack environment on the 192.168.100.0/24
public network. This host will be used to run client tools against the OpenStack environment created. If you are using the accompanying Vagrant environment, as described in the Preface, you can use the controller
node. This has the python-ceilometer
package that provides the ceilometer
command-line client.
If you created this node with Vagrant, you can execute the following command:
vagrant ssh controller
Ensure that you have set the following credentials (adjust the path to your certificates and key file to match your environment if not using the Vagrant environment):
export OS_TENANT_NAME=cookbook export OS_USERNAME=admin export OS_PASSWORD=openstack export OS_AUTH_URL=https://192.168.100.200:5000/v2.0/ export OS_NO_CACHE=1 export OS_KEY=/vagrant/cakey.pem export OS_CACERT=/vagrant/ca.pem vagrant ssh controller
We will first list the meters available in our environment:
ceilometer meter-list
The preceding command will display the following information:
ceilometer meter-list --query resource=4be430e2-9b12
We get the following output:
ceilometer sample-list -m disk.write.bytes
This will provide a lot of raw data:
We trimmed the preceding output for readability; usually there will be a lot more data.
disk write
rate:ceilometer statistics --meter disk.write.bytes.rate
The preceding command will provide the following output:
ceilometer statistics -m disk.write.bytes.rate -q 'timestamp>2015-04-14T22:38:15; timestamp<=2015-04-19T04:28:15' --period 60
The preceding command will give us a lot of data for a given range. Here is the truncated output:
ceilometer statistics -m network.outgoing.bytes
The preceding command will give us the following output:
The main difference is that, in addition to all the other columns as before, we now have a Sum
column that has the total sum of all outgoing bytes.
ceilometer statistics -m network.outgoing.bytes -q 'timestamp>2015-04-14T22:38:15; timestamp<=2015-04-19T04:28:15' --period 60
We will get the following output:
We can see the cumulative running total during the specified time interval. For the sake of readability, we removed the Period
, Count
, and Duration
columns and some data in the middle of the time range.
Ceilometer collects data from various OpenStack components. We have viewed meters that were set up for our environment and queried data based on the date range. Ceilometer provides three types of data—cumulative, gauge, and delta. We have looked at gauge data, which provided information about the disk write rate. We also looked at cumulative data for a date interval. To list the Ceilometer meters, use the following command:
ceilometer meter-list
To view sample data for individual meters, we used the -m
or --meter
flags with the following command:
ceilometer sample-list -m disk.write.bytes
Ceilometer also provides statistics for the various data it collects. To view statistics, we issue the following command:
ceilometer statistics --meter disk.write.bytes.rate
The preceding command also accepts queries in the following format:
ceilometer statistics -m disk.write.bytes.rate -q 'timestamp>2015-04-14T22:38:15; timestamp<=2015-04-19T04:28:15' --period 60
Ceilometer collects, stores, and queries what can be middling-to-large amounts of data or big data—depending on the number of hosts and meters configured. While it is beyond the scope of this book to teach you how to handle middling-to-large data problems, it is recommended that, if you deploy Ceilometer in production, you should host its operations where it will not otherwise impact your workloads.