Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

Get the accounting parameters

The accounting parameters are stored in the accounting_parameters table in the kinton_accounting database.

See Abiquo accounting services integration for examples of basic queries to list and update the parameters.

Table of accounting parameters

You can set these parameters in the kinton_accounting.accounting_parameters table.

Name

Default

value

Description
AccountingEnabled1

Controls if the accounting functionality is active or not.

0 or no parameter means that no rows are calculated and added into the accounting_event_detail table. A non-zero value means that the accounting process is active.

DeleteRegEventsUseSPParam0Controls if DeleteOldRegisteredEvents uses its parameter value instead of DeleteRegEventsDeleteHours to control the age of data in accounting_event master tables.
Default value is 0, using DeleteRegEventsDeleteHours as record maximum age.
DeleteRegEventsDeleteHours26280

This controls the number of hours worth of 'old' data that should be held in the accounting_event_... tables.

When DeleteOldRegisteredEvents is run, it will remove any rows from the tables which are inactive and older than the specified number of hours.

The default value of 26280 hours means that data is held for approximately 3 years by default (three years of 365 days).

AccountPeriodSizeHOUR

Controls the size of the aggregated account period of the accounting_event_detail table.

It may be one of the following values: HOUR, DAY, WEEK, MONTH. If the value is bad or missing, the default value is used.

AccountPeriodGranularityHOUR

Controls the granularity of an accounting period, i.e. how many resource units are recorded.: For example:

  • if account period = DAY and granularity = HOUR, then for a single CPU VM, Abiquo would record 24 resource units for the period;
  • if account period = DAY and granularity = DAY, then Abiquo would record 1 resource unit.

Possible values are HOUR, DAY, WEEK and MONTH. If the value is bad or missing, the default value is used.

MaximumPeriodsToFirstInit1

This parameter is only used when accounting_event_detail is empty. It determines how many previous accounting periods will be used to populate the accounting initially.

The default value is 1, which means that accounting data will be generated from the last period.

However, for existing installations this value can be adjusted to ensure that accounting is generated for any previous number of hours, days, weeks, or months, depending on the account period size.

The minimum number of periods is 1, and the maximum is 720. Values outside of this range will use the default value of 1.

MaximumPeriodsToProcess24

This parameters controls how many periods will be processed in each call to the UpdateAccounting stored procedure.

This setting ensures a degree of quality of service for the DBMS, minimizing the resource impact of recovering missed accounting data.

The default value is 24, which would process 1 day of accounting data, assuming the default settings for other parameters.

The minimum number of periods to process is 1, and the maximum is 720 - if a value outside of this range is supplied, then the default value of 24 is used.

Consolidation-time-sensitivity-secs30

Abiquo registers an accounting event with the desired values for each configuration change.

The accounting consolidation process will apply the maximum values found in a period, even if they were only registered for a short time, for example, because of an error.

This parameter will make the consolidation process ignore all accounting events that were only active for a small user-defined amount of time.The default value is 30 seconds, which should be enough to skip short events


Change the accounting period

To change the accounting period or other accounting parameters in an existing system, do these steps: 

  1. Backup the accounting_event_detail table.
  2. Delete the existing content of the accounting_event_detail table.
  3. Change the accounting parameters to the desired values. Set MaximumPeriodsToFirstInit to ensure old data is accounted correctly.
  4. Monitor the content of accounting_event_detail to ensure the generated data meets your needs. If not, then repeat from step 2.


Set the account period size

The AccountPeriodSize parameter controls the minimum usage time of resources.

It sets the length of the accounting period. For each accounting period, the update procedure checks the Accounting event tables for resources that have been reserved and/or used in the last period by granularity and records the usage data in the accounting_event_detail table.

The minimum period of consumption of a resource is always one accounting period. If a resource is active for an interval of less than one accounting period, the system automatically rounds consumption up to one accounting period. But the value that accounting stores will depend on the granularity.

Users can turn resources on and off (again) during an accounting period. Abiquo stores all these events in the Accounting master tables. However, accounting_event_detail only contains the maximum value for an accounting period.

You can set the accounting period size parameter in the accounting_parameters table.

ParameterDefault valuePossible valuesDescription
AccountPeriodSizeHOUR

HOUR

DAY

WEEK

MONTH

Controls the size of the aggregated account period of the accounting_event_detail table.

If the value is bad or missing, the default value of 1 hour is used.


For example, to change the accounting period to a day.

UPDATE accounting_parameters SET paramValue="DAY" WHERE paramName="AccountPeriodSize";

Set the granularity

For each accounting period, the Update procedure checks the master tables for resources reserved and/or consumed in the last period by granularity  and records the usage data in the Accounting event detail table.

You can use the granularity to divide the value stored for each accounting period into smaller time units. However, the granularity does not affect the minimum usage.

The minimum period of usage is always determined by the accounting period:

  • If accounting period = DAY and granularity = HOUR, then for a single CPU VM, Abiquo would record 24 resource units for a day record. So this could represent a charge for 24 hours of vCPU usage.
  • If accounting period = DAY and granularity = DAY, then Abiquo will record 1 resource unit. So this could represent a charge for 1 day of vCPU usage.

You can set the granularity parameter in the accounting_parameters table.


Default valuePossible valuesDescription
AccountPeriodGranularityHOUR

HOUR

DAY

WEEK

MONTH

Granularity of the resource units within an accounting period.

If the value is bad or missing, the default value is used.

The granularity must be smaller than the accounting period and the accounting period must be divisible by the granularity.

The following table shows compatible periods and granularities. Abiquo uses calendar months, so week granularity is not compatible with month.


 


Period

Hour

Day

Week

Month

Granularity

 

 

 

Hour

(tick)

(tick)

(tick)

(tick)

Day

 

(tick)

(tick)

(tick)

Week

 

 

(tick)

 

Month

 

 

 

(tick)


For example, to set the accounting period granularity to day.

We assume that the account period size is set to WEEK:

UPDATE accounting_parameters SET paramValue="DAY" WHERE paramName="AccountPeriodGranularity";

Check the updated value by using the select command.


  • No labels