Getting capacity and usage information out of Openstack Placement

One of the problems we have in Nectar is reporting on capacity and usage of nova. We have ~1000 compute nodes and these come and go. The Openstack Placement service seems like a good place to extract capacity and usage information from nova so I thought I'd see what it could do.

First problem is there is no placement client. I found the osc-placment project but this isn't that useful as it is just an openstack client plugin and not a python library like the other clients.

I've written a custom client before for an internal project so I created a very simple client that can get resource provider usage and capacity. In placement a resource provider maps directly to a compute node in nova.

Now we have the means to query this information I wrote a custom Ceilometer poller to collect this information periodically. Once this was collecting data I needed to configure Ceilometer and Gnocchi to ingest the notifications that my new poller was generating.

In Ceilometer I needed to modify gnocchi_resources.yaml to get it to ingest these new notifications.

  - resource_type: resource_provider
    archive_policy: stats
    metrics:
      - 'resource_provider.usage.vcpu'
      - 'resource_provider.usage.memory'
      - 'resource_provider.usage.disk'
      - 'resource_provider.capacity.vcpu'
      - 'resource_provider.capacity.memory'
      - 'resource_provider.capacity.disk'

    attributes:
      name: resource_metadata.name

I also needed to create the corresponding resource type in gnocchi.
For this I create a resource-type with a name and also a site which is a term Nectar uses to determine the member of Nectar. This means we can group by site when doing reports.

Now we can use this information in Gnocchi to make some pretty grafana graphs for our usage and capacity.

Grafana graphs of placement usage/capacity grouped by site

Comments

Post a Comment

Popular posts from this blog

Understanding telemetry services in Nectar cloud

A brief history of OVN migration