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:

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

<xterm>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 </xterm>

Sample Output

Obtaining the accounting information for user john

<xterm> $ 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 </xterm>

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

<xterm> $ oneacct host -r rigil

  USER       XFR      RUNN  VMS
 admin  00:00:05  00:00:02    1
  hugo  00:00:02 194:25:30    1

</xterm>

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

<xterm>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 </xterm>

Sample Output

Obtaining the accounting information for a given VM

<xterm> $ oneacct vm 2

  HOST       XFR      RUNN
   sun  00:00:01  00:00:21

schedar 00:00:02 198:17:53 </xterm>

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

<xterm> $ oneacct vm -r rigil VMID NAME XFR RUNN

 5      xee         2 194:25:30
 6      phi         5  00:00:02

</xterm>

Obtaining the accounting information for a given user

<xterm> $ 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

</xterm>

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