Gnocchi: Installation and Use

Prerequisites

Gnocchi uses Ceilometer to collect metric data, but it replaces the data storage, the collection and its API functionality.

Install Ceilometer

Juju

The Juju charm Ceilometer with revision > 248 should be used.

Manual

See https://docs.openstack.org/project-install-guide/telemetry/ocata/install-base-ubuntu.html

apt-get install ceilometer-collector \
  ceilometer-agent-central ceilometer-agent-notification \
  python-ceilometerclient python-libvirt

Configure the services

Follow these instructions to configure Ceilometer itself and the controller services.

Warning

Note that the Ceilometer instructions and Glance instructions suggest to use:

transport_url = rabbit://openstack:RABBIT_PASS@controller

supplying the password for openstack. However we don’t know that password since it was set by Juju, hence we can use:

transport_url = rabbit://ceilometer:RABBIT_PASS@controller

with the ceilometer password present in the section [oslo_messaging_rabbit].

Installation

Manual

See these instructions

Once Gnocchi is running, connect it to Ceilometer. In the Ceilometer unit do:

sudo ceilometer-upgrade --skip-metering-database
sudo service ceilometer-agent-central start
sudo service ceilometer-agent-notification start
sudo service ceilometer-collector start

Juju

Gnocchi can be installed using this charm.

Use

Install the CLI command:

$ sudo pip install gnocchiclient

Details on its use at Gnocchi CLI

Set authentication

You must set these environment variable before invoking gnocchi:

export OS_AUTH_TYPE=password
export OS_AUTH_URL=http://keystone.cloud.garr.it:5000/v3
export OS_USERNAME=<user>
export OS_PASSWORD=<password>
export OS_USER_DOMAIN_NAME=<user domain>
export OS_PROJECT_NAME=<user project>
export OS_PROJECT_DOMAIN_NAME=default

Test gnocchi

$ gnocchi metric list

Examples

List the available metrics:

$ gnocchi metric list
+--------------------+---------------------+--------------------+-----------+-----------------------+
| id                 | archive_policy/name | name               | unit      | resource_id           |
+--------------------+---------------------+--------------------+-----------+-----------------------+
| 08c867b4-0bed-4a2d | low                 | volume             | None      | 63c23088-5ce3-4cda-   |
| -8952-5c78c416f607 |                     |                    |           | bca3-1ac56bef94b3     |
| 2931bc55-35cb-4e27 | low                 | cpu                | ns        | dcaf2c23-1da7-4ca0    |
| -999e-744072844a8a |                     |                    |           | a7ec-8ea99117f019     |
| e974f792-b626-450e | low                 | memory             | None      | 2e33d61a-b975-4768-b4 |
| -9f7a-ad9929480b0d |                     |                    |           | -853c-541574323aed    |
| f4495fb6-76b0      | low                 | disk.usage         | B         | dcaf2c23-1da7-4ca0    |
| -478b-ae2c-        |                     |                    |           | -853c-541574323aed    |
| 2414184594f7       |                     |                    |           |                       |
...
+--------------------+---------------------+--------------------+-----------+-----------------------+

Find the resource you want to analyze, for example of type instance:

$ gnocchi resource list -t instance -c id -c user_id -c flavor_id
+--------------------------------------+----------------------------------+-----------+
| id                                   | user_id                          | flavor_id |
+--------------------------------------+----------------------------------+-----------+
| 06e76595-4155-4bbc-a7ec-8ea99117f019 | cc0530ce0f98408c9732ab346dd05872 | 1         |
| 2e33d61a-b975-4768-b478-8da64de05f6c | cc0530ce0f98408c9732ab346dd05872 | 1         |
| dcaf2c23-1da7-4ca0-853c-541574323aed | 72a0254c67754b23b43ab0aae6524b50 | 2         |
+--------------------------------------+----------------------------------+-----------+

View the resource usage of a specific resource:

$ gnocchi measures show --resource-id dcaf2c23-1da7-4ca0-853c-541574323aed cpu
+---------------------------+-------------+-------------+
| timestamp                 | granularity |       value |
+---------------------------+-------------+-------------+
| 2017-07-14T20:35:00+00:00 |       300.0 | 1.14412e+12 |
+---------------------------+-------------+-------------+

Another example:

$ gnocchi measures show --resource-id 06e76595-4155-4bbc-a7ec-8ea99117f019 --start 2017-07-14T20:35 disk.usage
+---------------------------+-------------+------------+
| timestamp                 | granularity |      value |
+---------------------------+-------------+------------+
| 2017-07-14T20:35:00+00:00 |       300.0 | 10948608.0 |
| 2017-07-14T20:45:00+00:00 |       300.0 | 10948608.0 |
+---------------------------+-------------+------------+