Skip to content

OpenStack Events

Manu edited this page Mar 31, 2017 · 13 revisions

Installation

The Openstack collector is written in Java 8 and is dependent on RabbitMQ and InfluxDB. Information on installing these dependencies is on the installation page.

Bindings

The Cyclops Openstack Event Collector consumes and processes Openstack messages which are shared between Openstack services externally; further these messages are transformed to collector-friendly events (active, pause, suspend etc) and the collector's external scheduler generates usage information for a particular resourceID/tenantID. The Collector needs to have access to the Rabbitmq bus of the Openstack controller node (by default port 5672). In order to make the Collector isolated, the following secure and independent queues and bindings should be created and configured in Rabbitmq on the controller node:

  • cyclops.openstack.nova.data -> exchange: nova, key: conductor
  • cyclops.openstack.neutron.data -> exchange: neutron, key: notifications.info
  • cyclops.openstack.cinder.data -> exchange: openstack, key: notifications.info

NOTE: Nova messages are sent to the "nova" exchange by default. Neutron and Cinder messages notifications may need to be configured separately in configuration file. Please follow Openstack documentation to configure services properly.

Once the bindings are done, the Openstack messages will be relayed to the new queues; then it is necessary to point the Cyclops Collector the new queues:

# Consumer (RabbitMQ) credentials
ConsumerHost=opstck.contr.node.fqdn
ConsumerUsername=secureUsername
ConsumerPassword=securePass
ConsumerPort=5672
ConsumerVirtualHost=/
ConsumerNovaQueue=cyclops.openstack.nova.data
ConsumerCinderQueue=cyclops.openstack.cinder.data
ConsumerNeutronQueue=cyclops.openstack.neutron.data

In order to do so simply run the following script:

bash install/setup_bindings.sh localhost

Configuration

For the Openstack collector to function properly you will need to edit the config/openstack_event.conf file and specify your Openstack settings, as well as RabbitMQ and Influxdb connection settings, both of which can be accessed remotely.

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

  • OpenstackFirstImportDate=2016-05-15T20-18-13

This field specifies the time before which no accounting or billing information observed on the queues will be processed. It should be specified using the following format: YYYY-MM-DDTHH:MM:SS.

Also the frequency of usage generation can be specified by providing schedule time in milliseconds.

  • OpenstackCollectorScheduleTime=30000

If you are running RabbitMQ and Influxdb on the same machine as the Openstack collector, then you can leave other configuration parameters untouched, as they already point to the localhost.

Logging

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

bash install/setup_logging.sh

Then all Openstack event collector logs will be stored in /var/log/cyclops/openstack_events/ directory.

Deployment

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

Run the JAR file

In order to run the Openstack collector as an embedded JAR, use the following command:

java -jar bin/openstack_event.jar config/openstack_event.conf

Compile from the source code

The above instructions should be sufficient to get the system up and running based on pre-built binaries: if you do want to compile the code on your own and your environment already has Java 8 and Maven 3 present, you can perform your own build by simply executing the following commands:

cd scripts
bash compile.sh

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