Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
The platform populates the billing dashboard widgets using scripts that obtain the billing information from the cloud providers.
  1. Configure billing in cloud providers as required
    1. AWS EC2 - https://aws.amazon.com/blogs/aws/new-programmatic-access-to-aws-billing-data/
      1. Create an S3 bucket and assign the following policy to make it writable by AWS programmatic billing.

        The "Resource" attribute will need the bucket name at the end. For the example, we have used "programmaticbilling".

        Expand


        Code Block
        {
          "Version": "2008-10-17",
          "Id": "Policy1335892530063",
          "Statement": [
            {
              "Sid": "Stmt1335892150622",
              "Effect": "Allow",
              "Principal": {
                "AWS": "arn:aws:iam::386209384616:root"
              },
              "Action": [
                "s3:GetBucketAcl",
                "s3:GetBucketPolicy"
              ],
              "Resource": "arn:aws:s3:::programmaticbilling"
            },
            {
              "Sid": "Stmt1335892526596",
              "Effect": "Allow",
              "Principal": {
                "AWS": "arn:aws:iam::386209384616:root"
              },
              "Action": "s3:PutObject",
              "Resource": "arn:aws:s3:::programmaticbilling/*"
            }
          ]
        }




      2. Go to Billing preferences and select the option to Receive billing reports. Enter the name of your billing bucket
      3. Create a new user for programmatic billing (the user name is not important) and add the AmazonS3ReadOnlyAccess policy
    2. Azure ARM
      1. Grant access to billing records to the app role created in Azure
      2. Obtain the OfferDurableID from the offer agreement for your enterprise by going to your subscription → Administer. Also, you should check the Currency, Locale and RegionInfo.
  2. In Abiquo, configure Enterprise properties with the name of billing properties 
    1. AWS EC2 
      1.  "billing_bucket" property, with a value of the name of the billing bucket you created in step 1
    2. Azure ARM requires
      1. OfferDurableID
      2. Currency, the default is "USD"
      3. Locale, the default is "en-US"
      4. RegionInfo, the default is "US"
  3. On a server with MariaDB installed and with access to Abiquo Server, Abiquo database and public cloud providers, install the new billing packages
    1. abiquo-billing-arm
    2. abiquo-billing-ec2
  4. Configure billing packages
    1. AWS: Edit /opt/abiquo-billing-ec2/config/config.yml
      1. Abiquo database connection: user must be granted select from this host
      2. ec2-billing database: can be hosted on localhost
      3. Abiquo API: user must have Manage bills privilege
  5. Edit the configuration files in config/config.yml

  6. Create the local billing databases and import schemas

    AWS:

    Code Block
    mysql -e "create database ec2_billing"
    mysql -h -p -u ec2_billing < /opt/abiquo-billing-ec2/lib/app/schema.sql

    Azure:

    Code Block
    mysql -e "create database arm_billing"
    mysql -h -p -u arm_billing < /opt/abiquo-billing-arm/lib/app/schema.sql


  7. Grant permissions on the local billing databases to the user configured in each config.yml
  8. If the Abiquo database is encrypted with a custom seed, copy that seed with each config.yml
  9. Assign Abiquo user privileges to Display hybrid dashboard tab, View bills, and optionally to Display VM cost view widget (hybrid tab)

...