Vagrant is a tool to help automate the creation and deployment of virtual machines for development purposes. It reduces the amount of effort to make sure multiple developers are using the same set of tools to reduce complaints of “but it worked on my machine”.
Ganeti Web Manager comes with a Vagrantfile and uses Chef to automate the deployment process within Vagrant.
What you get¶
/home/vagrant/ganeti_webmgryou will have your project mounted. All changes made to files in your project folder either in Vagrant, or on the host will be seen on both systems.
You will have a Django Superuser created with the following credentials (these can be changed in the
A MySQL Database and User pre-configured for Ganeti Web Manager
All of these values can be changed by overriding the Chef attributes in the
Using Vagrant to deploy Ganeti Web Manager is simple. You will need Vagrant version 1.5.4 or greater and two vagrant plugins, vagrant-berkshelf and vagrant-omnibus. For compatability versions, we require vagrant-berkshelf with a version greater than or equal to 2.0.
Installing Vagrant is easy, you can install it to your system by downloading the appropriate package, and running it.
To install the vagrant-berkshelf and vagrant-omnibus plugins run the following command in your terminal:
vagrant plugin install vagrant-omnibus vagrant plugin install vagrant-berkshelf --plugin-version '>= 2.0.1'
Once you have the plugins installed you can use the following commands to start the Virtual Machine (this may take a while):
After it finishes and your back to your prompt, if you do not see any output after:
[default] Installing Chef 11.x.x Omnibus Package...
Then you need to run the following command to have it reprovision the VM:
After provisioning, your Virtual Machine will have Ganeti Web Manager installed and running with the Apache web server. However, so that you can modify the source code, you’ll need to run the Development Server.
You can get to the VM by using the
vagrant ssh command. To run Ganeti Web Manager you
need to source your virtualenv and start the development server:
source /opt/ganeti_webmgr/bin/activate cd ~/ganeti_webmgr python ganeti_webmgr/manage.py runserver 0.0.0.0:8000
From there you can visit Ganeti Web Manager at (by default) 220.127.116.11:8000 in your web browser.
The reason we runserver on 0.0.0.0 is because by default it runs on 127.0.0.1 which is only accessible from the VM.
More details on vagrant can be found at http://docs.vagrantup.com/v2/
Configuration of the deployment with Vagrant is done using Chef. For documentation on the available attributes for configuring the deployment visit the cookbook’s github here: https://github.com/osuosl-cookbooks/ganeti_webmgr