Public cloud billing check tool
Public cloud billing check tool
This tool checks public cloud billing and customer to Abiquo enterprise mapping.
Change history
Version | Module | Description |
---|---|---|
6.0.1 | Both | This tool is now available as part of the Abiquo platform |
6.0.2 | AWS | Allow billing check tool to check keynode enterprises too in AWS. |
6.0.2 | AWS | Billing check tool does not take into account an AWS SPP discount. |
6.0.2 | Both | The seed parameter was removed |
6.1.0 | Azure | Added logging to display which Azure subscriptions are not mapped for an enterprise and which subscriptions that are present in Abiquo are no longer present in the CSP, enterprises without credentials, and subscriptions that are used by more than one enterprise |
Install the tool
You can run this tool on the Abiquo Server.
In Abiquo >= 6.0.1, you can install the package abiquo-billing-public-cloud-check-tool
with yum.
The default installation directory is /opt/abiquo-public-cloud-billing-check-tool
.
And the tool file name is public-cloud-billing-check-tool.jar
Configuration
To use this tool in AWS, update your billing-api-user
for Abiquo to add access to AWS Cost Explorer.
For example, for full access you can use the following AWS IAM policy:
"Effect":
"Allow",
"Action": [ "ce:*", ],
"Resource": "*"
For both providers, add your connection details to the YAML configuration file
Go toÂ
/opt/abiquo-public-cloud-billing-check-tool/config/
Edit the
config.yml
file and complete the values for your system.Abiquo_database: host: localhost user: password: port: 3306 database: kinton socket: /var/lib/mysql/mysql.sock abiquo: api_url: 'http://localhost/api' version: '6.0' user: #Basic Auth credentials password: #OAuth credentials access-token: access-token-secret: consumer-key: consumer-secret:
General usage
The tool has two main commands to run on Azure or AWS.
java -jar public-cloud-billing-check-tool.jar
-help Usage: <main class> [-hV] [COMMAND]
Check public cloud billing information.
-h, --help Show this help message and exit.
-V, --version Print version information and exit.
Commands:
azure Check for Azure CSP customer costs and subscription mappings.
aws Check for AWS organization billing costs and account mappings.
Amazon usage
When running the tool on Amazon, you can use the -h
option to print the parameters, as shown here.
The -r
root enterprise option is required and the other parameters are optional.
An example of execution using all parameters is: java -jar public-cloud-billing-check-tool.jar aws -a -b -r=1
.
With the verbose
option, the tool will display a detailed list of all accounts mapped to Abiquo and the respective enterprises that contain public cloud credentials of each account.
With the accounts
option, the tool will check for accounts that are:
Used in more than one enterprise in Abiquo
Mapped to the reseller enterprise hierarchy but not present in the reseller organization
Present in the reseller organization but not present mapped to Abiquo
If verbose
is also selected, it will also print all the accounts of the organization.
With the billing
option, the the tool will check the difference between AWS cost and Abiquo costs for each mapped account. If verbose
is activated, the script will print the difference for all enterprises, otherwise it will only print entries with a cost difference between AWS and Abiquo.
Azure usage
You can use this tool if you have a set of Azure Plans subscriptions mapped to enterprises. The tool has two main functions:
Check that all subscriptions from a CSP Azure Plan are mapped correctly to Abiquo enterprises
For Azure billing, check the costs of the last month at customer level, not subscription level.
To run the tool for Azure with the help option to discover the parameters, run the following command:
Here is an example of the help parameters output. The -r
parameter is mandatory.
Here is an example of running the tool on Azure using parameters:
And another example:
Exclude publishers option
To exclude products from specific publishers from Azure billing, you can set and Abiquo property: abiquo.azure.billing.parser.lineitem.publisher.ignore
.
This property contains a string of publishers to exclude from billing line items in CSV format, such as Microsoft Office
.Â
When you are using this property, for the public-cloud-billing-check-tool for Azure, you can use the --excludedPublishers
option.
Exclude product IDs option
To exclude specific products by ID from Azure billing, you can set abiquo.azure.billing.parser.lineitem.productid.ignore.path
system property to define a fileystem path to a CSV file containing all the product IDs to ignore.
Effectively, the CSV file will be a list of product IDs to ignore, one per line. When you are using this property, for the public-cloud-billing-check-tool for Azure, you can use the --epp
or --excludedProductIdsPath
option.
Azure example output
In verbose mode the tool will print a detailed list of all the CSP customers, and the respective enterprises that contain public cloud credentials of the same customer.
For the Azure plans check, in verbose mode, the tool will then create output as shown below. Without verbose mode, only warnings will be shown.
Â
The number of missing subscriptions could be positive or negative:
A positive number means there are more entitlements in the CSP Azure Plan than there are in Abiquo
A negative number means there are more subscriptions in Abiquo than in the Microsoft Azure portal. This could be because credentials are not set correctly, or because a subscription was deleted/cancelled/deactivated in Azure but the subscription still exists in Abiquo.
For the billing check option, there's no verbose option, so the output will be always the same, as in the example shown below.Â
You can specify a margin for the log levels of differences between the provider and Abiquo. Differences that are less than or equal to the margin will be INFO level, and differences larger than the margin will be WARN level.
Azure example errors
The tool tries to log all error messages without stopping. Most of those errors would be errors returned from the Azure CSP API.
A customer in Abiquo was not found in the Azure CSP. You should delete these credentials from Abiquo.
Â
A recently created customer won't have any costs for the last month, so the CSP API returns an error. The tool controls this condition, and logs an error.
Â
Copyright © 2006-2024, Abiquo Holdings SL. All rights reserved