Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

...

Table of Contents

 

Abiquo offers standard resource metrics and you can also define your own as described in this document. You can define custom metrics using Abiquo data or from another source.

...

If you have OpenFlow or Netflow network data for your platform, you can import consolidated network data into a table or schema for the Abiquo database. Then create a custom resource definition for it. Abiquo will read the data and create custom network usage records in the accounting_event_detail table. You can then use this data to bill your customers for their network bandwidth usage.

Overview

...

  • The UpdateAccounting stored procedure (located in the ‘kinton’ schema) runs.

  • The UpdateAccounting procedure processes one account period at a time.

  • It runs the ‘GenerateAccountingPeriodDataExt’ to process the period:

    • It creates temporary tables with a subset of data from the accounting_event_... tables for the time period

    • It creates a temporary table to hold unconsolidated accounting_event_detail data, which is populated with data from the temporary accounting_event_... tables

    • It consolidates the unconsolidated temporary data into the main accounting_event_detail table by calling the ‘FLUSH_TMP_ACCOUNTING_EVENT_DETAIL’ stored procedure. 

      • For each duplicate resource usage it accounts for the MAXIMUM resource identified. For example, if the number of CPUs is increased from 4 to 6 CPUs on a VM during the account period, then two rows will exist in the accounting_event_vm table for that VM.  The consolidation process identifies the maximum CPU used 6, and accounts for that.

 
When the above ‘core’  resources have been processed for a given account period the platform process the custom resources. The accounting process looks for the custom stored procedure and runs it with details of the account period.

The CUSTOM_GENERATE_ACCOUNTING_DATA_V1 stored procedure

The CUSTOM_GENERATE_ACCOUNTING_DATA_V1 stored procedure is the entry point for generating custom accounting data.   
The procedure should be defined as follows:

...

Abiquo needs to uniquely identify custom accounting resources by their resource name and resource ID. And it will need to avoid clashes with any further extensions to the core Abiquo accounting resources. Abiquo stores resource names in the accounting_event_detail table (and its temporary equivalent table) using a name ID rather than the resource name itself. 

  1. Give each custom resource a unique name

  2. Set a unique custom resource IDs as a numeric value in the range of -1 to -127

  3. Use the 'ABQ_OBJECT_NAME_TO_ID' function to add the reource name to the name table

  4. If any of the core accounting resources are disabled, add the names of VMs, VApps, VDCs, and Enterprises to the appropriate name tables

Calculating the correct number of resources for the account period granularity

...