The OpenStack Telemetry project, also called Ceilometer, provides you with the ability to collect metering data of the physical and virtual resources comprising deployed OpenStack components and persist this data for subsequent retrieval and analysis. It can also trigger actions when the defined criteria are met.
Ensure you have suitable servers running the OpenStack components. If you are using the accompanying Vagrant environment, as described in the Preface, we will use the same controller
and compute-01
nodes for this recipe.
We will be installing Ceilometer packages on a controller
node and a compute
node. Ensure you are logged into the controller
and compute-01
nodes in our environment. If you created these nodes with Vagrant, you can execute the following command:
vagrant ssh controller vagrant ssh compute-01
To enable the Telemetry (ceilometer
) service, first carry out the following steps on the controller node:
controller
node, execute the following command:sudo apt-get install mongodb python-pymongo python-bson
/etc/mongodb.conf
on the controller
node and set the bind_ip
parameter:bind_ip = 172.16.0.200
sudo service mongodb restart
ceilometer user
by issuing the following command:db.addUser( { user: "ceilometer", pwd: "openstack", roles: [ "readWrite", "dbAdmin" ] } );
ceilometer
service by executing the following commands:keystone user-create --name=ceilometer --pass=ceilometer --email=ceilomoter@localhost keystone user-role-add --user=ceilometer --tenant=service --role=admin
endpoint
for Ceilometer in Keystone by executing the following commands:keystone service-create --name=ceilometer --type=telemetry --description="Ceilometer Metering Service" METERING_SERVICE_ID=$(keystone service-list | awk '/ ceilometer / {print $2}') keystone endpoint-create --region RegionOne --service-id=${METERING_SERVICE_ID} --publicurl=http://192.168.100.200:8777 --internalurl=http://192.168.100.200:8777 --adminurl=http://192.168.100.200:8777
ceilometer
packages using apt
:sudo apt-get update sudo apt-install ceilometer-api ceilometer-collector ceilometer-agent-central python-ceilometerclient
ceilometer
by editing the /etc/ceilometer/ceilometer.conf
file. It should contain the following configuration to work with our environment:[DEFAULT] policy_file = /etc/ceilometer/policy.json verbose = true debug = true insecure = true ##### AMQP ##### notification_topics = notifications,glance_notifications rabbit_host=172.16.0.200 rabbit_port=5672 rabbit_userid=guest rabbit_password=guest rabbit_virtual_host=/ rabbit_ha_queues=false [database] connection=mongodb://ceilometer:[email protected]:27017/ceilometer [api] host = 172.16.0.200 port = 8777 [keystone_authtoken] auth_uri = https://192.168.100.200:35357/v2.0/ identity_uri = https://192.168.100.200:5000 admin_tenant_name = service admin_user = ceilometer admin_password = ceilometer revocation_cache_time = 10 insecure = True [service_credentials] os_auth_url = https://192.168.100.200:5000/v2.0 os_username = ceilometer os_tenant_name = service os_password = ceilometer insecure = True
ceilometer
services:sudo service ceilometer-agent-central restart sudo service ceilometer-agent-notification restart sudo service ceilometer-alarm-evaluator restart sudo service ceilometer-alarm-notifier restart sudo service ceilometer-api restart sudo service ceilometer-collector restart
Now that controller
node is set up, we proceed to install the Ceilometer agent on a compute-01
node.
compute-01
node, install the ceilometer
agent:sudo apt-get install ceilometer-agent-compute
/etc/ceilometer/ceilometer.conf
file and insert the following lines:[DEFAULT] policy_file = /etc/ceilometer/policy.json verbose = true debug = true insecure = true ##### AMQP ##### notification_topics = notifications,glance_notifications rabbit_host=172.16.0.200 rabbit_port=5672 rabbit_userid=guest rabbit_password=guest rabbit_virtual_host=/ rabbit_ha_queues=false [database] connection=mongodb://ceilometer:[email protected]:27017/ceilometer [api] host = 172.16.0.200 port = 8777 [keystone_authtoken] auth_uri = https://192.168.100.200:35357/v2.0/ identity_uri = https://192.168.100.200:5000 admin_tenant_name = service admin_user = ceilometer admin_password = ceilometer revocation_cache_time = 10 insecure = True [service_credentials] os_auth_url = https://192.168.100.200:5000/v2.0 os_username = ceilometer os_tenant_name = service os_password = ceilometer insecure = True
Ceilometer
section to the /etc/nova/nova.conf
configuration file:# Ceilometer instance_usage_audit=True instance_usage_audit_period=hour notify_on_state_change=vm_and_task_state notification_driver=nova.openstack.common.notifier.rpc_notifier
nova
services:sudo service nova-compute restart
sudo service ceilometer-agent-compute restart
Your compute
node is now reporting all its usage statistics to the controller
node.
We installed and configured MongoDB on our controller
node. We set up MongoDB to listen on the internal controller IP, which is similar to the RabbitMQ service. Ceilometer uses Keystone for communication, so we also created a ceilometer user
and services using keystone
commands. After creating the ceilometer user
, we installed and configured ceilometer
packages. The configuration file for Ceilometer is /etc/ceilometer/ceilometer.conf
. Apart from the [api]
, [keystone_authtoken]
, and [service_credentials]
sections, we also specified the database connection section:
[database] connection=mongodb://ceilometer:[email protected]:27017/ceilometer
To properly configure the MongoDB database for production use, refer to the MongoDB documentation at http://docs.mongodb.org/manual/.
We could have used any supported database, such as MongoDB, MySQL, PostgreSQL, HBase, and DB2.
After configuring the controller
node, we set up the compute-01
node by installing the Ceilometer agent. We then updated the /etc/ceilometer.conf
and /etc/nova/nova.conf
files. Now, the Ceilometer service is ready to be used.