- Configure billing in cloud providers as required
- AWS EC2 - https://aws.amazon.com/blogs/aws/new-programmatic-access-to-aws-billing-data/
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".- Go to Billing preferences and select the option to Receive billing reports. Enter the name of your billing bucket
- Create a new user for programmatic billing (the user name is not important) and add the AmazonS3ReadOnlyAccess policy
- Azure ARM
- Grant access to billing records to the app role created in Azure
- 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.
- AWS EC2 - https://aws.amazon.com/blogs/aws/new-programmatic-access-to-aws-billing-data/
- In Abiquo, configure Enterprise properties with the name of billing properties
- AWS EC2
- "billing_bucket" property, with a value of the name of the billing bucket you created in step 1
- Azure ARM requires
- OfferDurableID
- Currency, the default is "USD"
- Locale, the default is "en-US"
- RegionInfo, the default is "US"
- AWS EC2
- On a server with MariaDB installed and with access to Abiquo Server, Abiquo database and public cloud providers, install the new billing packages
- abiquo-billing-arm
- abiquo-billing-ec2
- Configure billing packages
- AWS: Edit /opt/abiquo-billing-ec2/config/config.yml
- Abiquo database connection: user must be granted select from this host
- ec2-billing database: can be hosted on localhost
- Abiquo API: user must have Manage bills privilege
- AWS: Edit /opt/abiquo-billing-ec2/config/config.yml
Edit the configuration files in config/config.yml
Create the local billing databases and import schemas
AWS:
mysql -e "create database ec2_billing" mysql -h -p -u ec2_billing < /opt/abiquo-billing-ec2/lib/app/schema.sql
Azure:
mysql -e "create database arm_billing" mysql -h -p -u arm_billing < /opt/abiquo-billing-arm/lib/app/schema.sql
- Grant permissions on the local billing databases to the user configured in each config.yml
- If the Abiquo database is encrypted with a custom seed, copy that seed with each config.yml
- Assign Abiquo user privileges to Display hybrid dashboard tab, View bills, and optionally to Display VM cost view widget (hybrid tab)
Reference for Azure billing: https://docs.microsoft.com/es-es/azure/billing/billing-usage-rate-card-partner-solution-cloudyn