CSV billing integration

 


The CSV billing integration outputs billing usage data in CSV file.

  • For basic install and configuration instructions, see CSV quickstart.


Install the CSV billing integration

Before you begin:

  1. Prepare a Billing server that can connect to the main Abiquo database

 

To install Abiquo CSV billing integration, do these steps:

  1. To install the Abiquo billing package, run yum install abiquo-billing
    Note: Abiquo billing now uses Abiquo versions

  2. Log in to the Abiquo database:

    1. Create a user for billing and grant permissions to the user. For example:

      CREATE USER 'billing'@'%' IDENTIFIED BY 'mySecureSQLpassword1'; GRANT SELECT,EXECUTE ON kinton.* TO 'billing'@'%'; GRANT SELECT ON mysql.proc TO 'billing'@'%'; GRANT SELECT ON kinton_accounting.* TO 'billing'@'%'; CREATE USER 'billing'@'localhost' IDENTIFIED BY 'mySecureSQLpassword1'; GRANT SELECT,EXECUTE ON kinton.* TO 'billing'@'localhost'; GRANT SELECT ON mysql.proc TO 'billing'@'localhost'; GRANT SELECT ON kinton_accounting.* TO 'billing'@'localhost';
    2. Define the Abiquo enterprises and VDCs that the billing integration should generate usage data for.
      Add a record for each enterprise or VDC to the account mapping table. 

      For example, to add mappings for all enterprises you would use the following SQL:

      INSERT INTO kinton.billing_account_mapping (idAbiquo, idMappingType, billingAttributeName, billingAttributeValue) (SELECT idEnterprise, 1, 'ENTERPRISE', e.name FROM kinton.enterprise e);

      For full details, see Populate the account mapping table for billing.
      Later you should create a process to maintain account mappings

  3. Log on to the billing server and go to the folder with the billing.sh script

  4. Edit the billing.properties file

    1. Set the connector_name property to "CSV".

    2. Change the billing init period to "MONTH".

    3. And enter the details of the billing user and IP address to access the Abiquo database.

      connector_name=CSV init_period=MONTH dbms_connection_url=jdbc:mysql://<Abiquo Accounting Database IP address>:3306/kinton dbms_jdbc_driver=com.mysql.jdbc.Driver dbms_user=billing dbms_password=mypassword

      For full details, see Configure billing properties 

    4. To change the resources that are billed, activate or deactivate usages of resources in billing.properties. See below

  5. Edit the csv.properties file

    1. Set the provider_mapping_name property:

      For full details of CSV connector configuration, see below

    2. To change the resources that are billed, activate or deactivate usages of resources in csv.properties. See below

  6. To generate the billing data, run ./billing.sh

  7. To check the generated billing data, go to 'CSV_files' folder of the installation directory and display the CSV file

  8. Schedule the billing integration to run automatically. See Abiquo billing integration user guide

  9. Schedule the update of the account mapping table. See Abiquo billing integration user guide

 


Configure CSV connector properties to define CSV connector behavior

This section contains a detailed description of the properties for configuring the CSV connector's behavior. For example:

  • CSV file name and location

  • CSV header

  • Append or overwrite file

  • Name of the account attribute holding the billing system account ID

  • Row per usage, or single row per account

Property

Default

Description

Property

Default

Description

csv_file



e.g. csv_file=./csv/Abiquo_Billing{DATE}.csv_

  • Location and name of the CSV file

  • Will attempt to create folders

  • Will replace {DATE} with the date that the Billing Integration was started, in 'YYYYMMDD' format

csv_file_header

 true

  • If true, write a list of column names at the top of a CSV file.

csv_file_append

 true

  • If true, append to the current file if it exists; If false, replace an existing file

provider_mapping_name

ENTERPRISE

e.g. provider_mapping_name=ZUORA_ACCOUNT_NUMBER

  • Name of the Billing attribute (defined in the billing_account_mapping table) that contains the Billing System customer ID

include_usage_costs

false

If true, include a column for each usage defined in the pricing template.

Values that are not defined in the pricing templates are not covered by billing when including usage costs:

  • 'external storage' usage does not include costings; these should be costed via storage tier usage.

  • hypervisor

  • custom usages

The billing integration does not include charges with independent charging periods:

  • minimum charge

  • standing charge

The billing integration cannot adjust these charging periods to billing periods without risk of calculation error.

row_per_usage

false

If true, produce one row in the CSV file for each usage per ID per account period.
If false, produce a single row for all usages for an id-account period.

datacenter

false

If true, bill per datacenter and include datacenter details in the connector output.
You must also enable this in the main billing integration configuration.
Note: If this value is enabled but Physical Datacenter Billing by Abiquo Datacenter is not enabled in billing.properties,
then datacenter details will be recorded as ‘n/a’.
For pricing per datacenter, set this option to true 

property



e.g. cpu=true
e.g. vlan=true
For a property, if true, include this column in the CSV file. If false, exclude the column.

See Configure usage connector properties

property_display_name



e.g. mem_display_name=RAM MB
e.g. vlan_display_name=1010101
For a property, override the standard column headers in the file or the Abiquo Type column values in the row per usage files.
Does not apply to custom usages, which already have custom names

See Configure usage connector properties

start_period

true

This mandatory column appears in all reports and it is the timestamp of the start of the accounting period

Other Columns



Set boolean values to false to exclude these columns from the CSV file

end_period

true

If true, include the column containing the timestamp of the end of the accounting period (exclusive)

abiquo_type

true

If true, include the column containing the 'type' of the Abiquo ID (ENTERPRISE or VDC)

abiquo_id

true

If true, include the column containing the Abiquo ID value

bill_system_id

true

If true, include the Billing System's Customer ID, as defined in the 'billing_account_mapping' table


Configure CSV connector properties to define billing usage data

 

 

Example csv.properties

 

This is a sample file only. Please see the csv.properties file on your billing integration system to check property values.

 

Copyright © 2006-2024, Abiquo Holdings SL. All rights reserved