Difference between revisions of "Managed Virtual Machine (MVM)"

From DAVE Developer's Wiki
Jump to: navigation, search
(Installation and configuration)
(Installation and configuration)
Line 16: Line 16:
 
** for Windows: https://git-for-windows.github.io/
 
** for Windows: https://git-for-windows.github.io/
 
** for Linux: please refer to your distribution package manager
 
** for Linux: please refer to your distribution package manager
* install/configure ssh (please refer to https://git-scm.com/book/it/v2/Git-on-the-Server-Generating-Your-SSH-Public-Key)
+
* configure ssh (for example by following [https://git-scm.com/book/it/v2/Git-on-the-Server-Generating-Your-SSH-Public-Key this guide])
* send us the ssh public key as described in http://wiki.dave.eu/index.php/Axel_Embedded_Linux_Kit_%28XELK%29#RSA_key_generation
+
* send us the ssh public key as described [[Axel_Embedded_Linux_Kit_%28XELK%29#RSA_key_generation|here]]
* download VirtualBox from http://www.virtualbox.org and install it
+
* [http://www.virtualbox.org download VirtualBox] and install it
 
** tested with 5.0.14 (does NOT work with 5.0.0)
 
** tested with 5.0.14 (does NOT work with 5.0.0)
* download Vagrant from https://www.vagrantup.com/
+
* [https://www.vagrantup.com/ download Vagrant]
 
** install Vagrant
 
** install Vagrant
 
* clone the project/development kit repository (eg: git clone git@git.dave.eu:''project-name''/mvm.git)
 
* clone the project/development kit repository (eg: git clone git@git.dave.eu:''project-name''/mvm.git)
 
* enter repository cloned directory
 
* enter repository cloned directory
 
** create ''data'' directory into parent directory
 
** create ''data'' directory into parent directory
** copy or move ''vagrant.yml.sample'' to ''vagrant.yml''
+
** copy ''vagrant.yml.sample'' to ''vagrant.yml''
 
** customize VM settings (vagrant.yml): number of CPUs and RAM size
 
** customize VM settings (vagrant.yml): number of CPUs and RAM size
 
** uncomment and set ip_adress to VM's ip address (vagrant.yml)
 
** uncomment and set ip_adress to VM's ip address (vagrant.yml)
 
** overwrite provision/modules/user/file/id_rsa with your private key (~/.ssh/''username@myhost.com'')
 
** overwrite provision/modules/user/file/id_rsa with your private key (~/.ssh/''username@myhost.com'')
 
* create the VM with the following command:
 
* create the VM with the following command:
 +
 
<pre>
 
<pre>
 
vagrant up
 
vagrant up
 +
</pre>
 +
 +
After the first boot, MVM may need to restart to complete installation. To reboot the VM just run:
 +
 +
<pre>
 +
vagrant reload
 +
</pre>
 +
 +
== MVM Lifecycle Management ==
 +
 +
You may start/stop/destroy MVM from classic VirtualBox interface or using Vagrant.
 +
 +
In the latter case:
 +
* to stop MVM run
 +
 +
<pre>
 +
vagrant halt
 +
</pre>
 +
 +
* to destroy MVM (WARNING: this remove all MVM VirtualBox files, including your customization!)
 +
 +
<pre>
 +
vagrant destroy
 +
</pre>
 +
 +
* to start a previously stopped MVM:
 +
 +
<pre>
 +
vagrant up
 +
</pre>
 +
 +
* to save MVM state to file (hibernate)
 +
 +
<pre>
 +
vagrant suspend
 +
</pre>
 +
 +
 +
== Update MVM ==
 +
 +
To update your MVM enter MVM git repository and just:
 +
 +
* stop MVM
 +
 +
<pre>
 +
vagrant halt
 +
</pre>
 +
 +
* update git repository
 +
 +
<pre>
 +
git pull
 +
</pre>
 +
 +
* force Vagrant provision
 +
 +
<pre>
 +
vagrant up --provision
 
</pre>
 
</pre>

Revision as of 15:51, 16 March 2016

Introduction[edit | edit source]

Managed Virtual Machine (MVM) is a virtual machine that allows developers to start using DAVE's platform without wasting time in manually installing and configuring the development environment.

The MVM is created and managed using Vagrant (https://www.vagrantup.com/), which is a powerful tool that creates, configures and manages virtual development environments. Vagrant uses Providers to integrate with the hypervisor that provides the virtual machines, that for the MVM is Oracle VirtualBox (https://www.virtualbox.org/). The entire virtual environment configuration is stored in simple plain text files, including the instructions for the provisioning tool (Puppet, https://puppetlabs.com/), so that installation, management and update of the MVM is straightforward.

Mvm-vagrant-bd.png

The MVM comes with all the development tools and source code, pre-configured, and requires only a minimal setup by the end user.

Installation and configuration[edit | edit source]

To generate the image:

  • download and install git
  • configure ssh (for example by following this guide)
  • send us the ssh public key as described here
  • download VirtualBox and install it
    • tested with 5.0.14 (does NOT work with 5.0.0)
  • download Vagrant
    • install Vagrant
  • clone the project/development kit repository (eg: git clone git@git.dave.eu:project-name/mvm.git)
  • enter repository cloned directory
    • create data directory into parent directory
    • copy vagrant.yml.sample to vagrant.yml
    • customize VM settings (vagrant.yml): number of CPUs and RAM size
    • uncomment and set ip_adress to VM's ip address (vagrant.yml)
    • overwrite provision/modules/user/file/id_rsa with your private key (~/.ssh/username@myhost.com)
  • create the VM with the following command:
vagrant up

After the first boot, MVM may need to restart to complete installation. To reboot the VM just run:

vagrant reload

MVM Lifecycle Management[edit | edit source]

You may start/stop/destroy MVM from classic VirtualBox interface or using Vagrant.

In the latter case:

  • to stop MVM run
vagrant halt
  • to destroy MVM (WARNING: this remove all MVM VirtualBox files, including your customization!)
vagrant destroy
  • to start a previously stopped MVM:
vagrant up
  • to save MVM state to file (hibernate)
vagrant suspend


Update MVM[edit | edit source]

To update your MVM enter MVM git repository and just:

  • stop MVM
vagrant halt
  • update git repository
git pull
  • force Vagrant provision
vagrant up --provision