Installing, Configuring, and Verifying Ceilometer
Ceilometer provides the ability to normalize and transform data across OpenStack core components. Its data can be used to provide customer billing and resource tracking.
Configuring Environment
Perform the following operations on controller nodes.
- Log in to the OpenStack CLI as the admin user.
1source /etc/keystone/admin-openrc
- Create the service credentials.
- Create the ceilometer user and set a password for the user.
1openstack user create --domain default --password-prompt ceilometer
- Add the admin role to the ceilometer user.
1openstack role add --project service --user ceilometer admin
- Create the ceilometer user and set a password for the user.
- Register the Gnocchi service in Keystone.
- Create the gnocchi user and set a password.
1openstack user create --domain default --password-prompt gnocchi
- Create the gnocchi service entity.
1openstack service create --name gnocchi --description "Metric Service" metric
- Add the admin role to the gnocchi user.
1openstack role add --project service --user gnocchi admin
- Create the gnocchi user and set a password.
- Create the Metric service API endpoints.
1 2 3
openstack endpoint create --region RegionOne metric public http://controller:8041 openstack endpoint create --region RegionOne metric internal http://controller:8041 openstack endpoint create --region RegionOne metric admin http://controller:8041

Installing and Configuring Gnocchi
Perform the following operations on controller nodes.
- Install the Gnocchi package.
1yum -y install openstack-gnocchi-api openstack-gnocchi-metricd python-gnocchiclient
- Create a database for the Gnocchi service.
In this document, all passwords are represented as <PASSWORD>. Use the correct password during the operation.
1 2 3 4 5
mysql -u root -p CREATE DATABASE gnocchi; GRANT ALL PRIVILEGES ON gnocchi.* TO 'gnocchi'@'localhost' IDENTIFIED BY '<PASSWORD>'; GRANT ALL PRIVILEGES ON gnocchi.* TO 'gnocchi'@'%' IDENTIFIED BY '<PASSWORD>'; exit

- Edit the /etc/gnocchi/gnocchi.conf file.
1vim /etc/gnocchi/gnocchi.confModify the following:- Configure the Gnocchi function parameters, log address, and Redis URL port.
1 2 3 4 5 6
[DEFAULT] debug = true verbose = true log_dir = /var/log/gnocchi parallel_operations = 4 coordination_url = redis://controller:6379
- Configure the Gnocchi working port. host is the management IP address of the controller node.
1 2 3 4 5 6
[api] auth_mode = keystone host = 172.168.201.11 port = 8041 uwsgi_mode = http-socket max_limit = 1000
- Configure the default storage mode of metadata.
1 2
[archive_policy] default_aggregation_methods = mean,min,max,sum,std,count
- Configure the allowed access sources.
1 2
[cors] allowed_origin = http://controller:3000
- Configure database retrieval.
1 2
[indexer] url = mysql+pymysql://gnocchi:<PASSWORD>@controller/gnocchi
- Configure Ceilometer test indicators.
1 2 3 4 5 6
[metricd] workers = 4 metric_processing_delay = 60 greedy = true metric_reporting_delay = 120 metric_cleanup_delay = 300
- Configure the mode and location for storing Gnocchi data. In this example, it is stored to the local file system.
1 2 3 4
[storage] coordination_url = redis://controller:6379 file_basepath = /var/lib/gnocchi driver = file
- Configure Keystone authentication information. You need to add the [keystone_authtoken] section.
1 2 3 4 5 6 7 8 9 10 11 12
[keystone_authtoken] region_name = RegionOne www_authenticate_uri = http://controller:5000 auth_url = http://controller:5000/v3 memcached_servers = controller:11211 auth_type = password project_domain_name = default user_domain_name = default project_name = service username = gnocchi password = <PASSWORD> service_token_roles_required = true
- Configure the Gnocchi function parameters, log address, and Redis URL port.
Installing and Configuring Redis
Perform the following operations on controller nodes.
- Install Remote Dictionary Server (Redis) server.
1yum -y install redis

- Edit the /etc/redis.conf file and make the following changes:
1vim etc/redis.conf- Enable Redis to start in the background.
1daemonize yes - Disable the protection mode for Redis.
1protected-mode no - Bind Redis to the controller node host.
1bind 172.168.201.11
- Enable Redis to start in the background.
- Start the Redis server service using the redis.conf file configured.
1redis-server /etc/redis.conf
The Redis service does not automatically start upon system boot. You can add the preceding command to the startup options. Otherwise, you need to manually start the Redis service each time the system is booted. The method is as follows:
- Edit the /etc/rc.d/rc.local file.
1vim /etc/rc.d/rc.localAdd the following content to the file:1redis-server /etc/redis.conf - Save and close the file, and grant the execute permission on the /etc/rc.d/rc.local file.
1chmod +x /etc/rc.d/rc.local
- Edit the /etc/rc.d/rc.local file.
Installing the uWSGI Plugin
Perform the following operation on controller nodes.
Run the following command to install the uWSGI plugin:
1
|
yum -y install uwsgi-plugin-common uwsgi-plugin-python uwsgi |
Completing Gnocchi Installation
Perform the following operations on controller nodes.
- Initialize Gnocchi.
1gnocchi-upgrade
- Grant the read and write permissions on the /var/lib/gnocchi file.
1chmod -R 777 /var/lib/gnocchi
- Complete the installation of Gnocchi.
- Enable the Gnocchi service and configure it to start as the system boots.
1 2
systemctl enable openstack-gnocchi-api.service openstack-gnocchi-metricd.service systemctl start openstack-gnocchi-api.service openstack-gnocchi-metricd.service
- Check the Gnocchi service status.
1systemctl status openstack-gnocchi-api.service openstack-gnocchi-metricd.service


