Abiquo 5.1

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 17 Current »


See Changes to Abiquo Billing Integration 

Overview of the Abiquo Billing Integration

The Abiquo Billing Integration (billing integration) can process Abiquo Accounting data and provide it to a third party billing system to generate customer invoices for Abiquo usage.

The billing integration is a separate stand-alone utility that should be installed on a machine independent of other Abiquo software. It comprises the following components.

  • Core Billing Utility: Calculates the usage data and manages it on a 'per account' basis
  • Billing Connector: Takes the 'usage' data from the core billing utility and provides it to a third-party billing system.

There are two billing connectors

  • CSV: generates CSV files with Abiquo usage data
  • DBMS: populates a database table in any suitable MySQL database with Abiquo usage data. 



 

Install and Configure the Billing Integration

To install and configure the Abiquo Billing Integration do these steps.

  1. Select a suitable billing server to install the software
    1. It must be able to connect to the main Abiquo database
    2. In a test environment, it may be the Abiquo Server
  2. On the billing server, unzip "abiquo-billing-redist.zip" file in the install location
  3. In the Abiquo database
    1. Create a user for billing and grant permissions to the user. For example

      CREATE USER 'billing'@'%' IDENTIFIED BY 'mypassword';
      GRANT SELECT,EXECUTE ON kinton.* TO 'billing'@'%';
      GRANT SELECT ON mysql.proc TO 'billing'@'%';
      GRANT SELECT ON kinton_accounting.* TO 'billing'@'%';

    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.
      Note: set up a separate process to maintain the account mapping table.

  4. If you are using the DBMS connector, create a target database and MySQL user account for the billing integration. Do not use the Abiquo database. You must also grant permissions, for example.

    CREATE DATABASE abiquo_billing CHARACTER SET=utf8;
    CREATE USER 'bill'@'%' IDENTIFIED BY 'password';
    GRANT ALL PRIVILEGES ON abiquo_billing.* TO 'bill'@'%';

  5. On the billing server, configure the billing.properties file in the same folder as the billing.sh script.

    1. Set the connector_name property to "CSV" or "DBMS" for your connector. And enter the details of the billing user and IP address to access the Abiquo database.

      connector_name=CSV

      For full details, see Configure billing properties 

  6. On the billing server, Configure the connector properties file in the same folder as the billing.sh script. 

    1. For the CSV connector, edit csv.properties.
      Set the provider_mapping_name property.

      provider_mapping_name=ENTERPRISE

      For full details of CSV connector configuration, see CSV Billing Integration

    2. For the DBMS connector, edit dbms.properties. 
      Set the provider_mapping_name and also add the credentials for the output database

      provider_mapping_name=ENTERPRISE
      dbms_connection_url=jdbc:mysql://<Bill Data IP Address>:3306/abiquo_billing
      dbms_user=bill
      dbms_password=password

      For full details of DBMS connector configuration, see DBMS Billing Integration

  7. Run the billing.sh file ('./billing.sh' from the install directory) to generate the usage data.

  8. Check the generated usage data. CSV files are in the 'CSV_files' folder of the installation directory and DBMS data is in the abiquo_billing_data table in your database.


Schedule the billing integration to run automatically

To generate billing data at regular intervals, e.g. once a week, you can schedule billing integration jobs using programs such as cron. If you are using cron, set the script's current working directory correctly in your cron job.   For example, if you have installed the Abiquo Billing Integration into the '/opt/BillingIntegration' folder, then your crontab entry command could look like this:

0 1 * * * cd /opt/BillingIntegration; sh billing.sh

Note that the billing integration automatically tracks which data it has processed for each account, so it should not process usage data more than once.

 

Sample billing.properties file

This is a sample file only, please use the files provided with your billing integration.

 Click here to expand...
##############
#
# Billing specific properties
#
##############
# The granularity for processing Usage data
account_period=DAY

# Convert usage to 'per hour' units (true), or use accounting granularity (false)?
usage_units_per_hour=false

