Abiquo 5.1

Skip to end of metadata
Go to start of metadata

This page describes how to configure Amazon billing data for resellers. For standard accounts see Display Amazon billing data for standard accounts

Create a Cost and Usage Report in AWS

  1. Create an S3 bucket, for example, "costandusagebillingreport"

  2. Within the bucket, create a folder where AWS will store your reports. Give it the name of your report, for example "costandusagebillingreport"
  3. Note the billing bucket name, for example, "costandusagebillingreport"

  4. Create a new user, such as "programmaticbilling" and assign the AmazonS3ReadOnlyAccess policy
  5. Activate IAM user access to billing information. See https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/control-access-billing.html
  6. Go to Billing → Billing preferences

  7. Open the Detailed Billing Reports [Legacy] section

  8. Select the option to Turn on the legacy Detailed Billing Reports feature to receive ongoing reports of your AWS charges

  9. Click Configure and enter your S3 bucket

  10. Select all of the available reports including
    1. Monthly report
    2. Detailed billing report
    3. Cost allocation report
    4. Detailed billing report with resources and tags
  11. Click Save preferences

  12. Go to Cost & Usage Reports

  13. Enter the Report name then click Next

  14. Click Configure and select the S3 bucket. Click Next, then select I have configured that this policy is correct. 
  15. For the report prefix, by default, Amazon will put the reports in a folder with the name format "/report-name/date-range/". You should enter this as the report prefix in Abiquo. Click Next
  16. Review your configuration and check that the following parameters are set: bucket name + the path (folder/subfolder) + Time detail: Hourly + GZIP or ZIP format

Install and configure billing packages

You will need a server with MariaDB running with access to the Abiquo API, Abiquo database, and public cloud providers. 

  1. Install the "abiquo-billing-ec2" billing package.
  2. Create the local billing databases and import schemas

    mysql -e "create database ec2_billing"
    mysql -h -p -u ec2_billing < /opt/abiquo-billing-ec2/lib/app/schema.sql
  3. Grant privileges to a user for the local billing databases

  4. To configure, edit the config.yml file. By default for AWS, this is file is located at /opt/abiquo-billing-ec2/config/config.yml and the following example file shows the values that you must replace.

    abiquo_database:
      host: 10.10.10.36
      user: user
      password: password
      port: 3306
    billing_database:
      host: 10.10.10.38
      user: user
      password: password
      port: 3306
    abiquo:
      api_url: http://10.10.10.32/api
      user: admin
      password: xabiquo
      seed: 


    Notes: 

    1. The billing database is the one you created in the above steps, so it can be hosted on localhost

    2. "seed" is the name of a custom seed that encrypts the Abiquo database. Copy the custom seed into the same directory as the config.yml file for each provider

  5. On the Abiquo database, grant select privileges from this host to the abiquo_database user that will run the billing scripts 
  6. In Abiquo, check that the Abiquo API user has the Manage bills privilege
  7. Assign Abiquo users the privileges to Display hybrid dashboard tab, View bills, and optionally to Display VM cost view widget (hybrid tab)

Configure Amazon Reseller accounts

If you have reseller tenants using reseller accounts, do the following steps:

  1. Create a reseller billing configuration file at the following location:

    /opt/abiquo-billing-ec2/lib/app/config/reseller.yml
  2. To identify each reseller entry, create a unique random string to use as a tenant key, for example, "4a7a3850".  Enter the name of the billing bucket you created in Amazon and the reseller credentials

    4a7a3850:
     bucket: bucket_name
     access_key: access_key
     secret_key: secret_key
  3. In Abiquo, edit the reseller enterprise and create the following enterprise properties
    1. "billing_bucket" with the value of "reseller" and the tenant in the format "reseller_[UUID_key_from_reseller.yml_file]". So from the above example, for the tenant with ID 4a7a385, this would be reseller_4a7a3850.
    2. report_prefix
    3. report_name
  4. In Abiquo, edit the enterprises of the customers of the reseller and create the following property. You can also set the default value in the reseller.
    1. "amazon_price_factor" with the value of the markup or discount applied by the partner to the end user. The default value is 1.