# eole-hapy-deployment

## How it works

* Create a "etablissement" on a zephir server
* Add servers to this "etablissement"
* Configure those servers with Virtual machine capabilities (search in the config it's easy to find)
* Install an Hâpy server and add it to your zephir.
* Setup the Hâpy server to enable Deployement.
* Instance your Hâpy.

What happends during "intance" ?

* First we add some "scripts" as CONTEXT files in OpenNebula (will use them during deploy).
* Then we ask for user and password to interact with the zephir server.
* If you want you can store this credentials in an encrypted file (could be useful in the future).
* If login is successful we create a new CONTEXT file with the zephir credentials we will need it after.
* Then we search for servers to deploy according to your Hâpy configuration.
* For each server we create the image and the basic template from the appliance you asked for in your server configuration
* We update the template with the configuration from your server (cpu, vcpu, networks)
* The template is also updated with some CONTEXT features, we add all the scripts from the first step and the credential file. If needed we add the zephir SSL CA file
* When the template is up to date we instanciate the virtual machine.

What happends during the "first boot" ?

* The context image is mounted, and all the scripts we declared in the vm template as "INIT_SCRIPTS" are runned.
* So far we run "enregistrement_zephir" and "instance"
