Monitoring OpenStack

This article will help you get the Openstack plugin for sd-agent configured and returning metrics

Installing the openstack plugin package

Install the openstack plugin on Debian/Ubuntu:

sudo apt-get install sd-agent-openstack

Install the openstack plugin on RHEL/CentOS:

sudo yum install sd-agent-openstack

Read more about agent plugins.

Configuring the agent to monitor Openstack

To make use of the Openstack check you will need to install the sd-agent on your hypervisors .

1. Configure a Server Density role and user on your identity server.

openstack role create sd_agent
openstack user create serverdensity     --password $password     --project $project_name
openstack role add sd_agent     --project $project_name     --user serverdensity

2. Update your policy.json files to enable the required permissions. role:sd_agent requires the following access:

Nova

{
    "compute_extension": "aggregates",
    "compute_extension": "hypervisors",
    "compute_extension": "server_diagnostics",
    "compute_extension": "v3:os-hypervisors",
    "compute_extension": "v3:os-server-diagnostics",
    "compute_extension": "availability_zone:detail",
    "compute_extension": "v3:availability_zone:detail",
    "compute_extension": "used_limits_for_admin",
    "os_compute_api:os-aggregates:index": "rule:admin_api or role:sd_agent",
    "os_compute_api:os-aggregates:show": "rule:admin_api or role:sd_agent",
    "os_compute_api:os-hypervisors": "rule:admin_api or role:sd_agent",
    "os_compute_api:os-server-diagnostics": "rule:admin_api or role:sd_agent",
    "os_compute_api:os-used-limits": "rule:admin_api or role:sd_agent"
}

Neutron

{
    "get_network": "rule:admin_or_owner or rule:shared or rule:external or rule:context_is_advsvc or role:sd_agent"
}

Keystone

{
    "identity:get_project": "rule:admin_required or project_id:%(target.project.id)s or role:sd_agent",
    "identity:list_projects": "rule:admin_required or role:sd_agent"
}

You may need to restart these services to ensure that the ploicy changes take effect.

3. Configure /etc/sd-agent/conf.d/openstack.yaml with your instance details:

instances:
    - name: instance_1 # A required unique identifier for this instance

      # The authorization scope that will be used to request a token from Identity API v3
      # The auth scope must resolve to 1 of the following structures:
      # {'project': {'name': 'my_project', 'domain': 'my_domain} OR {'project': {'id': 'my_project_id'}}
      auth_scope:
          project:
              id: my_project_id

          # Alternately

          # project:
          #     name: my_project_name
          #     domain:
          #         id: default


      # User credentials
      # Password authentication is the only auth method supported right now
      # User expects username, password, and user domain id
      # `user` should resolve to a structure like {'password': 'my_password', 'name': 'my_name', 'domain': {'id': 'my_domain_id'}}
      user:
          password: my_password
          name: serverdensity
          domain:
              id: default

      # In some cases, the nova url is returned without the tenant id suffixed
      # e.g. http://172.0.0.1:8774 rather than http://172.0.0.1:8774/
      # Setting append_tenant_id to true manually adds this suffix for downstream requests
      # append_tenant_id: false

2. Restart the agent

sudo /etc/init.d/sd-agent restart

or

sudo systemctl restart sd-agent

Verifying the configuration
Execute info to verify the configuration with the following:

sudo /etc/init.d/sd-agent info 

or

/usr/share/python/sd-agent/agent.py info

If the agent has been configured correctly you'll see an output such as:

openstack
-----
  - instance #0 [OK]
  - Collected * metrics

You can also view the metrics returned with the following command:

sudo -u sd-agent /usr/share/python/sd-agent/agent.py check openstack

Configuring graphs

Click the name of your server from the Devices list in your Server Density account then go to the Metrics tab. Click the + Graph button on the right then choose the openstack metrics to display the graphs. The metrics will also be available to select when building dashboard graphs.

Screen_Shot_2018-01-18_at_11.46.12.png

Monitored metrics

MetricValues
openstack.nova.current_workload

Current workload on the Nova hypervisor
None / None
Type: float
openstack.nova.disk_available_least

Disk available for the Nova hypervisor
gibibyte / None
Type: float
openstack.nova.free_disk_gb

Free disk on the Nova hypervisor
gibibyte / None
Type: float
openstack.nova.free_ram_mb

Free RAM on the Nova hypervisor
mebibyte / None
Type: float
openstack.nova.hypervisor_load.1