# For any new account, try to get the usage data for this date. If you do not supply this value, it defaults to the account_period
init_period=DAY
# Define the connector to use.   Currently 'CSV', 'DBMS' and 'Zuora' (case insensitive) are supported.
connector_name=CSV
# Optionally specify the class explicitly if the connector_name is not supplied:
#connector_class=com.abiquo.billing.connectors.zuora.ZuoraConnector
#connector_class=com.abiquo.billing.connectors.csv.CSVConnector
#connector_class=com.abiquo.billing.connectors.dbms.DBMSConnector

# Use thse DBMS settings to read the usage data and account mapping info:
# local connection dbms_connection_url=jdbc:mysql://localhost/kinton
dbms_connection_url=jdbc:mysql://10.10.10.10:3306/kinton
dbms_jdbc_driver=com.mysql.jdbc.Driver
dbms_user=dbuser
dbms_password=dbpassword

# Group the billing data by physical datacenter.
# This option is recommended for pricing per datacenter. If it is false, Abiquo will use the pricing of the first datacenter in the pricing model
dc_grouping=true

# Enable filtering to only include the datacenters you specify below
dc_filtering=true
# Set the datacenters to include for billing in order of numbers:
dc_include_filter_1=Barcelona DC
dc_include_filter_2=Southern DC

# A job ID for this Billing process. Only required if you will use concurrent billing processes
# Default id value is 1
#job_id=1
 
# Collect the core usages by consumption (true)
# or by the hard limit allocation for the Enterprise/VDC (false)
#allocation_usages=true

# Core usage enable/disable 
cpu_usage=true
cpu_on_usage=true
cpu_off_usage=true
memory_usage=true
memory_on_usage=true
memory_off_usage=true
local_storage_usage=true
ip_usage=true
vlan_usage=true
external_storage_usage=true
ha_usage=false
reserved_server_cpu_usage=false
reserved_server_memory_usage=false
repository_usage=false
anti_affinity_usage=false
firewall_usage=true
loadbalancer_usage=true

# Tiered Storage Usages
tiered_storage_usage=false
#storage_tier_1=false
#storage_tier_2=false
#storage_tier_2_name=Tier 2 <--- Configure the non-default Tier names, if required...
#storage_tier_3=false
#storage_tier_4=false

# Local Tiered Storage Usages
#local_tier_storage_usage=false
#local_tier_storage_1=false
#local_tier_storage_2=false
#local_tier_storage_2_name=Tier 2 <--- Configure the non-default Tier names, if required...
#local_tier_storage_3=false
#local_tier_storage_4=false
# Local Tiered Storage Usages
local_tier_storage_usage=true
local_tier_storage_1=true
local_tier_storage_1_name=Default Tier
local_tier_storage_2=true
local_tier_storage_2_name=tier1
#local_tier_storage_3=false
#local_tier_storage_4=false

# Cost Code usages
#cost_code_usage=false
#cost_code_1_name=Monowall
# Cost Code usages
cost_code_usage=true
cost_code_1_name=costCode1

# Hypervisor usages (all disabled by default)
hypervisor_usage=true
hypervisor_1=true
hypervisor_1_name=VMX_04
hypervisor_2=false
hypervisor_2_name=KVM
hypervisor_3=false
hypervisor_3_name=ORACLE_VM
hypervisor_4=false
hypervisor_4_name=XENSERVER
hypervisor_5=false
hypervisor_5_name=HYPERV_301
hypervisor_6=false
hypervisor_6_name=AMAZON

# Custom Usage example (disabled by default)
custom_usage=false
custom_1=false
custom_1_name=RepositoryUsageGB
custom_1_ent_sql=SELECT SUM(d.diskFileSize)/(1048576*1024) FROM kinton.enterprise e JOIN kinton.virtualimage vi ON (e.idEnterprise=vi.idEnterprise) JOIN disk d on (vi.idImage = d.template_id) WHERE d.stateful=false AND e.idEnterprise={ABQ_ENTERPRISE_ID};
custom_1_vdc_sql=


  • No labels