Rate This Document
Findability
Accuracy
Completeness
Readability

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.

  1. Log in to the OpenStack CLI as the admin user.
    1
    source /etc/keystone/admin-openrc
    
  2. Create the service credentials.
    1. Create the ceilometer user and set a password for the user.
      1
      openstack user create --domain default --password-prompt ceilometer
      
    2. Add the admin role to the ceilometer user.
      1
      openstack role add --project service --user ceilometer admin
      
  3. Register the Gnocchi service in Keystone.
    1. Create the gnocchi user and set a password.
      1
      openstack user create --domain default --password-prompt gnocchi
      
    2. Create the gnocchi service entity.
      1
      openstack service create --name gnocchi --description "Metric Service" metric
      
    3. Add the admin role to the gnocchi user.
      1
      openstack role add --project service --user gnocchi admin
      
  4. 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.

  1. Install the Gnocchi package.
    1
    yum -y install openstack-gnocchi-api openstack-gnocchi-metricd python-gnocchiclient
    
  2. 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
    

  3. Edit the /etc/gnocchi/gnocchi.conf file.
    1
    vim /etc/gnocchi/gnocchi.conf
    
    Modify the following:
    1. 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
      
    1. 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
      
    1. Configure the default storage mode of metadata.
      1
      2
      [archive_policy]
      default_aggregation_methods = mean,min,max,sum,std,count
      
    1. Configure the allowed access sources.
      1
      2
      [cors]
      allowed_origin = http://controller:3000
      
    1. Configure database retrieval.
      1
      2
      [indexer]
      url = mysql+pymysql://gnocchi:<PASSWORD>@controller/gnocchi
      
    1. 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
      
    2. 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
      
    3. 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
      

Installing and Configuring Redis

Perform the following operations on controller nodes.

  1. Install Remote Dictionary Server (Redis) server.
    1
    yum -y install redis
    

  2. Edit the /etc/redis.conf file and make the following changes:
    1
    vim etc/redis.conf
    
    1. Enable Redis to start in the background.
      1
      daemonize yes
      
    2. Disable the protection mode for Redis.
      1
      protected-mode no
      
    3. Bind Redis to the controller node host.
      1
      bind 172.168.201.11
      
  3. Start the Redis server service using the redis.conf file configured.
    1
    redis-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:

    1. Edit the /etc/rc.d/rc.local file.
      1
      vim /etc/rc.d/rc.local
      
      Add the following content to the file:
      1
      redis-server /etc/redis.conf
      
    2. Save and close the file, and grant the execute permission on the /etc/rc.d/rc.local file.
      1
      chmod +x /etc/rc.d/rc.local
      

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.

  1. Initialize Gnocchi.
    1
    gnocchi-upgrade
    
  2. Grant the read and write permissions on the /var/lib/gnocchi file.
    1
    chmod -R 777 /var/lib/gnocchi
    
  3. Complete the installation of Gnocchi.
    1. 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
      
    2. Check the Gnocchi service status.
      1
      systemctl status openstack-gnocchi-api.service openstack-gnocchi-metricd.service
      

Installing and Configuring Ceilometer (Controller Node)

Perform the following operations on controller nodes.

  1. Install the Ceilometer package.
    1
    yum -y install openstack-ceilometer-notification openstack-ceilometer-central
    
  2. 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
    
  3. Edit the /etc/ceilometer/ceilometer.conf file and make the following changes:
    1. 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
      
    1. Configure the log message window.
      1
      2
      3
      [notification]
      store_events = true
      messaging_urls = rabbit://openstack:<PASSWORD>@controller
      
    1. Define the polling configuration file.
      1
      2
      [polling]
      cfg_file = polling.yaml
      
    1. 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
      
  4. Create Ceilometer resources on Gnocchi.
    1
    ceilometer-upgrade
    

    Gnocchi must be in the running state at this stage.

  5. 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
    
  6. 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.

  1. Install the software. openstack-ceilometer-ipmi is optional.
    1
    2
    yum -y install openstack-ceilometer-compute
    yum -y install openstack-ceilometer-ipmi
    
  2. Edit the /etc/ceilometer/ceilometer.conf file and make the following changes:
    1. Configure message queue access.
      1
      2
      [DEFAULT]
      transport_url = rabbit://openstack:<PASSWORD>@controller
      
    1. 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
      

Configuring Nova

Perform the following operations on compute nodes.

  1. 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.

  1. Add the following information to the /etc/sudoers file:
    1
    ceilometer 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.

  2. 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.

  1. 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)
    
  2. Restart the Compute service.
    1
    systemctl restart openstack-nova-compute.service
    

Modifying Source Code

Perform the following operation on controller nodes.

  1. An error is reported in the OpenStack source code script. You need to modify the script before using Ceilometer.
    1
    vim /usr/lib/python2.7/site-packages/gnocchiclient/shell.py
    

    Change 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.

  1. Lists all metering resources.
    1
    gnocchi resource list
    

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

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