My Wiki!

Openstack Telemetry

Telemetry - Controller Node

Packages

  yum install openstack-ceilometer-api openstack-ceilometer-collector \
  openstack-ceilometer-notification openstack-ceilometer-central openstack-ceilometer-alarm \
  python-ceilometerclient
  

The Telemetry service uses a database to store information

Specify the location of the database in the configuration file. The examples use a MongoDB database on the controller node:

  yum install mongodb-server mongodb
  

Configure MongoDB

to make it listen on the controller management IP address. Edit the /etc/mongodb.conf file and modify the bindip key: bindip = 10.10.10.207

  
  service mongod start
  chkconfig mongod on

Create the database and a ceilometer database user

mongo --host controller --eval '
db = db.getSiblingDB("ceilometer");
db.addUser({user: "ceilometerUser",
        pwd: "ceilometerPass",
        roles: [ "readWrite", "dbAdmin" ]})'

Configure the Telemetry service to use the database

   openstack-config --set /etc/ceilometer/ceilometer.conf \
     database connection mongodb://ceilometerUser:ceilometerPass@controller:27017/ceilometer

Define a secret key that is used as a shared secret among Telemetry service nodes

Use openssl to generate a random token and store it in the configuration file:

CEILOMETER_TOKEN=$(openssl rand -hex 10)
echo $CEILOMETER_TOKEN
openstack-config --set /etc/ceilometer/ceilometer.conf publisher metering_secret $CEILOMETER_TOKEN

Configure the Message Queue access

openstack-config --set /etc/ceilometer/ceilometer.conf \
DEFAULT rpc_backend ceilometer.openstack.common.rpc.impl_qpid

openstack-config --set /etc/ceilometer/ceilometer.conf \
DEFAULT rpc_backend ceilometer.openstack.common.rpc.impl_kombu

Create a ceilometer user that the Telemetry service uses to authenticate with the Identity Service

Use the service tenant and give the user the admin role:

keystone user-create --name=ceilometer --pass=ceilometerPass --email=ceilometer@example.com
keystone user-role-add --user=ceilometer --tenant=service --role=admin    
 

Configure the Telemetry service to authenticate with the Identity Service

Set the auth_strategy value to keystone in the /etc/ceilometer/ceilometer.conf file:

openstack-config --set /etc/ceilometer/ceilometer.conf \
DEFAULT auth_strategy keystone   

Add the credentials to the configuration files for the Telemetry service

openstack-config --set /etc/ceilometer/ceilometer.conf \
  keystone_authtoken auth_host controller
openstack-config --set /etc/ceilometer/ceilometer.conf \
  keystone_authtoken admin_user ceilometer
openstack-config --set /etc/ceilometer/ceilometer.conf \
  keystone_authtoken admin_tenant_name service
openstack-config --set /etc/ceilometer/ceilometer.conf \
  keystone_authtoken auth_protocol http
openstack-config --set /etc/ceilometer/ceilometer.conf \
  keystone_authtoken auth_uri http://controller:5000
openstack-config --set /etc/ceilometer/ceilometer.conf \
  keystone_authtoken admin_password ceilometerPass
openstack-config --set /etc/ceilometer/ceilometer.conf \
  service_credentials os_auth_url http://controller:5000/v2.0
openstack-config --set /etc/ceilometer/ceilometer.conf \
  service_credentials os_username ceilometer
openstack-config --set /etc/ceilometer/ceilometer.conf \
  service_credentials os_tenant_name service
openstack-config --set /etc/ceilometer/ceilometer.conf \
  service_credentials os_password ceilometerPass

Register the Telemetry service with the Identity Service

so that other OpenStack services can locate it. Use the keystone command to register the service and specify the endpoint:

keystone service-create --name=ceilometer --type=metering \
--description="Telemetry"
keystone endpoint-create \
--service-id=$(keystone service-list | awk '/ metering / {print $2}') \
--publicurl=http://controller:8777 \
--internalurl=http://controller:8777 \
--adminurl=http://controller:8777

Start the Services

openstack-ceilometer-api, openstack-ceilometer-central, openstack-ceilometer-collector, and services and configure them to start when the system boots:

 service openstack-ceilometer-api start
 service openstack-ceilometer-notification start
 service openstack-ceilometer-central start
 service openstack-ceilometer-collector start
 service openstack-ceilometer-alarm-evaluator start
 service openstack-ceilometer-alarm-notifier start
 chkconfig openstack-ceilometer-api on
 chkconfig openstack-ceilometer-notification on
 chkconfig openstack-ceilometer-central on
 chkconfig openstack-ceilometer-collector on
 chkconfig openstack-ceilometer-alarm-evaluator on
 chkconfig openstack-ceilometer-alarm-notifier on

Telemetry - Compute Agent / Compute Node

Telemetry provides an API service that provides a collector and a range of disparate agents. This procedure details how to install the agent that runs on the compute node.

Install the Telemetry service on the compute node:

yum install openstack-ceilometer-compute python-ceilometerclient python-pecan

Set the following options in the /etc/nova/nova.conf file:

openstack-config --set /etc/nova/nova.conf DEFAULT \
  instance_usage_audit True
openstack-config --set /etc/nova/nova.conf DEFAULT \
  instance_usage_audit_period hour
openstack-config --set /etc/nova/nova.conf DEFAULT \
  notify_on_state_change vm_and_task_state

[Note] The notification_driver option is a multi valued option, which openstack-config cannot set properly. See the section called “OpenStack packages”.

