Accounting Client 3.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 accounting OpenNebula Database.

These accounting tools address the accounting of the virtual resources, it includes resource consumption of the virtual machines as reported from the hypervisor.

Prerequisites

This addon requires the following gems:

  • sequel
  • mysql (if using the MySQL adaptor)
  • sqlite3 (if using the sqlite database)
  • accounting subsystem configured and running as shown in the acctd_confguide

Installation

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

Configuration

No configuration is needed for this addon.

Accounting for the Virtual Resources

Accounting information for Virtual Machines can be obtained for a given user or all of them.

Command Line Usage

oneacct - prints accounting information for virtual machines

<xterm>Usage: oneacct [options]

  1. s, –start time Start date and time to take into account
  2. e, –end time End date and time
  3. u, –user user User id to make accounting
  4. j, –json Output in json format
  5. x, –xml Output in xml format

</xterm>

The time is written as month/day/year hour:minute:second.

To integrate this tool with your billing system you can use -j or -x flags to get all the information in an easy computer readable format.

Sample Output

Obtaining the accounting information for a given VM

<xterm> # User 0

VMID MEMORY CPU NETRX NETTX TIME

 4      64M     50.1       556K      12.1K  01/09 04:56:44

# User 2

VMID MEMORY CPU NETRX NETTX TIME

 6      64M     50.1       156K         7M  01/01 01:16:24
 7      64M     50.1       803K       6.5M  01/08 04:50:09

</xterm>

The columns are:

  • VMID: VM identifier
  • MEMORY: Memory allocated for the VM
  • CPU: Cpu allocated for the VM
  • NETRX: in bandwidth used
  • NETTX: out bandwidth used
  • TIME: Time the VM was running

Obtaining the accounting information for a given user

<xterm> $ oneacct -u 0 # User 0

VMID MEMORY CPU NETRX NETTX TIME

 4      64M     50.1       556K      12.1K  01/09 04:56:44

</xterm>