BonFIRE logo and link to main BonFIRE site

Table Of Contents

Previous topic

BonFIRE EaaS - Elasticity as a Service

Next topic

Notifications

This Page

How To Use the BonFIRE EaaS

How to create an elastic group

In order to create an elastic group you need to configure some parameters using the contextualization of the Elasticity Engine virtual machine. Those parameter are necessary for providing some essential information to the Elasticity Engine that will be used during the execution. This is possible in two different ways: using the portal or the API.

Configuring EaaS using the API

For using the elasticity as a service you need to create an experiment with an aggregator. Before you start an elastic group is important that the aggregator is up and running. In order to create an elastic service you should prepare the image that contains the service itself. To do this you can read this documentation Datablock OCCI How-To. it is important to understand that the image that you will prepare during that process is the base image that will be used every time is necessary to create a new virtual machine to scale up. This image will be cloned every time your upscale threshold will be exceeded and a new VM will be created using that disk as a source. After you create your disk image containing the preconfigured service, you need to start configuring some properties for the EaaS. There are different kind of configuration parameters: some are necessary for the Group of VMs, other for specifying the rules.

First of all you need to specify the minimum number of virtual machines that you want will be part of your elastic group. Then you have also to put a maximum number of instances to create during the execution. Furthermore you have also to specify a name that will be assigned to the VMs part of your group:

<ELASTICITY_VMGROUP_MIN>1</ELASTICITY_VMGROUP_MIN>
<ELASTICITY_VMGROUP_MAX>5</ELASTICITY_VMGROUP_MAX>
<ELASTICITY_VMGROUP_NAME>elastic_service</ELASTICITY_VMGROUP_NAME>

Then you need to specify the Type of the instance that you would like to use and the disk source of your prepared image. You need to specify the locations where you want to deploy yuor VMs. Supported locations are HLRS, INRIA, and EPCC. Basically the elasticity engine will choose randomly the location where to deploy the necessary VMs :

<ELASTICITY_INSTANCETYPE>lite</ELASTICITY_INSTANCETYPE>
<ELASTICITY_DISKSOURCE>disk_name</ELASTICITY_DISKSOURCE>
<ELASTICITY_LOCATIONS>fr-inria;uk-epcc;de-hlrs</ELASTICITY_LOCATIONS>
<ELASTICITY_NETWORK>BonFIRE WAN</ELASTICITY_NETWORK>

If you need a custom instance Type you can use the following tags:

<ELASTICITY_INSTANCETYPE>custom</ELASTICITY_INSTANCETYPE>
<ELASTICITY_MEMORY>1024</ELASTICITY_MEMORY>
<ELASTICITY_CPU>0.5</ELASTICITY_CPU>
<ELASTICITY_VCPU>1</ELASTICITY_VCPU>

For additional context parameters the following tag should be added:

<ELASTICITY_CONTEXT>key1=value1;key2=value2</ELASTICITY_CONTEXT>

If you want you can also use the reservation on INRIA for reserving a cluster of machines and run your experiment in a specific cluster. In this case is necessary to insert the cluster_uuid and if you want you can also specify the hostname where to deploy your virtual machines created dynamically by the elasticity engine.

<ELASTICITY_CLUSTER>cluster_uuid</ELASTICITY_CLUSTER>
<ELASTICITY_HOST>hostname</HOSTNAME>

Configuring the trigger

Before explaining the way to configure the trigger we introduce the upscale/downscale mechanism. Think about a group of virtual machines that are serving user requests distributed among them by a load balancer with a weight based round robin algorithm. Their load, in terms of CPU or MEMORY, should be the same if the load balancer does well his job. You need only to introduce the upscale threshold and for doing this you can use a standard zabbix expression:

{<key>.<function>(<parameter>)}<operator><constant>

For example if you want that the Elasticity Engine starts another instance after the cpu average of your group overcomes the 60% you should write an expression like this:

{system.cpu.usage.last(0)}>70

It is higly recommended to use this item for the CPU threshold, since it will get the cpu usage of the whole system. This is the context parameter that you need to insert during the creation of the compute resource of the Elasticity Engine.

<ELASTICITY_TRIGGER_UPSCALE_EXPRESSION>{system.cpu.usage.last(0)}>70</ELASTICITY_TRIGGER_UPSCALE_EXPRESSION>

The utilized down-scaling algorithm is based on the assumption that a VM can be removed from the group, only if its removal does not bring other VMs into a trigger state. So you don’t need to specify any kind of trigger for downscaling if you introduce an upscale expression.

Getting a load balancer

