Accounting Guide 2.0

:!: To use this functionality you need to install the Accounting Toolset Addon

The accounting toolset visualizes and reports resource usage data, and allows their integration with chargeback and billing platforms. The toolset generates accounting reports using the information from the internal OpenNebula Database, and a set of policies and practices to integrate OpenNebula accounting tools within the data-centers accounting procedures.

These accounting tools and policies address three different aspects, namely:

  • Accounting of the physical resources, it includes resource consumption per each physical host and refers to basic infrastructure metrics, e.g. CPU or memory usage.
  • Accounting of the virtual resources, it includes resource consumprtion of the virtual machines as reported from the hypervisor.
  • Accounting of the virtualized services, it usually includes service specific tools and metrics (e.g. number of connections to an apache web server). These data must be accessed using the usual procedures of the service accounting tools. OpenNebula garantees by isolating services that different accounting or monitoring tools from different services would not interfere.

Prerequisites

This addons requires the following gems:

  • sequel
  • mysql (if using the MySQL adaptor)
  • sqlite3 (if using the sqlite database)

Installation

Download the addon, untar and execute 'install.sh' as the oneadmin user.

Configuration

No configuration is needed for this addon.

Accounting for the Physical Resources

Usage of a physical resource can be obtained for a given user or a given virtual machine. Accounting reports always show aggregated information, considering possible migration of a virtual machine to between physical resources.

Command Line Usage

oneacct host - prints accounting information for the physical resources

oneacct host [-h] [-x] [-d n|-w n|-m n|-t s] <-u user|-r host>

-h prints help
-x outputs information in XML format
-d n prints information for the last n days
-w n prints information for the last n weeks
-m n prints information for the last n months
-t s prints information for the last s seconds in epoch months
-r hostname or host ID for printing accounting information
-u user name or user ID for printing accounting information

Sample Output

Obtaining the accounting information for user john

$ oneacct host -u john
    HOST       XFR      RUNN  VMS
     sun  00:00:05  00:18:40    2
   rigil  00:00:05  00:00:02    1
 schedar  00:00:02 198:17:53    1

The columns are:

  • XFR: Total transfer time. It includes cloning VM disk images in the target resource and transfer back of modified images when applicable
  • RUNN: Total running time. It includes boot, running and saving times
  • VMS: Total number of virtual machines

Obtaining accounting information for host

$ oneacct host -r rigil
    USER       XFR      RUNN  VMS
   admin  00:00:05  00:00:02    1
    hugo  00:00:02 194:25:30    1

Accounting for the Virtual Resources

Accounting information for Virtual Machines can be obtained for a given user or a given virtual machine.

The current version of the virtual resources reports does not consider possible migration of a virtual machine to between physical resources.

Command Line Usage

oneacct vm - prints accounting information for virtual machines

oneacct vm [-h] [-x] [-d n|-w n|-m n|-t s] <-u user|-r host| vmid>

-h prints help
-x outputs information in XML format
-d n prints information for the last n days
-w n prints information for the last n weeks
-m n prints information for the last n months
-t s prints information for the last s seconds in epoch months
-r hostname or host ID for printing accounting information
-u user name or user ID for printing accounting information
vmid the ID or name of the VM for printing accounting information

Sample Output

Obtaining the accounting information for a given VM

$ oneacct vm 2
    HOST       XFR      RUNN
     sun  00:00:01  00:00:21
 schedar  00:00:02 198:17:53

The columns are:

  • HOST: where the VM has been executed
  • XFR: Total transfer time in that host
  • RUNN: Total running time in the host

Obtaining the accounting information for a given host

$ oneacct vm -r rigil
VMID     NAME       XFR      RUNN
   5      xee         2 194:25:30
   6      phi         5  00:00:02

Obtaining the accounting information for a given user

$ oneacct vm -u carroll
VMID     NAME       XFR      RUNN    HOSTS
   3 Ubuntu-9  00:00:01  00:02:54        3
   4 Ubuntu-9  00:00:00  00:00:10        2

In this last example columns show agregated transfer and running times.