Skip to content

CloudStack

skovzhaw edited this page Jul 1, 2016 · 20 revisions

Installation

CloudStack collector is written in Java 8 and requires connection to RabbitMQ and Hibernate. To install these dependencies consult the installation page.

Configuration

For CloudStack collector to function properly you will need to edit config/cloudstack.conf file and specify your CloudStack credentials, as well as RabbitMQ and Hibernate connection settings, both of which can be accessed remotely. You can also specify on which port server should be listening or what date will be used for the first import.

Even though the config/cloudstack.conf file is commented, it is still important to pay attention to:

  • CloudStackURL=https://url
  • CloudStackAPIKey=apikey
  • CloudStackSecretKey=secretkey

You can also specify what is the first day of import by providing YYYY-MM-DD date:

  • CloudStackFirstImport=2016-06-29

By default the server port is 4573, but you can change it easily:

  • ServerHTTPPort=4573

If you are running RabbitMQ and Hibernate (PostgreSQL) on the same machine as CloudStack collector, then you can left other configuration parameter untouched, as they already point to the localhost.

Bindings

Before starting CloudStack usage collection it is paramount to bind its exchanges to the RCB Cyclops queues. In order to do so simply run the following script and provide server's location and port RabbitMQ admin is listening on:

  • bash install/setup_bindings.sh localhost 15672

Logging

To have the logging system enabled you need to run the following:

  • bash install/setup_logging.sh

Then all CloudStack collector logs will be stored in /var/log/cyclops/cloudstack/ directory.

Deployment

Once all prerequisites are installed and collector is configured you can start using it.

Run the JAR file

In order to run CloudStack collector as embedded JAR:

  • java -jar bin/cloudstack.jar config/cloudstack.conf

If you don't want to use the default port from configuration file, you can optionally specify one by adding it as parameter in the command line.

Compile from the source code

If you want to compile the code on your own and your environment already has Java 8 and Maven 3 present, simply execute the following commands:

  • cd install
  • bash compile.sh

You will find the compiled JAR embedded file in the bin subdirectory.

API guide

After the CloudStack collector has started it will start collecting usage records from your CloudStack deployment. If anything goes wrong, please refer to logs (they have logical structure).

The CloudStack collector operates based on internal scheduler, in order to periodically ask CloudStack for new usage records. These records are then processed, harmonised and broadcasted to RCB Cyclops (based on available bindings).

If you want to make sure internal scheduler is running, or you want to manually force a pull, you can do so by querying HTTP RESTful API interface:

Clone this wiki locally