The average hypervisor load over one minute.
None / None
Type: float
openstack.nova.hypervisor_load.15

The average hypervisor load over fifteen minutes.
None / None
Type: float
openstack.nova.hypervisor_load.5

The average hypervisor load over five minutes.
None / None
Type: float
openstack.nova.limits.max_image_meta

The maximum allowed image metadata definitions for this tenant
None / None
Type: float
openstack.nova.limits.max_personality

The maximum allowed personalities for this tenant
None / None
Type: float
openstack.nova.limits.max_personality_size

The maximum size of a single personality allowed for this tenant
None / None
Type: float
openstack.nova.limits.max_security_group_rules

The maximum number of security group rules allowed for this tenant
None / None
Type: float
openstack.nova.limits.max_security_groups

The maximum number of security groups allowed for this tenant
None / None
Type: float
openstack.nova.limits.max_server_meta

The maximum allowed service metadata definitions for this tenant
None / None
Type: float
openstack.nova.limits.max_total_cores

The maximum allowed cores for this tenant
None / None
Type: float
openstack.nova.limits.max_total_floating_ips

The maximum allowed floating IPs for this tenant
None / None
Type: float
openstack.nova.limits.max_total_instances

The maximum number of instances allowed for this tenant
None / None
Type: float
openstack.nova.limits.max_total_keypairs

The maximum allowed keypairs allowed for this tenant
None / None
Type: float
openstack.nova.limits.max_total_ram_size

The max allowed RAM size for this tenant
gibibyte / None
Type: float
openstack.nova.limits.total_cores_used

The total cores used by this tenant
None / None
Type: float
openstack.nova.limits.total_floating_ips_used

The total floating IPs used by this tenant
None / None
Type: float
openstack.nova.limits.total_instances_used

The total instances used by this tenant
None / None
Type: float
openstack.nova.limits.total_ram_used

The current RAM used by this tenant
gibibyte / None
Type: float
openstack.nova.limits.total_security_groups_used

The total number of security groups used by this tenant
None / None
Type: float
openstack.nova.local_gb

The size in GB of the ephemeral disk present on this hypervisor host
gibibyte / None
Type: float
openstack.nova.local_gb_used

The size in GB of disk used on this hypervisor host
gibibyte / None
Type: float
openstack.nova.memory_mb

The size in MB of RAM present on this hypervisor host
mebibyte / None
Type: float
openstack.nova.memory_mb_used

The size in MB of RAM used on this hypervisor host
mebibyte / None
Type: float
openstack.nova.running_vms

Number of running VMs on this hypervisor host
None / None
Type: float
openstack.nova.server.cpu0_time

CPU time in nanoseconds of this virtual CPU
nanosecond / None
Type: float
openstack.nova.server.hdd_errors

The number of errors seen by the server when accessing an HDD device
None / None
Type: float
openstack.nova.server.hdd_read

Number of bytes read from an HDD device by this server
byte / None
Type: float
openstack.nova.server.hdd_read_req

The number of read requests made to an HDD device by this server
None / None
Type: float
openstack.nova.server.hdd_write

Number of bytes written to an HDD device by this server
byte / None
Type: float
openstack.nova.server.hdd_write_req

The number of write requests made to an HDD device by this server
None / None
Type: float
openstack.nova.server.memory

The amount of memory in MB provisioned for this server
mebibyte / None
Type: float
openstack.nova.server.memory_actual

The amount of memory in MB provisioned for this server
mebibyte / None
Type: float
openstack.nova.server.memory_rss

The amount of memory used by the processes of this server that is not associated with disk pages - such as stack and heap memory
mebibyte / None
Type: float
openstack.nova.server.vda_errors

The number of errors seen by the server when accessing a VDA device
None / None
Type: float
openstack.nova.server.vda_read

Number of bytes read from a VDA device by this server
byte / None
Type: float
openstack.nova.server.vda_read_req

The number of read requests made to a VDA device by this server
None / None
Type: float
openstack.nova.server.vda_write

Number of bytes written to a VDA device by this server
byte / None
Type: float
openstack.nova.server.vda_write_req

The number of write requests made to a VDA device by this server
None / None
Type: float
openstack.nova.vcpus

Number of vCPUs available on this hypervisor host
None / None
Type: float
openstack.nova.vcpus_used

Number of vCPUS used on this hypervisor host
None / None
Type: float
Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

Comments

Monday  —  Friday.

10am  —  6pm UK.

Dedicated Support.