Jump to: navigation, search

Difference between revisions of "SingleNodeNovaVagrantChef"

 
(replacing outdated page with a link to devstack)
 
(3 intermediate revisions by 3 users not shown)
Line 1: Line 1:
__NOTOC__
+
Note: This method is no longer maintained. Consider using [http://devstack.org Devstack] instead.
= 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 [http://virtualbox.org VirtualBox] and [http://vagrantup.com 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 ===
 
 
 
<pre><nowiki>
 
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
 
</nowiki></pre>
 
 
 
 
 
=== Lucid ===
 
 
 
<pre><nowiki>
 
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
 
</nowiki></pre>
 
 
 
 
 
== Install Vagrant ==
 
 
 
=== OS X ===
 
 
 
 
 
<pre><nowiki>
 
sudo gem update --system
 
sudo gem install vagrant
 
</nowiki></pre>
 
 
 
 
 
If this fails, install the MacPorts version of ruby instead. See http://vagrantup.com/docs/getting-started/setup/mac.html for more details
 
 
 
=== Maverick ===
 
 
 
 
 
<pre><nowiki>
 
sudo gem install vagrant
 
sudo ln -s /var/lib/gems/1.8/bin/vagrant /usr/local/bin/vagrant
 
</nowiki></pre>
 
 
 
 
 
=== Lucid ===
 
 
 
 
 
<pre><nowiki>
 
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
 
</nowiki></pre>
 
 
 
 
 
== Get the anso chef recipes ==
 
 
 
<pre><nowiki>
 
cd ~
 
git clone http://github.com/ansolabs/openstack-cookbooks.git 
 
</nowiki></pre>
 
 
 
 
 
== Set up some directories ==
 
 
 
<pre><nowiki>
 
mkdir aptcache
 
mkdir chef
 
cd chef
 
</nowiki></pre>
 
 
 
 
 
== 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.
 
 
 
 
 
<pre><nowiki>
 
curl -o Vagrantfile https://gist.github.com/raw/786945/solo.rb
 
</nowiki></pre>
 
 
 
 
 
== Running nova ==
 
Installing and running nova is as simple as vagrant up
 
 
 
 
 
<pre><nowiki>
 
vagrant up
 
</nowiki></pre>
 
 
 
 
 
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.
 
 
 
 
 
<pre><nowiki>
 
vagrant ssh
 
</nowiki></pre>
 
 
 
 
 
Now you can run an instance and connect to it:
 
 
 
 
 
<pre><nowiki>
 
. /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
 
</nowiki></pre>
 
 
 
 
 
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.
 
 
 
 
 
<pre><nowiki>
 
vagrant destroy
 
</nowiki></pre>
 
 
 
 
 
== Using the dashboard ==
 
 
 
The openstack dashboard should be running on 192.168.86.100. You can login using username: admin, password: vagrant.
 

Latest revision as of 22:18, 29 April 2013

Note: This method is no longer maintained. Consider using Devstack instead.