Abiquo 6.0.1 introduces a new module to display private cloud billing data on the Abiquo billing dashboard.
private-billing
Generate bill registers and bill consolidations for a cloud provider.
Configuration
To properly use this tool it is necessary to complete the configuration file in the config directory. You will need to supply:
Abiquo database and Abiquo billing database connection.
Abiquo API information.
Usage
Run with “-h” option to display the arguments.
Code Block | ||
---|---|---|
| ||
python generate_provider_bills.py -h
usage: generate_provider_bills.py [-h] -b {consolidated,current}
[-d BILL_DATE]
[-s {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28}]
-p PROVIDER [-l LOGDIRECTORY] [--version]
optional arguments:
-h, --help show this help message and exit
-b {consolidated,current}
the bill type.
-d BILL_DATE the bill date. Default: the date at the time of
executing this program
-s {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28}
the billing period start day. Default: 1
-p PROVIDER cloud provider name. Example values: 'VMX_04', 'E1C'
-l LOGDIRECTORY directory where the log file will be stored. Default:
current directory
--version show program's version number and exit |
To generate bill consolidations for the last billing period:
Code Block | ||
---|---|---|
| ||
python generate_provider_bills.py -b consolidated -p E1C |
To generate bill registers for the current billing period:
Code Block | ||
---|---|---|
| ||
python generate_provider_bills.py -b current -p E1C |
...
Mermaid | ||||||
---|---|---|---|---|---|---|
| ||||||
{"diagramDefinition":"flowchart LR\n Abiquo[Abiquo] --> |prices| AbiquoBilling[Abiquo billing] \n Abiquo[Abiquo] --> |usage| AbiquoBilling[Abiquo billing] \n AbiquoBilling[Abiquo billing] --> |DBMS| Private[Private Billing] --> |dashboard| Abiquo[Abiquo]"} |
Before you begin, configure pricing, e.g. with cost codes (see Create a new cost code) for VM templates and/or Hardware profiles, or resource prices in a pricing model, to assign positive costs to resources (such as VMs). If you don't have this configuration, every billing entry will be set to zero and your billing data will have no costs!
Configure the Abiquo billing integration to output in DBMS format. See Abiquo billing integration user guide and DBMS Billing Integration. In the dbms.properties, you must set row_per_usage to true.
You may need to regenerate the abiquo_billing.abiquo_billing_data table. See next steps.DB: If you have data in the abiquo_billing.abiquo_billing_data table
Back up the database
Contact Abiquo support before you delete the table
DB: If the table abiquo_billing.abiquo_billing_data is empty and you need to change the file dbms.properties, delete the table and regenerate billing data before you continue.
UI: Create a new global role (suggested name: abiquo_billing) and assign these privileges only:
Home → List enterprises within scope
Home → Allow user to switch enterprise
Home → Manage bills
UI: Create a new user (suggested user name: abiquo.billing) and assign it to the the role created in the previous step.
OS: Enable the EPEL 7 repository.
Code Block sudo yum install --assumeyes epel-release
OS: Install the package abiquo-billing-private on an appropriate server (typically, this would be the Reporting server).
OS: Edit the file /opt/abiquo-billing-private/run.sh and at the end of every Python script call, append the parameter -p and the appropriate value:
-p VMX_04 for VMware vCenter Server
-p VCENTER_CLUSTER for VMware vCenter Cluster
OS: Edit the file /opt/abiquo-billing-private/config/config.yml and enter the required information.
For example, if you have a replica database on your reporting server which is accessed by the database user billing:Code Block abiquo_database: host: localhost username: billing password: yourmysqlsecurepasswordforthebillinguser port: 3306 database: kinton billing_database: host: localhost username: billing password: yourmysqlsecurepasswordforthebillinguser port: 3306 database: abiquo_billing abiquo: api_url: https://localhost/api user: abiquo.billing password: yoursupersecurepassword
Deploy a VM to start collecting billing information.
There is a cron entry to run this process nightly, see Additional information below. To run the process on demand, get the command from the cron entry.
In the UI, the private billing information should now display on the Dashboard, and by default this is on the Hybrid tab.
Additional information
The log files for the private billing nightly process are at /var/log/abiquo-billing-private-*-pusher.log
The log rotate configuration for the process is at /etc/logrotate.d/abiquo-billing-private
The cron entry that executes the process nightly is at /etc/cron.d/abiquo-billing-private