Jump to: navigation, search

Nova Compute Load Averages

Revision as of 10:46, 18 February 2014 by Sahid (talk | contribs)

Introduction

The system load averages for a compute could be used to define policies during the scheduler of an instance. Unix based system provides a text file '/proc/loadavg' that allow to get information of the system load averages for the last 1, 5, and 15 minutes.

Overview

Currently the base class `virt.driver.ComputeDriver` defines a method "get_host_uptime". The method asks the driver to call the command 'uptime'. This command provides the system load averages and some other information, the problem is that, this method does not define a correct output format and a reflexion is necessary about the really necessity to keep the API.

libvirt

get_host_uptime: 13:37:30 up 7 days,  4:29, 19 users,  load average: 0.04, 0.04, 0.0

vmware

get_host_uptime: Please refer to {HOST_IP} for the uptime

xenapi

get_host_uptime: 13:37:30 up 7 days,  4:29, 19 users,  load average: 0.04, 0.04, 0.0

Proposal

The proposal is to define a new API 'loadavg' that return a tuple for the last 1, 5 and 15 minutes of the system load averages.

   {
       "hypervisor": {
           "hypervisor_hostname": "fake-mini",
           "id": %(hypervisor_id)s,
           "loadavg": [0.20, 0.12, 0.14]
       }
   }

Implementation

  • A new method will be added to 'nova.virt.driver' called 'get_host_loadavg'
  • A new API will be added to 'nova.api.openstack.hypervisors' called 'loadavg'

Usage

  • V2 REST API: not implemented.
  • V3 REST API: /v3/os-hypervisors/{ID}/loadavg


The blueprint can be seen at: https://blueprints.launchpad.net/nova/+spec/compute-loadavg