<commit_before># cloud-bursting4one

The cloud-bursting4one driver is an OpenNebula add-on that implements hybrid Cloud computing, with the ability to support Cloud bursting on a variety of public Cloud providers. It's modular design eases the integration of new Cloud provider APIs. Currently it supports the [Apache Jclouds library](<https://jclouds.apache.org/>) and the [CloudStack API](<https://cloudstack.apache.org/>). Future developments will support the [OCCI API](http://occi-wg.org/).
It is a generalization of the previous Opennebula add-on [jclouds4one](https://github.com/OpenNebula/addon-jclouds4one).
This work has been co-funded by the European Commission (EC) in the context of the FP7 [SenSyF](<http://www.sensyf.eu>) project.


## Authors

* <NAME> (<EMAIL>are.rossi[at]terradue.com)

## Compatibility

This add-on is compatible with OpenNebula 4.10.

## Features

Implements hybrid Cloud computing, to support Cloud bursting, with the ability to work with a variety of Cloud provider, such as:

* Amazon AWS
* Azure Management
* Cloud Stack
* ElasticHosts
* GleSYS
* Go2Cloud
* GoGrid
* HP Cloud Services
* Ninefold
* OpenStack

## Limitations

It is not tested with all the listed providers, so contributions in this matter are appreciated.

## Installation by RPM

This project is developed with Maven and the RPM provided with the rpm-maven-plugin (read `pom.xml`). Once you have built the project, install the package by:

```bash
rpm -Uvh cloud-bursting4one.rpm
```

## Manual Installation

To manually install the driver, you have to download the repository as a ZIP:

```bash
unzip cloud-bursting4one-master.zip
cd cloud-bursting4one
```

Copy the main driver files in the Opennebula installation directory:

```bash
ONE_DIR=<your Opennebula installation dir>
cp src/main/resources/remotes/vmm/bursting ${ONE_DIR}/remotes/vmm/bursting
cp src/main/resources/remotes/im/bursting.d ${ONE_DIR}/remotes/im/bursting.d
```

Create the soft links needed for each API driver:

```bash
cd ${ONE_DIR}/remotes
for api in jclouds cloudstack; do ln -s vmm/bursting vmm/${api}; done 
for api in jclouds cloudstack; do ln -s im/bursting.d im/${api}.d; done
```

Copy the configuration driver files in the Opennebula configuration directory:

```bash
ONE_CONF=<your Opennebula configuration dir>
cp src/main/resources/etc/ ${ONE_CONF}
```

# Configuration

The cloud-bursting4one driver includes the following APIs:

* jclouds
* cloudstack

## API driver configuration

* To configure the *general settings* for an API driver, just edit the file /etc/one/*api*_driver.conf. For example for *jclouds*:

```bash
jclouds_cmd: /usr/bin/jclouds-cli
context_path: /cloud/remote_context/jclouds/iso
```

* To configure the *accounts* for an API driver, just edit the file /etc/one/*api*_driver.conf. For example for *jclouds*:

```bash
hosts:
    ec2-accountA:
        provider: aws-ec2
        identity: <identity>
        credential: <credential>
        capacity:
            m1.small: 5
            m1.large: 0
            m1.xlarge: 0
    ec2-accountB:
        provider: aws-ec2
        identity: <identity>
        credential: <credential>
        capacity:
            m1.small: 5
            m1.large: 0
            m1.xlarge: 0
```

*NOTE*

Depending on the API driver, the content of the configuration file could be different. Examples of configurations are provided in the code.

## Opennebula core configuration

* Edit the file */etc/one/oned.conf*, adding the following lines for each child driver you want to configure:

```bash
VM_MAD = [
    name       = "jclouds",
    executable = "one_vmm_sh",
    arguments  = "-t 15 -r 0 jclouds",
    default    = "vmm_exec/vmm_exec_jclouds.conf",
    type       = "xml" ]

IM_MAD = [
      name       = "jclouds",
      executable = "one_im_sh",
      arguments  = "-c -t 1 -r 0 jclouds" ]
```

* Restart the core service:

```bash
su - oneadmin 'one stop; one start'
```

# Usage

## Setup the cluster

* Create the cluster:

```bash
su - oneadmin onecluster create bursting
```

## Setup the host

* Create the host: (TODO: Check how to specify the cluster)

```bash
su - oneadmin
onehost create ec-accountA --im jclouds --vm jclouds --net dummy
```

## Prepare the virtual template

* Prepare a template suitable for the cloud-bursting4one driver, using either the Sunstone GUI or the following commands:

```bash
cat ec2_template.txt

NAME="EC2 VM"
CONTEXT=[
    FILES=""
  ]
PUBLIC=[
    GROUP="default",
    HARDWAREID="t1.micro",
    LOCATIONID="us-east-1d"
  ]
```
```bash
onetemplate create jclouds.txt
```<commit_msg>Fixed typos<commit_after># cloud-bursting4one

The cloud-bursting4one driver is an OpenNebula add-on that implements hybrid Cloud computing, with the ability to support Cloud bursting on a variety of public Cloud providers. Its modular design eases the integration of new Cloud provider APIs. Currently it supports the [Apache Jclouds library](<https://jclouds.apache.org/>) and the [CloudStack API](<https://cloudstack.apache.org/>). Future developments will support the [OCCI API](http://occi-wg.org/).
It is a generalization of the previous Opennebula add-on [jclouds4one](https://github.com/OpenNebula/addon-jclouds4one).
This work has been co-funded by the European Commission (EC) in the context of the FP7 [SenSyF](<http://www.sensyf.eu>) project.


## Authors

* <NAME> (<EMAIL>are.rossi[at]terradue.com)

## Compatibility

This add-on is compatible with OpenNebula 4.10.

## Features

Implements hybrid Cloud computing, to support Cloud bursting, with the ability to work with a variety of Cloud provider, such as:

* Amazon AWS
* Azure Management
* Cloud Stack
* ElasticHosts
* GleSYS
* Go2Cloud
* GoGrid
* HP Cloud Services
* Ninefold
* OpenStack

## Limitations

It is not tested with all the listed providers, so contributions in this matter are appreciated.

## Installation by RPM

This project is developed with Maven and the RPM provided with the rpm-maven-plugin (read `pom.xml`). Once you have built the project, install the package by:

```bash
rpm -Uvh cloud-bursting4one.rpm
```

## Manual Installation

To manually install the driver, you have to download the repository as a ZIP:

```bash
unzip cloud-bursting4one-master.zip
cd cloud-bursting4one
```

Copy the main driver files in the Opennebula installation directory:

```bash
ONE_DIR=<your Opennebula installation dir>
cp src/main/resources/remotes/vmm/bursting ${ONE_DIR}/remotes/vmm/bursting
cp src/main/resources/remotes/im/bursting.d ${ONE_DIR}/remotes/im/bursting.d
```

Create the soft links needed for each API driver:

```bash
cd ${ONE_DIR}/remotes
for api in jclouds cloudstack; do ln -s vmm/bursting vmm/${api}; done 
for api in jclouds cloudstack; do ln -s im/bursting.d im/${api}.d; done
```

Copy the configuration driver files in the Opennebula configuration directory:

```bash
ONE_CONF=<your Opennebula configuration dir>
cp src/main/resources/etc/ ${ONE_CONF}
```

# Configuration

The cloud-bursting4one driver includes the following APIs:

* jclouds
* cloudstack

## API driver configuration

* To configure the *general settings* for an API driver, just edit the file /etc/one/*api*_driver.conf. For example for *jclouds*:

```bash
jclouds_cmd: /usr/bin/jclouds-cli
context_path: /cloud/remote_context/jclouds/iso
```

* To configure the *accounts* for an API driver, just edit the file /etc/one/*api*_driver.conf. For example for *jclouds*:

```bash
hosts:
    ec2-accountA:
        provider: aws-ec2
        identity: <identity>
        credential: <credential>
        capacity:
            m1.small: 5
            m1.large: 0
            m1.xlarge: 0
    ec2-accountB:
        provider: aws-ec2
        identity: <identity>
        credential: <credential>
        capacity:
            m1.small: 5
            m1.large: 0
            m1.xlarge: 0
```

*NOTE*

Depending on the API driver, the content of the configuration file could be different. Examples of configurations are provided in the code.

## Opennebula core configuration

* Edit the file */etc/one/oned.conf*, adding the following lines for each child driver you want to configure:

```bash
VM_MAD = [
    name       = "jclouds",
    executable = "one_vmm_sh",
    arguments  = "-t 15 -r 0 jclouds",
    default    = "vmm_exec/vmm_exec_jclouds.conf",
    type       = "xml" ]

IM_MAD = [
      name       = "jclouds",
      executable = "one_im_sh",
      arguments  = "-c -t 1 -r 0 jclouds" ]
```

* Restart the core service:

```bash
su - oneadmin 'one stop; one start'
```

# Usage

## Setup the cluster

* Create the cluster:

```bash
su - oneadmin -c 'onecluster create bursting'
```

## Setup the host

* Create the host:

```bash
su - oneadmin -c 'onehost create ec-accountA --im jclouds --vm jclouds --net dummy --cluster bursting'
```

## Prepare the virtual template

* Prepare a template suitable for the cloud-bursting4one driver, using either the Sunstone GUI or the following commands:

```bash
cat ec2_template.txt

NAME="EC2 VM"
CONTEXT=[
    FILES=""
  ]
PUBLIC=[
    GROUP="default",
    HARDWAREID="t1.micro",
    LOCATIONID="us-east-1d"
  ]
```
```bash
onetemplate create jclouds.txt
```
{'fraction_non_alphanumeric': 0.10435541971400503, 'fraction_numerical': 0.008514354328130117, 'mean_word_length': 3.5924812030075186, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 25, 'https://': 6, 'lorem ipsum': 0, 'www.': 2, 'xml': 4}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '34323', 'n_tokens_mistral': 3071, 'n_tokens_neox': 2868, 'n_words': 1026}