Edit the /etc/nova/nova.conf file and add the following lines to the [DEFAULT] section:

  	
  [DEFAULT]
  ...
  notification_driver = nova.openstack.common.notifier.rpc_notifier
  notification_driver = ceilometer.compute.nova_notifier
  rpc_backend = qpid

Restart the Compute service:

service openstack-nova-compute restart

You must set the secret key that you defined previously

The Telemetry service nodes share this key as a shared secret:

openstack-config --set /etc/ceilometer/ceilometer.conf publisher \
  metering_secret CEILOMETER_TOKEN

Configure the Message queue access:

openstack-config --set /etc/ceilometer/ceilometer.conf DEFAULT rpc_backend ceilometer.openstack.common.rpc.impl_kombu
openstack-config --set /etc/ceilometer/ceilometer.conf DEFAULT rabbit_host controller

Add the Identity service credentials:

openstack-config --set /etc/ceilometer/ceilometer.conf \
  keystone_authtoken auth_host controller
openstack-config --set /etc/ceilometer/ceilometer.conf \
  keystone_authtoken admin_user ceilometer
openstack-config --set /etc/ceilometer/ceilometer.conf \
  keystone_authtoken admin_tenant_name service
openstack-config --set /etc/ceilometer/ceilometer.conf \
  keystone_authtoken auth_protocol http
openstack-config --set /etc/ceilometer/ceilometer.conf \
  keystone_authtoken admin_password ceilometerPass
openstack-config --set /etc/ceilometer/ceilometer.conf \
  service_credentials os_username ceilometer
openstack-config --set /etc/ceilometer/ceilometer.conf \
  service_credentials os_tenant_name service
openstack-config --set /etc/ceilometer/ceilometer.conf \
  service_credentials os_password ceilometerPass
openstack-config --set /etc/ceilometer/ceilometer.conf \
  service_credentials os_auth_url http://controller:5000/v2.0

Start the service

and configure it to start when the system boots:

service openstack-ceilometer-compute start
chkconfig openstack-ceilometer-compute on

Telemetry - Image Service / Controll node

Image Service for Telemetry

To retrieve image samples, you must configure the Image Service to send notifications to the bus.

Run the following commands:

openstack-config --set /etc/glance/glance-api.conf DEFAULT notification_driver messaging
openstack-config --set /etc/glance/glance-api.conf DEFAULT rpc_backend <del>qpid</del> kombu

Restart the Image Services with their new settings:

service openstack-glance-api restart
service openstack-glance-registry restart

Block Storage

Object Storage

Verify the Telemetry installation

To test the Telemetry installation, download an image from the Image Service, and use the ceilometer command to display usage statistics.

Use the ceilometer meter-list command to test the access to Telemetry:

ceilometer meter-list
    +------------+-------+-------+--------------------------------------+---------+----------------------------------+
    | Name       | Type  | Unit  | Resource ID                          | User ID | Project ID                       |
    +------------+-------+-------+--------------------------------------+---------+----------------------------------+
    | image      | gauge | image | acafc7c0-40aa-4026-9673-b879898e1fc2 | None    | efa984b0a914450e9a47788ad330699d |
    | image.size | gauge | B     | acafc7c0-40aa-4026-9673-b879898e1fc2 | None    | efa984b0a914450e9a47788ad330699d |
    +------------+-------+-------+--------------------------------------+---------+----------------------------------+

Download an image from the Image Service:

glance image-download "cirros-0.3.2-x86_64" > cirros.img

Call the ceilometer meter-list command again to validate that the download has been detected and stored by the Telemetry:

ceilometer meter-list
    +----------------+-------+-------+--------------------------------------+---------+----------------------------------+
    | Name           | Type  | Unit  | Resource ID                          | User ID | Project ID                       |
    +----------------+-------+-------+--------------------------------------+---------+----------------------------------+
    | image          | gauge | image | acafc7c0-40aa-4026-9673-b879898e1fc2 | None    | efa984b0a914450e9a47788ad330699d |
    | image.download | delta | B     | acafc7c0-40aa-4026-9673-b879898e1fc2 | None    | efa984b0a914450e9a47788ad330699d |
    | image.serve    | delta | B     | acafc7c0-40aa-4026-9673-b879898e1fc2 | None    | efa984b0a914450e9a47788ad330699d |
    | image.size     | gauge | B     | acafc7c0-40aa-4026-9673-b879898e1fc2 | None    | efa984b0a914450e9a47788ad330699d |
    +----------------+-------+-------+--------------------------------------+---------+----------------------------------+

You can now get usage statistics for the various meters:

ceilometer statistics -m image.download -p 60
    +--------+---------------------+---------------------+-------+------------+------------+------------+------------+----------+----------------------------+----------------------------+
    | Period | Period Start        | Period End          | Count | Min        | Max        | Sum        | Avg        | Duration | Duration Start             | Duration End               |
    +--------+---------------------+---------------------+-------+------------+------------+------------+------------+----------+----------------------------+----------------------------+
    | 60     | 2013-11-18T18:08:50 | 2013-11-18T18:09:50 | 1     | 13167616.0 | 13167616.0 | 13167616.0 | 13167616.0 | 0.0      | 2013-11-18T18:09:05.334000 | 2013-11-18T18:09:05.334000 |
    +--------+---------------------+---------------------+-------+------------+------------+------------+------------+----------+----------------------------+----------------------------+
    

Navigation