Difference between revisions of "SingleNodeNovaVagrantChef"
Line 35: | Line 35: | ||
== Install Vagrant == | == Install Vagrant == | ||
+ | |||
+ | Note that the below assumes (wrongly) that the user has [[RubyGems]] installed. There should be a section on installing [[RubyGems]], and *not* from source tarballs from the Vagrant site... that's simply not professional to expect a user install a source package of a dependency in order to run your software. -JRP. | ||
=== OS X === | === OS X === |
Revision as of 12:54, 17 March 2011
Single node nova installation using Vagrant and Chef
Note: The original article was written by Anso Labs and can be found at http://ansolabs.com/articles/single-node-nova-installation-using-vagrant-and-chef.
Integration testing for distributed systems that have many dependencies can be a huge challenge. Ideally, you would have a cluster of machines that you could PXE boot to a base os install and run a complete install of the system. Unfortunately not everyone has a bunch of extra hardware sitting around. For those of us that are a bit on the frugal side, a whole lot of testing can be done with Virtual Machines. Read on for a simple guide to installing Nova with VirtualBox and Vagrant.
Install VirtualBox
VirtualBox is virtualization software by Oracle. It runs on Mac/Linux/Windows and can be controlled from the command line. Note that we will be using VirtualBox 4.0.
OSX
Download the latest at version at http://www.virtualbox.org/wiki/Downloads
Maverick
wget -q http://download.virtualbox.org/virtualbox/debian/oracle_vbox.asc -O- | sudo apt-key add - echo "deb http://download.virtualbox.org/virtualbox/debian maverick contrib" | sudo tee /etc/apt/sources.list.d/virtualbox.list sudo apt-get update sudo apt-get install -y virtualbox-4.0
Lucid
wget -q http://download.virtualbox.org/virtualbox/debian/oracle_vbox.asc -O- | sudo apt-key add - echo "deb http://download.virtualbox.org/virtualbox/debian lucid contrib" | sudo tee /etc/apt/sources.list.d/virtualbox.list sudo apt-get update sudo apt-get install -y virtualbox-4.0
Install Vagrant
Note that the below assumes (wrongly) that the user has RubyGems installed. There should be a section on installing RubyGems, and *not* from source tarballs from the Vagrant site... that's simply not professional to expect a user install a source package of a dependency in order to run your software. -JRP.
OS X
sudo gem update --system sudo gem install vagrant
If this fails, install the MacPorts version of ruby instead. See http://vagrantup.com/docs/getting-started/setup/mac.html for more details
Maverick
sudo gem install vagrant sudo ln -s /var/lib/gems/1.8/bin/vagrant /usr/local/bin/vagrant
Lucid
wget http://production.cf.rubygems.org/rubygems/rubygems-1.3.6.zip sudo apt-get install -y unzip ruby-dev libopenssl-ruby unzip rubygems-1.3.6.zip cd rubygems-1.3.6 sudo ruby setup.rb sudo gem1.8 install vagrant
Get the anso chef recipes
cd ~ git clone http://github.com/ansolabs/openstack-cookbooks.git
Set up some directories
mkdir aptcache mkdir chef cd chef
Get the chef-solo Vagrantfile
Provisioning for vagrant can use chef-solo, chef-server, or puppet. We’re going to use chef-solo for the installation of nova.
curl -o Vagrantfile https://gist.github.com/raw/786945/solo.rb
Running nova
Installing and running nova is as simple as vagrant up
vagrant up
In 3-10 minutes, your vagrant instance should be running. NOTE: Some people report an error from vagrant complaining about MAC addresses the first time they vagrant up. Doing vagrant up again seems to resolve the problem.
vagrant ssh
Now you can run an instance and connect to it:
. /vagrant/novarc euca-add-keypair test > test.pem chmod 600 test.pem euca-run-instances -t m1.tiny -k test ami-tty # wait for boot (euca-describe-instances should report running) ssh -i test.pem root@10.0.0.3
Yo, dawg, your VMs have VMs! That is, you are now running an instance inside of Nova, which itself is running inside a VirtualBox VM.
When the you are finished, you can destroy the entire system with vagrant destroy. You will also need to remove the .pem files and the novarc if you want to run the system again.
vagrant destroy
Using the dashboard
The openstack dashboard should be running on 192.168.86.100. You can login using username: admin, password: vagrant.