federation-core


Component description

Contrail package contrail-federation-core containes the main functionalities of the Contrail Federation.

Core API

Provider Registration

This method must be called for notifying the federation core that a new cloud provider is available. It is assumed that the provider object has
been already registered in the federation-db.

public void registerProvider(Provider provider) throws UnknownProviderTypeException, ProviderTypeNotYetSupportedException;

Application Submission

Method exposed by the federation-core for receiving requests of application submission. It analyzes the application for determining
the suitable providers for deploying it. The set of providers is ordered by preferring the less loaded ones and it is returned to the caller as
an array.  Actually, this method relies on the server attributes stored in the federation-db.

public Provider[] submitApp(User user, Application app) throws UnknownProviderErrorException, ApplicationOperationException;

Application Start

Method exposed by the federation-core for receiving requests of starting an application. It requires that the application has been already submitted
by using the submitApp method. This method tries to allocate and start the application by using the mapping plans already computed
in the submission phase. The mapping plans are iteratively tried by respecting the computed order.

public void startApp(User user, Application app) throws ApplicationNotFoundException, ProviderComunicationException, UnknownProviderErrorException, ApplicationOperationException 

Dependencies

This package has several dependencies from other packages developed inside the project. Here you can find a
brief description of the related integration issues. 

contrail-vin

The contrail-federation-core is in charge of interacting with the contrail-vin for creating
virtual networks. In particular, there is an internal component called VIN Adapter that contacts the Contrail
VIN controller for performing such operations:

  • register VMs of an application on the VIN controller
  • register virtual networks of an application on the VIN controller
  • assigning each VM to the corresponding virtual network and communicating such associations to the VIN controller

Configuration Files

The vinAdministration.settings file can be used to configure the VIN controller properties (for details please refer to the contrail-vin documentation).
 If it is not found, a default configuration is generated, like in the following example.

#VIN administration properties. Please refer to the VIN API for documentation
#Tue Oct 02 11:10:05 CEST 2012
controller.ports.end=13030
controller.verbose=true
controller.localaddresses.start=10.30.1.1
controller.macaddresses.end=00\:16\:3E\:00\:00\:0F
controller.localaddresses.end=10.30.1.16
hostnetworks=10.31.1.0/24
controller.ports.start=13000
controller.macaddresses.start=00\:16\:3E\:00\:00\:00

Code Documentation

The class VirtualInfrastructureNetwork is in charge of analyzing the configuration file and creating the VIN controller.

The class VirtualNetworkRegistrator is in charge of analyzing an application and contacting the VIN controller for registering VMs and networks to be added to the virtual network.

The class VirtualNetworkRegistry is a registry used internally by the federation core. It contains all the information (including that provided by the VIn component) for setting up a virtual network between all the VMs of appliances composing an application.