If you create an elastic experiment you might want to create a load balancer in order to distribute the load among your instances. For doing this, you need to specify three parameters:

<ELASTICITY_LB_SCHEME>HAProxy</ELASTICITY_LB_SCHEME>
<ELASTICITY_LB_PORT>80</ELASTICITY_LB_PORT>
<ELASTICITY_LB_LOCATION>/locations/fr-inria</ELASTICITY_LB_LOCATION>

You can specify two different kind of load balancers: “HAProxy” or “kamailio”. The first attribute will allow the creation of an HAProxy instance. HAProxy is a layer 4/7 load balancer. Kamailio is a SIP load balancer. Both of them are configured for stateless services. The elasticity engine automatically will add/remove instances to the load balancer. You need to specify the PORT number where your service is reachable and the location where you want to deploy this load balancer.

Complete OCCI request

Here you can find an example of a complete OCCI request that could be used for creating an elastic group. Basically you need to create a compute resource using a standard Debian 2G image (so you have to specify the STORAGE_ID and NETWORK_ID) and then include the context variables in the request:

<compute xmlns="http://api.bonfire-project.eu/doc/schemas/occi">
        <name>BonFIRE-Elasticity-Engine-elenService</name>
        <instance_type>lite</instance_type>
        <cluster>uuid</cluster>
        <disk>
                <storage href="STORAGE_ID"/>
                <type>OS</type>
                <target>hda</target>
        </disk>
        <nic>
                <network href="NETWORK_ID"/>
        </nic>
        <context>
                <usage>zabbix-agent</usage>
                <aggregator_ip>aggregator_ip</aggregator_ip>
                <ELASTICITY_TRIGGER_UPSCALE_EXPRESSION>{system.cpu.usage.last(0)}>70</ELASTICITY_TRIGGER_UPSCALE_EXPRESSION>
                <ELASTICITY_VMGROUP_MAX>5</ELASTICITY_VMGROUP_MAX>
                <AGGREGATOR_USER>Admin</AGGREGATOR_USER>
                <AGGREGATOR_PASSWD>zabbix</AGGREGATOR_PASSWD>
                <ELASTICITY_INSTANCETYPE>lite</ELASTICITY_INSTANCETYPE>
                <ELASTICITY_DISKSOURCE>disk_name</ELASTICITY_DISKSOURCE>
                <ELASTICITY_LOCATIONS>fr-inria;uk-epcc;de-hlrs</ELASTICITY_LOCATIONS>
                <ELASTICITY_NETWORK>BonFIRE WAN</ELASTICITY_NETWORK>
                <ELASTICITY_LB_SCHEME>HAProxy</ELASTICITY_LB_SCHEME>
                <ELASTICITY_VMGROUP_MIN>1</ELASTICITY_VMGROUP_MIN>
                <ELASTICITY_LB_PORT>80</ELASTICITY_LB_PORT>
                <ELASTICITY_LB_LOCATION>/locations/fr-inria</ELASTICITY_LB_LOCATION>
                <ELASTICITY_VMGROUP_NAME>eaas</ELASTICITY_VMGROUP_NAME>
                <usage>elasticity-engine</usage>
                <ELASTICITY_CLUSTER>uuid</ELASTICITY_CLUSTER>
        </context>
        <link href="/locations/fr-inria" rel="location"/>
</compute>

Configuring the EaaS using the Portal

In order to create an elastic experiment through the Portal, you need to create a new experiment and select the check box enabling Elasticity Capable Aggregator.

How to create a new elastic experiment

When you have an experiment with a running aggregator, you need to create an elastic group configuring all the parameters necessary.

How to create a new elastic group

Please note the Portal workaround for Elasticity as a Service; Elasticity as a Service will not work unless you follow these instructions.

If you want to use the reservation offered by INRIA, you can do it by clicking on continue instead of finish and adding those parameters into the context section:

<ELASTICITY_CLUSTER>uuid</ELASTICITY_CLUSTER>
<ELASTICITY_HOST>host</ELASTICITY_HOST>

After you create your experiment you should see the service endpoint in the elastic group section.

Portal workaround for Elasticity as a Service

The Portal OCCI builder misses the instance type specification for the service VMs. When configuring the EaaS, click on “Continue”, not “Finish”, and add the following line to the <context> part, as shown in the figure below:

<ELASTICITY_INSTANCETYPE>lite</ELASTICITY_INSTANCETYPE>
Context fix for Portal EaaS bug

As discussed on the Configuring EaaS using the API section, you can specify any BonFIRE instance type, including custom.