Versions Compared

Key

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

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
languagebash
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
languagenone
python generate_provider_bills.py -b consolidated -p E1C

To generate bill registers for the current billing period:

Code Block
languagenone
python generate_provider_bills.py -b current -p E1C

...

Mermaid
fileNamemermaid_1656428467200
themedefault
version3
{"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]"}
  1. 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!

  2. 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.
    (warning) You may need to regenerate the abiquo_billing.abiquo_billing_data table. See next steps.

  3. DB: If you have data in the abiquo_billing.abiquo_billing_data table

    1. Back up the database 

    2. Contact Abiquo support before you delete the table

  4. 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.

  5. UI: Create a new global role (suggested name: abiquo_billing) and assign these privileges only:

    1. Home → List enterprises within scope

    2. Home → Allow user to switch enterprise

    3. Home → Manage bills

  6. UI: Create a new user (suggested user name: abiquo.billing) and assign it to the the role created in the previous step.

  7. OS: Enable the EPEL 7 repository.

    Code Block
    sudo yum install --assumeyes epel-release
  8. OS: Install the package abiquo-billing-private on an appropriate server (typically, this would be the Reporting server).

  9. 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:

    1. -p VMX_04 for VMware vCenter Server

    2. -p VCENTER_CLUSTER for VMware vCenter Cluster

  10. 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
  11. Deploy a VM to start collecting billing information.

  12. 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.

  13. 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