7. Telemetry Service - marcosaletta/Juno-CentOS7-Guide GitHub Wiki
Install the Telemetry service on a dedicated node
NOTE For the sake of this guide we will install Ceilometer
, the telemetry service of Openstack, on the Network node.
-
The Telemetry service uses a database to store information. Install
mongodb
database and create a MongoDB database, service credentials, and API endpoints.# sudo yum install mongodb-server
-
Edit the /etc/mongodb.conf file and complete the following actions:
a. Configure the bind_ip key to use the management interface IP address of the node.
bind_ip = $NODE_MANAG_IP
b. By default, MongoDB creates several 1 GB journal files in the /var/lib/mongodb/journal directory. If you want to reduce the size of each journal file to 128 MB and limit total journal space consumption to 512 MB, assert the smallfiles key:
smallfiles = true
c. You can also disable journaling. For more information, see the MongoDB manual.
-
Start the MongoDB services and configure them to start when the system boots:
# systemctl enable mongod.service # systemctl start mongod.service
-
Create the ceilometer database:
# mongo --host controller --eval ' db = db.getSiblingDB("ceilometer"); db.addUser({user: "ceilometer", pwd: "$CEILOMETER_DBPASS", roles: [ "readWrite", "dbAdmin" ]})' MongoDB shell version: X.Y.Z connecting to: controller:27017/test { "user" : "ceilometer", "pwd" : "72f25aeee7ad4be52437d7cd3fc60f6f", "roles" : [ "readWrite", "dbAdmin" ], "_id" : ObjectId("5489c22270d7fad1ba631dc3") }
Replace $CEILOMETER_DBPASS with a suitable password.
Create Ceilometer service on the controller
NOTE Execute the following operations on the controller node.
To create the service credentials, complete these steps:
a. Create the ceilometer user:
$ keystone user-create --name ceilometer --pass $CEILOMETER_PASS
Replace $CEILOMETER_PASS with a suitable password.
b. Add the admin role to the ceilometer user.
$ keystone user-role-add --user ceilometer --tenant service --role admin
c. Create the ceilometer service entity:
$ keystone service-create --name ceilometer --type metering --description "Telemetry"
d. Create the Telemetry module API endpoints:
$ keystone endpoint-create --service-id $(keystone service-list | awk '/ metering / {print $2}') --publicurl http://controller:8777 --internalurl http://controller:8777 --adminurl http://controller:8777 --region regionOne
Install and configure the Telemetry module components on the Network node
NOTE Execute the following actions on the Network node
- Install ceilometer packages:
yum install openstack-ceilometer-api openstack-ceilometer-collector openstack-ceilometer-notification openstack-ceilometer-central openstack-ceilometer-alarm python-ceilometerclient
- Generate a random value to use as the metering secret:
# openssl rand -hex 10
-
Edit the
/etc/ceilometer/ceilometer.conf
:a. In the [database] section, configure database access:
[database] ... connection = mongodb://ceilometer:$CEILOMETER_DBPASS@$MONGO_IP:27017/ceilometer
Replace $CEILOMETER_DBPASS with the password you chose for the Telemetry module database and $MONGO_IP with the IP or the hostname of the network node.
b. In the [DEFAULT] section, configure RabbitMQ message broker access:
[DEFAULT] ... rpc_backend = rabbit rabbit_host = controller rabbit_password = $RABBIT_PASS
Replace $RABBIT_PASS with the password you chose for the guest account in RabbitMQ.
c. In the [DEFAULT] and [keystone_authtoken] sections, configure Identity service access:
[DEFAULT] ... auth_strategy = keystone [keystone_authtoken] ... auth_uri = http://controller:5000/v2.0 identity_uri = http://controller:35357 admin_tenant_name = service admin_user = ceilometer admin_password = $CEILOMETER_PASS
Replace $CEILOMETER_PASS with the password you chose for the celiometer user in the Identity service.
d. In the [service_credentials] section, configure service credentials:
[service_credentials] ... os_auth_url = http://controller:5000/v2.0 os_username = ceilometer os_tenant_name = service os_password = $CEILOMETER_PASS
Replace $CEILOMETER_PASS with the password you chose for the ceilometer user in the Identity service.
e. In the [publisher] section, configure the metering secret:
[publisher] ... metering_secret = $METERING_SECRET
Replace $METERING_SECRET with the random value that you generated in a previous step.
f. To assist with troubleshooting, enable verbose logging in the [DEFAULT] section:
[DEFAULT] ... verbose = True
Finalize Installation
Start the Telemetry services and configure them to start when the system boots:
# systemctl enable openstack-ceilometer-api.service openstack-ceilometer-notification.service openstack-ceilometer-central.service openstack-ceilometer-collector.service openstack-ceilometer-alarm-evaluator.service openstack-ceilometer-alarm-notifier.service
# systemctl start openstack-ceilometer-api.service openstack-ceilometer-notification.service openstack-ceilometer-central.service openstack-ceilometer-collector.service openstack-ceilometer-alarm-evaluator.service openstack-ceilometer-alarm-notifier.service
##Configure the Compute Node
To install and configure the agent
Telemetry uses a combination of notifications and an agent to collect Compute metrics. NOTE Perform these steps on each compute node.
- Install the packages
yum install openstack-ceilometer-compute python-ceilometerclient python-pecan
-
Edit the
/etc/ceilometer/ceilometer.conf
file and complete the following actions:a. In the
[publisher]
section, configure the metering secret:[publisher] ... metering_secret = $METERING_SECRET
Replace $METERING_SECRET with the metering secret you chose for the Telemetry module.
b. In the
[DEFAULT]
section, configure RabbitMQ message broker access:[DEFAULT] ... rpc_backend = rabbit rabbit_host = controller rabbit_password = RABBIT_PASS
Replace $RABBIT_PASS with the password you chose for the guest account in RabbitMQ.
c. In the
[keystone_authtoken]
section, configure Identity service access:[keystone_authtoken] ... auth_uri = http://controller:5000/v2.0 identity_uri = http://controller:35357 admin_tenant_name = service admin_user = ceilometer admin_password = $CEILOMETER_PASS
Replace $CEILOMETER_PASS with the password you chose for the Telemetry module database.
d. In the [service_credentials] section, configure service credentials:
[service_credentials] ... os_auth_url = http://controller:5000/v2.0 os_username = ceilometer os_tenant_name = service os_password = $CEILOMETER_PASS os_endpoint_type = internalURL os_region_name = regionOne
Replace $CEILOMETER_PASS with the password you chose for the ceilometer user in the Identity service.
e. To assist with troubleshooting, enable verbose logging in the [DEFAULT] section:
[DEFAULT] ... verbose = True
To configure notifications
Configure the Compute service to send notifications to the message bus. Edit the /etc/nova/nova.conf file and configure notifications in the [DEFAULT] section:
[DEFAULT]
...
instance_usage_audit = True
instance_usage_audit_period = hour
notify_on_state_change = vm_and_task_state
notification_driver = messagingv2
To finalize installation
-
Start the Telemetry agent and configure it to start when the system boots:
# systemctl enable openstack-ceilometer-compute.service # systemctl start openstack-ceilometer-compute.service
-
Restart the Compute service:
# systemctl restart openstack-nova-compute.service
Configure the Image Service
To retrieve image-oriented events and samples, configure the Image Service to send notifications to the message bus. Perform these steps on the controller node.
Edit the /etc/glance/glance-api.conf
and /etc/glance/glance-registry.conf
files and complete the following actions:
-
In the
[DEFAULT]
section, configure notifications and RabbitMQ message broker access:[DEFAULT] ... notification_driver = messagingv2 rpc_backend = rabbit rabbit_host = controller rabbit_password = $RABBIT_PASS
Replace $RABBIT_PASS with the password you chose for the guest account in RabbitMQ.
-
Restart the Image Service:
# systemctl restart openstack-glance-api.service openstack-glance-registry.service
Configure the Block Storage service
To retrieve volume-oriented events and samples, you must configure the Block Storage service to send notifications to the message bus. Perform these steps on the controller and storage nodes.
To configure prerequisites
Edit the /etc/cinder/cinder.conf
file and complete the following actions:
-
In the [DEFAULT] section, configure notifications:
[DEFAULT] ... control_exchange = cinder notification_driver = messagingv2
-
Restart the Block Storage services on the controller node:
systemctl restart openstack-cinder-api.service openstack-cinder-scheduler.service
-
Restart the Block Storage services on the storage nodes:
# systemctl restart openstack-cinder-volume.service
##Configure the Object Storage service
To retrieve storage-oriented events and samples, configure the Object Storage service to send notifications to the message bus.
To configure prerequisites
The Telemetry service requires access to the Object Storage service using the ResellerAdmin role.
NOTE Perform these steps on the controller node.
-
Create the ResellerAdmin role:
$ keystone role-create --name ResellerAdmin +----------+----------------------------------+ | Property | Value | +----------+----------------------------------+ | id | 462fa46c13fd4798a95a3bfbe27b5e54 | | name | ResellerAdmin | +----------+----------------------------------+
-
Add the ResellerAdmin role to the service tenant and ceilometer user:
$ keystone user-role-add --tenant service --user ceilometer --role $ROLE_ID
Where
$ROLE_ID
is the id of the role we have just created. If you take the id from the output of the command above or by doing$keystone role-list
To configure notifications
Perform these steps on the controller and any other nodes that run the Object Storage proxy service.
-
Edit the
/etc/swift/proxy-server.conf
file and complete the following actions:a. In the
[filter:keystoneauth]
section, add the ResellerAdmin role:[filter:keystoneauth] ... operator_roles = admin,_member_,ResellerAdmin
b. In the [pipeline:main] section, add ceilometer:
[pipeline:main] ... pipeline = authtoken cache healthcheck keystoneauth proxy-logging ceilometer proxy-server
c. In the [filter:ceilometer] section, configure notifications:
[filter:ceilometer] use = egg:ceilometer#swift log_level = WARN
-
Add the swift system user to the ceilometer system group to permit access to the Telemetry configuration files by the Object Storage service:
# usermod -a -G ceilometer swift
- Restart the Object Storage proxy service:
# systemctl restart openstack-swift-proxy.service
##Verify the Telemetry installation
This section describes how to verify operation of the Telemetry module
NOTE Perform this operation on the controller node.
-
List available meters:
$ 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.3-x86_64" > cirros.img
-
List available meters again to validate detection of the image download:
$ 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 | +----------------+-------+-------+--------------------------------------+---------+----------------------------------+
-
Retrieve usage statistics from the image.download meter:
$ 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 | +--------+---------------------+---------------------+-------+------------+------------+------------+------------+----------+----------------------------+----------------------------+
NOTE The meter list can change if you have already create a VM or other things.