- Enable the Gnocchi service and configure it to start as the system boots.
Installing and Configuring Ceilometer (Controller Node)
Perform the following operations on controller nodes.
- Install the Ceilometer package.
1yum -y install openstack-ceilometer-notification openstack-ceilometer-central
- Edit the /etc/ceilometer/pipeline.yaml file and perform the following operations:
Configure Gnocchi connections.
1 2
publishers: - gnocchi://?filter_project=service&archive_policy=low
- Edit the /etc/ceilometer/ceilometer.conf file and make the following changes:
- Configure the authentication mode and message queue access.
1 2 3 4 5
[DEFAULT] debug = true auth_strategy = keystone transport_url = rabbit://openstack:<PASSWORD>@controller pipeline_cfg_file = pipeline.yaml
- Configure the log message window.
1 2 3
[notification] store_events = true messaging_urls = rabbit://openstack:<PASSWORD>@controller
- Define the polling configuration file.
1 2
[polling] cfg_file = polling.yaml
- Configure the service credentials.
1 2 3 4 5 6 7 8 9 10
[service_credentials] auth_type = password auth_url = http://controller:5000/v3 project_domain_id = default user_domain_id = default project_name = service username = ceilometer password = <PASSWORD> interface = internalURL region_name = RegionOne
- Configure the authentication mode and message queue access.
- Create Ceilometer resources on Gnocchi.
1ceilometer-upgrade
Gnocchi must be in the running state at this stage.
- Complete the Ceilometer installation.
1 2 3 4
systemctl enable openstack-ceilometer-notification.service \ openstack-ceilometer-central.service systemctl start openstack-ceilometer-notification.service \ openstack-ceilometer-central.service
- Check the Ceilometer service status.
1 2
systemctl status openstack-ceilometer-notification.service \ openstack-ceilometer-central.service

Installing and Configuring Ceilometer (Compute Node)
Perform the following operations on compute nodes.
- Install the software. openstack-ceilometer-ipmi is optional.
1 2
yum -y install openstack-ceilometer-compute yum -y install openstack-ceilometer-ipmi
- Edit the /etc/ceilometer/ceilometer.conf file and make the following changes:
- Configure message queue access.
1 2
[DEFAULT] transport_url = rabbit://openstack:<PASSWORD>@controller
- Configure Ceilometer service credentials.
1 2 3 4 5 6 7 8 9 10
[service_credentials] auth_type = password auth_url = http://controller:5000/v3 project_domain_id = default user_domain_id = default project_name = service username = ceilometer password = <PASSWORD> interface = internalURL region_name = RegionOne
- Configure message queue access.
Configuring Nova
Perform the following operations on compute nodes.
- Edit the /etc/nova/nova.conf file and configure the message notification in the [DEFAULT] section.
1 2 3 4 5 6 7 8 9
[DEFAULT] instance_usage_audit = True instance_usage_audit_period = hour [notifications] notify_on_state_change = vm_and_task_state [oslo_messaging_notifications] driver = messagingv2
Configuring the Polling IPMI
Perform the following operations on compute nodes.
- Add the following information to the /etc/sudoers file:
1ceilometer ALL = (root) NOPASSWD: /usr/bin/ceilometer-rootwrap /etc/ceilometer/rootwrap.conf *
The /etc/sudoers file is read-only. You need to run the :wq! command to forcibly save the settings and exit.
- Edit /etc/ceilometer/polling.yaml and add the following measurement options (ensure that the options are aligned):
1 2 3 4
- name: ipmi interval: 300 meters: - hardware.ipmi.temperature

Completing the Installation
Perform the following operations on compute nodes.
- Enable the services and configure them to start as the system boots.
1 2 3 4
systemctl enable openstack-ceilometer-compute.service systemctl start openstack-ceilometer-compute.service systemctl enable openstack-ceilometer-ipmi.service (optional) systemctl start openstack-ceilometer-ipmi.service (optional)
- Restart the Compute service.
1systemctl restart openstack-nova-compute.service
Modifying Source Code
Perform the following operation on controller nodes.
- An error is reported in the OpenStack source code script. You need to modify the script before using Ceilometer.
1vim /usr/lib/python2.7/site-packages/gnocchiclient/shell.pyChange the content in line 130 to the following:
os.environ["OS_AUTH_TYPE"] = "password"
Before the modification:

After the modification:

Verifying Ceilometer
Perform the following operations on controller nodes.
Before performing the verification, ensure that the installation is successful and configuration is correct.
- Lists all metering resources.
1gnocchi resource list

- List all metering types that can be measured.
1gnocchi metric list

- Verify that Ceilometer can monitor hardware resources on VMs.
1gnocchi measures show ID
