About Indigo Component
The APEL project provides accounting for the Indigo DataCloud project. It is written in Python and uses MySQL.
Overview
APEL Cloud Accounting can account for the usage of OpenNebula and OpenStack instances. Accounting "collectors" need to be installed on machines with access to the underlying Cloud infrastructure. The collectors can be found here.
The collectors produce "Usage Records" in the APEL-Cloud v0.2 or v0.4 message formats. Information about these format can be found here.
These records need to be sent as POST requests to the REST endpoint .../api/v1/cloud/record
, where ...
is the machine hosting the docker image. A POST request requires an X.509 certificate to authenticate the request. The hostname, which should be the same as the common name (CN) contained in the X.509 certificate, must be listed as a provider here or be given special access via the ALLOWED_TO_POST
enviroment variable for the request to be authorized. For details of how to be added to the CMDB service list, please refer to the CMDB documentation.
Accepted records are summarised twice daily. These summaries can be accessed with a GET request to .../api/v1/cloud/record/summary
. Summaries can be filtered using key=value
pairs. See Supported key=value pairs for a list of valid supported key=value
pairs. A GET request requires an IAM access token be included in the request. This token is then sent to the IAM to authenticate the ID of the service requesting access to the summary. This ID needs to be in ALLOWED_FOR_GET
in yaml/apel_rest_interface.env
for access to be authorized.
It is currently expected that only the QoS/SLA tool will interact with these summaries.
Features of Version 1.5.0
Accept APEL-Cloud v0.2 and v0.4 usage records via POST requests to the REST endpoint
.../api/v1/cloud/record
Provide access to summaries via GET requests to REST endpoint
.../api/v1/cloud/record/summary
Running the Docker image on Centos 7 and Ubuntu 16.04
We recommend using the Docker image to run the Accounting server and REST interface. As such, having Docker installed is a prerequisite.
See Ubuntu 16.04 Instructions or Centos 7 Instructions for details of how to install Docker. There is no requirement to undertake the 'Post-installation steps for Linux'.
We also recommend using Docker Compose or Anisble to deploy the containers.
See the offical Docker Compose documentation for details of how to install docker-compose.
See the offical Ansible documentation for details of how to install Ansible.
The instructions below are for both Docker Compose and Ansibe.
Download the compressed source code from here, it does not matter where the source code is downloaded to. As the source code contains schemas and yaml files needed for deploying via docker-compose or ansible, you will need to unzip the source code and then
cd
into the inflated directory.Register the service as a protected resource with the Indigo Identity Access Management (IAM) service. See this section for instructions, before proceeding to step 3.
Populate the following variables in
yaml/apel_rest_interface.env
Populate the following variables in
yaml/mysql.env
MYSQL_PASSWORD
will also need to be added to the password fielddocker/etc/apel/clouddb.cfg
anddocker/etc/mysql/my.cnf
Before the REST interface will start, a certificate needs to be added to the container. This can be done by placing a certificate (
apache.crt
) and key (apache.key
) under/etc/httpd/ssl/
on the host machine (be careful to preserve correct.crt
/.key
file permissions)./etc/httpd/ssl/
will be mounted into the container by docker-compose. Note: You may need to create the/etc/httpd/ssl/
directory.If you are running Docker as a non-root user, you will need to make
docker/etc/cron.d
owned byroot
. This is because this directory gets mounted into the container and it needs to be owned byroot
for cron jobs in the container to run.Launch the containers.
With Docker Compose:
It is recommeded to wait 1 minute after launching the database in order for it to configure fully before launching the APEL containers
With Ansible:
First, replace
<working directory>
inyaml/ansible.yaml
with the absolute file path of the decompressed source code, then run the command below.Navigate a web browser to
https://<hostname>/api/v1/cloud/record/summary
Last updated