Jump to: navigation, search

Difference between revisions of "Obsolete:NovaInstallFestInstructions"

 
(25 intermediate revisions by 5 users not shown)
Line 1: Line 1:
__NOTOC__
+
 
These is the stuff that you need to basically cut and paste to a fresh cloud server to get nova up and running:
+
{{:[[DeprecatedPage]]}}
 +
= Installing Nova from Source Code =
 +
 
 +
This page was written for the first Install Fest, and we'll be repeating the Install Fest at the second [[Summit/Bexar | Design Summit]], but these are outdated. Still, we'll keep them around for the next Install Fest, and feel free to update these and remove the "outdated" warning if you update.
 +
 
 +
Check out [[NovaInstall| Nova install instructions]] for scripts and a supplied image.
  
 
If you need a Cloud Server during the install fest, visit here: http://etherpad.openstack.org/HackDay-Slices
 
If you need a Cloud Server during the install fest, visit here: http://etherpad.openstack.org/HackDay-Slices
Line 31: Line 36:
  
 
sed -i -e "s/domain type='kvm'/domain type='qemu'/" -e s'!/usr/bin/kvm!/usr/bin/qemu-system-x86_64!g' /usr/share/nova/libvirt.xml.template
 
sed -i -e "s/domain type='kvm'/domain type='qemu'/" -e s'!/usr/bin/kvm!/usr/bin/qemu-system-x86_64!g' /usr/share/nova/libvirt.xml.template
 +
 +
# you need to be in the root of  where you unzipped nova.zip, then:
 
. novarc
 
. novarc
  
Line 90: Line 97:
 
Note: if you get an error while trying to run the apt-get update command that references a PGP key, replace the key in the above example with the key in your error message.
 
Note: if you get an error while trying to run the apt-get update command that references a PGP key, replace the key in the above example with the key in your error message.
  
Instructions for getting it to work from source: (from Justin Santa Barbara)
+
== Instructions for getting it to work from source on Ubuntu Lucid Lynx. ==
 +
 
 +
'''These are assuming physical hardware''' (for now) - getting it running on a slice seems to require a lot more custom versions of dependencies.  Warning - because the nova source is fast moving, these change often!:
  
 
<pre><nowiki>
 
<pre><nowiki>
---
+
mkdir ~/openstack
Instructions for a Lucid slice on how to get up and running starting from source
+
 
*** WORK IN PROGRESS ***
+
cd ~/openstack
  
LAUNCHPAD_ID=your-launchpad-name
+
cat > conf <<EOF
OPENSTACK_USERNAME=your-preferred-openstack-username
+
#LAUNCHPAD_ID="your-launchpad-name"
 +
OPENSTACK_USERNAME=`whoami`
  
NOVA_SRC_BASE=~/src/nova/nova
+
NOVA_SRC_BASE=~/openstack/nova
KEYS_PATH=/var/lib/nova/keys
+
#DATA=/var/lib/nova
IMAGES_PATH=/var/lib/nova/images
+
DATA=${NOVA_SRC_BASE}/../data
BUCKETS_PATH=/var/lib/nova/buckets
+
KEYS_PATH=${DATA}/keys
INSTANCES_PATH=/var/lib/nova/instances
+
IMAGES_PATH=${DATA}/images
NETWORKS_PATH=/var/lib/nova/networks
+
BUCKETS_PATH=${DATA}/buckets
 +
INSTANCES_PATH=${DATA}/instances
 +
NETWORKS_PATH=${DATA}/networks
 
CA_DIR=${NOVA_SRC_BASE}/CA
 
CA_DIR=${NOVA_SRC_BASE}/CA
  
Copy your SSH private key to the slice (!)
+
NETWORK_ARGS="--simple_network=true --simple_network_gateway=192.168.1.1 --simple_network_netmask=255.255.255.0 --simple_network_network=192.168.1.0 --simple_network_ips=192.168.1.220,192.168.1.221,192.168.1.222 --simple_network_bridge=br0 --simple_network_broadcast=192.168.1.255"
  
# Some basics
+
export PYTHONPATH=${NOVA_SRC_BASE}
apt-get install --yes bzr unzip screen
+
EOF
  
# We need a bunch of python modules
+
#src the conf file to set variables in the environment
apt-get --yes install python-m2crypto python-ipy python-tornado python-twisted-bin python-twisted-core python-carrot python-boto
+
. conf
apt-get install euca2ools python-libvirt python-daemon
 
  
# And RabbitMQ and Nginx
+
# Some basic packages
apt-get --yes install rabbitmq-server nginx
+
apt-get install --yes bzr unzip screen curl
  
 +
# We need a bunch of python modules
 +
sudo apt-get --yes install python-m2crypto python-ipy python-twisted-bin python-twisted-core python-twisted-web python-carrot python-boto euca2ools python-libvirt python-daemon python-setuptools
 +
# And RabbitMQ
 +
sudo apt-get install --yes rabbitmq-server
  
 
# And kvm
 
# And kvm
apt-get install --yes kpartx
+
sudo apt-get install --yes kpartx kvm
# modprobe kvm
+
sudo modprobe kvm
adduser root libvirtd
 
  
TODO: Is there a way to avoid logging out here???
+
# Install libvirt
 +
sudo apt-get --yes install libvirt-bin libvirt0
 +
sudo adduser `whoami` libvirtd
  
mkdir ~/src
+
#logout and back in to add your user to the libvirtd group
cd ~/src
+
#TODO: Is there a way to avoid logging out here???
 +
 
 +
cd ~/openstack
 +
# Hopefully we don't need to log in now that the project is public
 
## don't you need your LP key installed first?
 
## don't you need your LP key installed first?
 
+
#bzr lp-login ${LAUNCHPAD_ID}
bzr lp-login ${LAUNCHPAD_ID}
+
bzr init-repo .
bzr init-repo nova
+
bzr branch lp:nova
 
cd nova
 
cd nova
bzr branch lp:nova
 
  
# If running in a slice, swap kvm for qemu:
 
  
sed -i -e "s/domain type='kvm'/domain type='qemu'/" -e s'!/usr/bin/kvm!/usr/bin/qemu-system-x86_64!g' nova/compute/libvirt.xml.template
+
# Building Redis 2.0
 +
# Lucid version of redis is 1.2, which doesn't support HMSET
 +
mkdir -p ~/openstack/src
 +
cd ~/openstack/src
 +
wget "http://redis.googlecode.com/files/redis-2.0.0-rc2.tar.gz"
 +
tar zxf redis-2.0.0-rc2.tar.gz
 +
cd redis-2.0.0-rc2
 +
make
 +
# I don't know how to install Redis, so I run it from this directory...
 +
# ?? sudo make install
  
 +
# Building pyRedis
 +
# Lucid version of python-redis client doesn't support HMSET (?)
 +
cd ~/openstack/src
 +
git clone http://github.com/andymccurdy/redis-py.git
 +
cd redis-py/
 +
python setup.py build
 +
sudo python setup.py install
  
# Lucid version of python-redis doesn't support HMSET (?)
 
# Also, Soren has packaged python-gflags
 
# (It looks like soren's python-tornado PPA pulls in mysql-client??)
 
# Soren has also provided a version of libvirt that will work in a slice (at least I think that's the bug fixed?)
 
rm /etc/apt/sources.list.d/soren-nova.list
 
echo 'deb http://ppa.launchpad.net/soren/nova/ubuntu lucid main' >> /etc/apt/sources.list.d/soren-nova.list
 
echo 'deb http://173.203.107.207/ubuntu ./' >> /etc/apt/sources.list.d/soren-nova.list
 
gpg --keyserver hkp://keys.gnupg.net --recv-keys AB0188513FD35B23
 
gpg -a --export AB0188513FD35B23 | apt-key add -
 
apt-get update
 
  
apt-get install python-redis redis-server python-gflags libvirt-bin libvirt0 kvm
+
# Building tornado (this might no longer be needed)
  
# python-tornado would pull in mysql-client
+
cd ~/openstack/src
 
 
rm /etc/apt/sources.list.d/soren-nova.list
 
apt-get update
 
 
 
cd ~/src
 
 
wget "http://www.tornadoweb.org/static/tornado-0.2.tar.gz"
 
wget "http://www.tornadoweb.org/static/tornado-0.2.tar.gz"
 
tar zxf tornado-0.2.tar.gz
 
tar zxf tornado-0.2.tar.gz
Line 167: Line 185:
 
sudo python setup.py install
 
sudo python setup.py install
  
 +
# Build gflags
 +
cd ~/openstack/src
 +
wget "http://google-gflags.googlecode.com/files/gflags-1.3.tar.gz"
 +
tar zxf gflags-1.3.tar.gz
 +
cd gflags-1.3
 +
./configure
 +
make
 +
sudo make install
  
cd ${NOVA_SRC_BASE}
+
cd ~/openstack/src
 +
wget "http://python-gflags.googlecode.com/files/python-gflags-1.3.tar.gz"
 +
tar zxf python-gflags-1.3.tar.gz
 +
cd python-gflags-1.3
 +
python setup.py build
 +
sudo python setup.py install
  
#export PYTHONPATH=${NOVA_SRC_BASE}
+
# If running in a slice, swap kvm for qemu:
echo ${NOVA_SRC_BASE} > /usr/local/lib/python2.6/dist-packages/nova.pth
+
#sed -i -e "s/domain type='kvm'/domain type='qemu'/" -e s'!/usr/bin/kvm!/usr/bin/qemu-system-x86_64!g' nova/compute/libvirt.xml.template
  
 
# Initialize our Certificate Authority (CA)
 
# Initialize our Certificate Authority (CA)
 +
cd ${NOVA_SRC_BASE}
 
#mkdir -p ${CA_DIR}
 
#mkdir -p ${CA_DIR}
 
cd ${CA_DIR}
 
cd ${CA_DIR}
 
./genrootca.sh
 
./genrootca.sh
  
 +
# Open new screen / window; start Redis 2
 +
cd ~/openstack/src/redis-2.0.0-rc2
 +
./redis-server
 +
 +
# Create first user
 
cd ${NOVA_SRC_BASE}
 
cd ${NOVA_SRC_BASE}
 
 
NOVA_MANAGE_ARGS="--ca_path=${CA_DIR} --credentials_template=nova/auth/novarc.template --keys_path=${KEYS_PATH} --vpn_client_template=nova/cloudpipe/client.ovpn.template"
 
NOVA_MANAGE_ARGS="--ca_path=${CA_DIR} --credentials_template=nova/auth/novarc.template --keys_path=${KEYS_PATH} --vpn_client_template=nova/cloudpipe/client.ovpn.template"
 
 
 
 
bin/nova-manage ${NOVA_MANAGE_ARGS} user admin ${OPENSTACK_USERNAME}
 
bin/nova-manage ${NOVA_MANAGE_ARGS} user admin ${OPENSTACK_USERNAME}
  
 +
# Create project
 +
# There's a debate about whether nova-manage user admin should automatically create a project for you, with the same name as the user (bug 607527)...
 
OPENSTACK_PROJECTNAME=${OPENSTACK_USERNAME}
 
OPENSTACK_PROJECTNAME=${OPENSTACK_USERNAME}
 
#OPENSTACK_PROJECTNAME=${OPENSTACK_USERNAME}-project1
 
#OPENSTACK_PROJECTNAME=${OPENSTACK_USERNAME}-project1
#bin/nova-manage ${NOVA_MANAGE_ARGS} project create ${OPENSTACK_PROJECTNAME} ${OPENSTACK_USERNAME}
+
# This might fail, depending on the progress of bug 607527.  However, even if the project is still auto-created and this command fails, this helps to make sure that the VPN is created below
#right now nova-manage user admin will automatically create a project for you, with the same name as the user, so you could cut out the above step.  Also you can specify an acess and secret key instead of having them auto-generated
+
bin/nova-manage ${NOVA_MANAGE_ARGS} project create ${OPENSTACK_PROJECTNAME} ${OPENSTACK_USERNAME}
  
 +
 +
# Just check that we're not FUBAR (no errors expected!!)
 +
bin/nova-manage ${NOVA_MANAGE_ARGS} user list
 +
bin/nova-manage ${NOVA_MANAGE_ARGS} project list
 +
bin/nova-manage ${NOVA_MANAGE_ARGS} vpn list
 +
 +
# Export credentials/config bundle to "me" subdir
 
mkdir me
 
mkdir me
 
bin/nova-manage ${NOVA_MANAGE_ARGS} project zip ${OPENSTACK_PROJECTNAME} ${OPENSTACK_USERNAME} me/nova.zip
 
bin/nova-manage ${NOVA_MANAGE_ARGS} project zip ${OPENSTACK_PROJECTNAME} ${OPENSTACK_USERNAME} me/nova.zip
Line 196: Line 238:
 
unzip nova.zip
 
unzip nova.zip
  
. novarc
+
# Creates novarc, which contains your config
 +
# . novarc
  
# Start up the OpenStack daemons in screen windows
+
# Open new screen; start API daemon
screen
+
sudo bash # Evil, but this does some VPN config I think
 +
. ~/openstack/conf
 +
cd ${NOVA_SRC_BASE}
  
NOVA_API_ARGS="--ca_path=${CA_DIR} --keys_path=${KEYS_PATH} --fake_users=1" # --datastore_path=/var/lib/nova/keeper"
+
NOVA_API_ARGS="--ca_path=${CA_DIR} --keys_path=${KEYS_PATH} --fake_users=1 ${NETWORK_ARGS}" # --datastore_path=/var/lib/nova/keeper"
 +
echo NOVA_API_ARGS=${NOVA_API_ARGS}
 
bin/nova-api ${NOVA_API_ARGS} --nodaemonize --verbose start
 
bin/nova-api ${NOVA_API_ARGS} --nodaemonize --verbose start
  
# [ Add screen, switch to it ]
+
# Open new screen; start ObjectStore daemon
 +
. ~/openstack/conf
 +
cd ${NOVA_SRC_BASE}
  
 
mkdir -p ${BUCKETS_PATH}
 
mkdir -p ${BUCKETS_PATH}
 
mkdir -p ${IMAGES_PATH}
 
mkdir -p ${IMAGES_PATH}
NOVA_OBJECTSTORE_ARGS="--ca_path=${CA_DIR} --keys_path=${KEYS_PATH} --fake_users=1 --images_path=${IMAGES_PATH} --buckets_path=${BUCKETS_PATH}" # --datastore_path=/var/lib/nova/keeper"
+
NOVA_OBJECTSTORE_ARGS="--ca_path=${CA_DIR} --keys_path=${KEYS_PATH} --fake_users=1 ${NETWORK_ARGS} --images_path=${IMAGES_PATH} --buckets_path=${BUCKETS_PATH}" # --datastore_path=/var/lib/nova/keeper"
bin/nova-objectstore ${NOVA_OBJECTSTORE_ARGS} --nodaemonize --verbose start
+
# This hack is because otherwise the compute deamon also writes to twistd.log
 +
mkdir -p objectstorelogs
 +
cd objectstorelogs
 +
../bin/nova-objectstore ${NOVA_OBJECTSTORE_ARGS} --nodaemon --verbose start
  
# [ Add screen, switch to it ]
+
# Open new screen; start up compute daemon
 +
sudo bash # Evil, but this does some disk mounting stuff
 +
. ~/openstack/conf
 
cd ${NOVA_SRC_BASE}
 
cd ${NOVA_SRC_BASE}
  
 
mkdir -p ${INSTANCES_PATH}
 
mkdir -p ${INSTANCES_PATH}
 
mkdir -p ${NETWORKS_PATH}
 
mkdir -p ${NETWORKS_PATH}
NOVA_COMPUTE_ARGS="--ca_path=${CA_DIR} --keys_path=${KEYS_PATH} --fake_users=1 --instances_path=${INSTANCES_PATH} --networks_path=${NETWORKS_PATH} --libvirt_xml_template=nova/compute/libvirt.xml.template --vpn_client_template=nova/cloudpipe/client.ovpn.template --credentials_template=/nova/auth/novarc.template"
+
NOVA_COMPUTE_ARGS="--ca_path=${CA_DIR} --keys_path=${KEYS_PATH} --fake_users=1 ${NETWORK_ARGS} --images_path=${IMAGES_PATH} --use_s3=false --instances_path=${INSTANCES_PATH} --networks_path=${NETWORKS_PATH} --libvirt_xml_template=nova/compute/libvirt.xml.template --vpn_client_template=nova/cloudpipe/client.ovpn.template --credentials_template=/nova/auth/novarc.template"
 
# --datastore_path=/var/lib/nova/keeper"
 
# --datastore_path=/var/lib/nova/keeper"
 +
bin/nova-compute ${NOVA_COMPUTE_ARGS} --nodaemon --verbose start
 +
 +
# Open new screen; start up volume daemon (if you're going to use volumes)
 +
sudo bash # Evil, but this does some LVM stuff etc
  
# the arg for this is --nodaemon since it uses twisted. I'm moving nova-volume to twisted as well, which will mean --nodaemon will be used for nova-volume
+
# This creates a 10GB file to create volumes out of
bin/nova-compute ${NOVA_COMPUTE_ARGS} --nodaemon --verbose start
+
mkdir -p /volumes
 +
dd if=/dev/zero of=/volumes/fake.0 bs=128M count=80
 +
LOOPBACK_MOUNT=`sudo losetup --show --find /volumes/fake.0`
 +
echo LOOPBACK_MOUNT=${LOOPBACK_MOUNT}
 +
 
 +
. ~/openstack/conf
 +
cd ${NOVA_SRC_BASE}
  
 +
NOVA_VOLUME_ARGS="--storage_dev=${LOOPBACK_MOUNT}"
  
# Nginx proxies the ObjectStore from port 3333 to port 3334
+
#are you running from iSCSI? if not, comment out 2nd line and run first line:
cd ${NOVA_SRC_BASE}/debian
+
#bin/nova-volume ${NOVA_VOLUME_ARGS} --nodaemonize --verbose start
cp nova-objectstore.nginx.conf /etc/nginx/sites-enabled/
+
bin/nova-volume ${NOVA_VOLUME_ARGS} --nodaemonize --iscsi_storage=true --verbose start
/etc/init.d/nginx restart
 
  
  
mkdir ${NOVA_SRC_BASE}/objects
+
#You should then be ready to proceed with register images & launching them:
cd ${NOVA_SRC_BASE}/objects
 
  
# Get a lucid (guest) image and register it as an image in our OpenStack cloud
 
 
wget -q -O - http://173.203.107.207/ubuntu-lucid.tar | tar xSv
 
wget -q -O - http://173.203.107.207/ubuntu-lucid.tar | tar xSv
 
euca-bundle-image -i vmlinuz-2.6.32-23-server --kernel true
 
euca-bundle-image -i vmlinuz-2.6.32-23-server --kernel true
 
euca-bundle-image -i initrd.img-2.6.32-23-server --ramdisk true
 
euca-bundle-image -i initrd.img-2.6.32-23-server --ramdisk true
 
euca-bundle-image -i ubuntu-lucid.img
 
euca-bundle-image -i ubuntu-lucid.img
 +
 +
# 26 July 2010 :The next commands will fail if you don't create the bucket prior to uploading
 +
#https://bugs.launchpad.net/nova/+bug/607541
  
 
euca-upload-bundle -b mybucket -m /tmp/vmlinuz-2.6.32-23-server.manifest.xml
 
euca-upload-bundle -b mybucket -m /tmp/vmlinuz-2.6.32-23-server.manifest.xml
Line 245: Line 309:
 
ramdisk=$(euca-register mybucket/initrd.img-2.6.32-23-server.manifest.xml | awk '{print $2}')
 
ramdisk=$(euca-register mybucket/initrd.img-2.6.32-23-server.manifest.xml | awk '{print $2}')
 
machine=$(euca-register mybucket/ubuntu-lucid.img.manifest.xml | awk '{print $2}')
 
machine=$(euca-register mybucket/ubuntu-lucid.img.manifest.xml | awk '{print $2}')
 
 
euca-run-instances $machine --kernel $kernel --ramdisk $ramdisk
 
euca-run-instances $machine --kernel $kernel --ramdisk $ramdisk
 +
# wait a while
 +
ssh ubuntu@192.168.1.222 
 +
# password is ubuntu
  
ssh ubuntu@10.0.0.3
+
</nowiki></pre>
 
 
 
 
=== Playing with creating Volumes
 
  
# [ Add screen, switch to it ]
+
----
cd ${NOVA_SRC_BASE}
+
[[Category:Nova]]
 
 
#ISCSI stuff (Highly experimental!!!)
 
# Based on this... http://cloudservers.rackspacecloud.com/index.php/Installing_Kernel_Headers_for_2.6.31-302-rs
 
cd ~/src
 
mkdir kernel-headers
 
cd kernel-headers
 
wget "http://kernel.slicehost.com/2.6.33.5-rscloud/patched_source/2.6.33.5-rscloud.tar.bz2"
 
tar jxf 2.6.33.5-rscloud.tar.bz2
 
cd linux-2.6.33.5
 
cp /proc/config.gz .
 
gunzip config.gz
 
mv config .config
 
make modules_prepare
 
cd /usr/src
 
#ln -s linux-headers-2.6.33.5-rscloud linux
 
ln -s ~/src/kernel-headers/linux-2.6.33.5/include linux-headers-2.6.33.5-rscloud
 
 
 
 
 
mkdir iscsi
 
cd iscsi
 
wget "http://downloads.sourceforge.net/project/iscsitarget/iscsitarget/1.4.20.2/iscsitarget-1.4.20.2.tar.gz?use_mirror=superb-sea2&ts=1279294062"
 
tar zxf iscsitarget-1.4.20.2.tar.gz
 
cd iscsitarget-1.4.20.2
 
make KSRC=~/src/kernel-headers/linux-2.6.33.5/
 
make KSRC=~/src/kernel-headers/linux-2.6.33.5/ install
 
 
 
modprobe iscsi_trgt
 
 
 
 
 
 
 
echo "ISCSITARGET_ENABLE=true" > /etc/default/iscsitarget
 
/etc/init.d/iscsitarget start
 
 
 
# We need an iSCSI initiator; the packaged version doesn't support the cloud kernel (sigh...)
 
cd ~/src
 
#wget "http://www.open-iscsi.org/bits/open-iscsi-2.0-871.tar.gz"
 
#tar zxf open-iscsi-2.0-871.tar.gz
 
#cd open-iscsi-2.0-871.tar.gz
 
 
 
mkdir open-iscsi-git
 
apt-get install git
 
#git clone git://git.kernel.org/pub/scm/linux/kernel/git/mnc/linux-2.6-iscsi.git
 
#cd linux-2.6-iscsi
 
#make KSRC=/root/src/kernel-headers/linux-2.6.33.5/
 
git clone git://git.kernel.org/pub/scm/linux/kernel/git/mnc/open-iscsi.git
 
cd open-iscsi
 
make KSRC=/root/src/kernel-headers/linux-2.6.33.5/
 
make KSRC=/root/src/kernel-headers/linux-2.6.33.5/ install
 
cp /root/src/open-iscsi-git/open-iscsi/kernel/*.ko /lib/modules/`uname -r`/kernel/drivers/scsi
 
 
 
 
 
# This creates a 10GB file to create volumes out of
 
dd if=/dev/zero of=/volumes/fake.0 bs=128M count=80
 
LOOPBACK_MOUNT=`losetup --show -f /volumes/fake.0`
 
 
 
NOVA_VOLUME_ARGS="--storage_dev=${LOOPBACK_MOUNT}"
 
#bin/nova-volume ${NOVA_VOLUME_ARGS} --nodaemonize --verbose start
 
bin/nova-volume ${NOVA_VOLUME_ARGS} --nodaemonize --iscsi_storage=true --verbose start
 
 
 
 
 
 
 
euca-create-volume --size 1 -z nova
 
 
 
euca-describe-instances
 
euca-describe-volumes
 
</nowiki></pre>
 

Latest revision as of 18:51, 25 July 2013

{{:DeprecatedPage}}

Installing Nova from Source Code

This page was written for the first Install Fest, and we'll be repeating the Install Fest at the second Design Summit, but these are outdated. Still, we'll keep them around for the next Install Fest, and feel free to update these and remove the "outdated" warning if you update.

Check out Nova install instructions for scripts and a supplied image.

If you need a Cloud Server during the install fest, visit here: http://etherpad.openstack.org/HackDay-Slices

If you're having problems this is the order of all the steps:

DO THIS AS ROOT!

#Lucid Slice

#Paste these:

echo 'deb http://ppa.launchpad.net/soren/nova/ubuntu lucid main' >> /etc/apt/sources.list.d/soren-nova.list
echo 'deb http://173.203.107.207/ubuntu ./' >> /etc/apt/sources.list.d/soren-nova.list
gpg --keyserver hkp://keys.gnupg.net --recv-keys AB0188513FD35B23
gpg -a --export AB0188513FD35B23 | apt-key add -
apt-get update
apt-get install python-mox screen nova-compute nova-api nova-objectstore redis-server rabbitmq-server euca2ools unzip parted

# Then these:

/etc/init.d/nginx restart
nova-manage user admin ant
nova-manage project create antproj ant
nova-manage project zip antproj ant
unzip nova.zip

# If running in a slice, swap kvm for qemu:

sed -i -e "s/domain type='kvm'/domain type='qemu'/" -e s'!/usr/bin/kvm!/usr/bin/qemu-system-x86_64!g' /usr/share/nova/libvirt.xml.template

# you need to be in the root of  where you unzipped nova.zip, then:
. novarc

#Run screen and paste this for the object store:
python /usr/bin/nova-objectstore --flagfile=/etc/nova/nova-objectstore.conf --nodaemonize start

#Detach and check if object store is runningrun these:

wget -q -O - http://173.203.107.207/ubuntu-lucid.tar | tar xSv
euca-bundle-image -i vmlinuz-2.6.32-23-server --kernel true
euca-bundle-image -i initrd.img-2.6.32-23-server --ramdisk true
euca-bundle-image -i ubuntu-lucid.img
euca-upload-bundle -b mybucket -m /tmp/vmlinuz-2.6.32-23-server.manifest.xml
euca-upload-bundle -b mybucket -m /tmp/initrd.img-2.6.32-23-server.manifest.xml
euca-upload-bundle -b mybucket -m /tmp/ubuntu-lucid.img.manifest.xml

#Restart the api in another screen (you may need to remove a lock file):

python /usr/bin/nova-api --flagfile=/etc/nova/nova-api.conf stop
python /usr/bin/nova-api --flagfile=/etc/nova/nova-api.conf --nodaemonize --verbose start

#Then paste this:

kernel=$(euca-register mybucket/vmlinuz-2.6.32-23-server.manifest.xml | awk '{print $2}')
ramdisk=$(euca-register mybucket/initrd.img-2.6.32-23-server.manifest.xml | awk '{print $2}')
machine=$(euca-register mybucket/ubuntu-lucid.img.manifest.xml | awk '{print $2}')
euca-run-instances $machine --kernel $kernel --ramdisk $ramdisk
# wait a while
ssh ubuntu@10.0.0.3   # password is ubuntu


Note: Those of you not named soren may want to use different user names and project names.

As we move forward more and more of the above will become unnecessary.

FYI: If you receive an error requiring redis-server 2.0.0rc1 or greater on Ubuntu/Debian you can fix it by doing the following:

Edit /etc/apt/sources.lists to include:

#Experimental
deb http://ftp.debian.org/debian experimental main


then Copy/Paste/Execute:

gpg --keyserver hkp://keys.gnupg.net --recv-key 9AA38DCD55BE302B
gpg -a --export 9AA38DCD55BE302B | sudo apt-key add -
apt-get update
apt-get -t experimental install redis-server -V


Use the verbose output to confirm the installation is 2.0.0 rc1

Note: if you get an error while trying to run the apt-get update command that references a PGP key, replace the key in the above example with the key in your error message.

Instructions for getting it to work from source on Ubuntu Lucid Lynx.

These are assuming physical hardware (for now) - getting it running on a slice seems to require a lot more custom versions of dependencies. Warning - because the nova source is fast moving, these change often!:

mkdir ~/openstack

cd ~/openstack

cat > conf <<EOF
#LAUNCHPAD_ID="your-launchpad-name"
OPENSTACK_USERNAME=`whoami`

NOVA_SRC_BASE=~/openstack/nova
#DATA=/var/lib/nova
DATA=${NOVA_SRC_BASE}/../data
KEYS_PATH=${DATA}/keys
IMAGES_PATH=${DATA}/images
BUCKETS_PATH=${DATA}/buckets
INSTANCES_PATH=${DATA}/instances
NETWORKS_PATH=${DATA}/networks
CA_DIR=${NOVA_SRC_BASE}/CA

NETWORK_ARGS="--simple_network=true --simple_network_gateway=192.168.1.1 --simple_network_netmask=255.255.255.0 --simple_network_network=192.168.1.0 --simple_network_ips=192.168.1.220,192.168.1.221,192.168.1.222 --simple_network_bridge=br0 --simple_network_broadcast=192.168.1.255"

export PYTHONPATH=${NOVA_SRC_BASE}
EOF

#src the conf file to set variables in the environment
. conf

# Some basic packages
apt-get install --yes bzr unzip screen curl

# We need a bunch of python modules
sudo apt-get --yes install python-m2crypto python-ipy python-twisted-bin python-twisted-core python-twisted-web python-carrot python-boto euca2ools python-libvirt python-daemon python-setuptools
# And RabbitMQ
sudo apt-get install --yes rabbitmq-server

# And kvm
sudo apt-get install --yes kpartx kvm
sudo modprobe kvm

# Install libvirt
sudo apt-get --yes install libvirt-bin libvirt0
sudo adduser `whoami` libvirtd

#logout and back in to add your user to the libvirtd group
#TODO: Is there a way to avoid logging out here???

cd ~/openstack
# Hopefully we don't need to log in now that the project is public
## don't you need your LP key installed first?
#bzr lp-login ${LAUNCHPAD_ID}
bzr init-repo .
bzr branch lp:nova
cd nova


# Building Redis 2.0
# Lucid version of redis is 1.2, which doesn't support HMSET
mkdir -p ~/openstack/src
cd ~/openstack/src
wget "http://redis.googlecode.com/files/redis-2.0.0-rc2.tar.gz"
tar zxf redis-2.0.0-rc2.tar.gz
cd redis-2.0.0-rc2
make
# I don't know how to install Redis, so I run it from this directory...
# ?? sudo make install

# Building pyRedis
# Lucid version of python-redis client doesn't support HMSET (?)
cd ~/openstack/src
git clone http://github.com/andymccurdy/redis-py.git
cd redis-py/
python setup.py build
sudo python setup.py install


# Building tornado (this might no longer be needed)

cd ~/openstack/src
wget "http://www.tornadoweb.org/static/tornado-0.2.tar.gz"
tar zxf tornado-0.2.tar.gz
cd tornado-0.2
python setup.py build
sudo python setup.py install

# Build gflags
cd ~/openstack/src
wget "http://google-gflags.googlecode.com/files/gflags-1.3.tar.gz"
tar zxf gflags-1.3.tar.gz
cd gflags-1.3
./configure
make
sudo make install

cd ~/openstack/src
wget "http://python-gflags.googlecode.com/files/python-gflags-1.3.tar.gz"
tar zxf python-gflags-1.3.tar.gz
cd python-gflags-1.3
python setup.py build
sudo python setup.py install

# If running in a slice, swap kvm for qemu:
#sed -i -e "s/domain type='kvm'/domain type='qemu'/" -e s'!/usr/bin/kvm!/usr/bin/qemu-system-x86_64!g' nova/compute/libvirt.xml.template

# Initialize our Certificate Authority (CA)
cd ${NOVA_SRC_BASE}
#mkdir -p ${CA_DIR}
cd ${CA_DIR}
./genrootca.sh

# Open new screen / window; start Redis 2
cd ~/openstack/src/redis-2.0.0-rc2
./redis-server

# Create first user
cd ${NOVA_SRC_BASE}
NOVA_MANAGE_ARGS="--ca_path=${CA_DIR} --credentials_template=nova/auth/novarc.template --keys_path=${KEYS_PATH} --vpn_client_template=nova/cloudpipe/client.ovpn.template"
bin/nova-manage ${NOVA_MANAGE_ARGS} user admin ${OPENSTACK_USERNAME}

# Create project
# There's a debate about whether nova-manage user admin should automatically create a project for you, with the same name as the user (bug 607527)...
OPENSTACK_PROJECTNAME=${OPENSTACK_USERNAME}
#OPENSTACK_PROJECTNAME=${OPENSTACK_USERNAME}-project1
# This might fail, depending on the progress of bug 607527.  However, even if the project is still auto-created and this command fails, this helps to make sure that the VPN is created below
bin/nova-manage ${NOVA_MANAGE_ARGS} project create ${OPENSTACK_PROJECTNAME} ${OPENSTACK_USERNAME}


# Just check that we're not FUBAR (no errors expected!!)
bin/nova-manage ${NOVA_MANAGE_ARGS} user list
bin/nova-manage ${NOVA_MANAGE_ARGS} project list
bin/nova-manage ${NOVA_MANAGE_ARGS} vpn list

# Export credentials/config bundle to "me" subdir
mkdir me
bin/nova-manage ${NOVA_MANAGE_ARGS} project zip ${OPENSTACK_PROJECTNAME} ${OPENSTACK_USERNAME} me/nova.zip
cd me/
unzip nova.zip

# Creates novarc, which contains your config
# . novarc

# Open new screen; start API daemon
sudo bash # Evil, but this does some VPN config I think
. ~/openstack/conf
cd ${NOVA_SRC_BASE}

NOVA_API_ARGS="--ca_path=${CA_DIR} --keys_path=${KEYS_PATH} --fake_users=1 ${NETWORK_ARGS}" # --datastore_path=/var/lib/nova/keeper"
echo NOVA_API_ARGS=${NOVA_API_ARGS}
bin/nova-api ${NOVA_API_ARGS} --nodaemonize --verbose start

# Open new screen; start ObjectStore daemon
. ~/openstack/conf
cd ${NOVA_SRC_BASE}

mkdir -p ${BUCKETS_PATH}
mkdir -p ${IMAGES_PATH}
NOVA_OBJECTSTORE_ARGS="--ca_path=${CA_DIR} --keys_path=${KEYS_PATH} --fake_users=1  ${NETWORK_ARGS} --images_path=${IMAGES_PATH} --buckets_path=${BUCKETS_PATH}" # --datastore_path=/var/lib/nova/keeper"
# This hack is because otherwise the compute deamon also writes to twistd.log
mkdir -p objectstorelogs
cd objectstorelogs
../bin/nova-objectstore ${NOVA_OBJECTSTORE_ARGS} --nodaemon --verbose start

# Open new screen; start up compute daemon
sudo bash # Evil, but this does some disk mounting stuff
. ~/openstack/conf
cd ${NOVA_SRC_BASE}

mkdir -p ${INSTANCES_PATH}
mkdir -p ${NETWORKS_PATH}
NOVA_COMPUTE_ARGS="--ca_path=${CA_DIR} --keys_path=${KEYS_PATH} --fake_users=1 ${NETWORK_ARGS} --images_path=${IMAGES_PATH} --use_s3=false --instances_path=${INSTANCES_PATH} --networks_path=${NETWORKS_PATH} --libvirt_xml_template=nova/compute/libvirt.xml.template --vpn_client_template=nova/cloudpipe/client.ovpn.template --credentials_template=/nova/auth/novarc.template"
# --datastore_path=/var/lib/nova/keeper"
bin/nova-compute ${NOVA_COMPUTE_ARGS} --nodaemon --verbose start

# Open new screen; start up volume daemon (if you're going to use volumes)
sudo bash # Evil, but this does some LVM stuff etc

# This creates a 10GB file to create volumes out of
mkdir -p /volumes
dd if=/dev/zero of=/volumes/fake.0 bs=128M count=80
LOOPBACK_MOUNT=`sudo losetup --show --find /volumes/fake.0`
echo LOOPBACK_MOUNT=${LOOPBACK_MOUNT}

. ~/openstack/conf
cd ${NOVA_SRC_BASE}

NOVA_VOLUME_ARGS="--storage_dev=${LOOPBACK_MOUNT}"

#are you running from iSCSI? if not, comment out 2nd line and run first line:
#bin/nova-volume ${NOVA_VOLUME_ARGS} --nodaemonize --verbose start
bin/nova-volume ${NOVA_VOLUME_ARGS} --nodaemonize --iscsi_storage=true --verbose start


#You should then be ready to proceed with register images & launching them:

wget -q -O - http://173.203.107.207/ubuntu-lucid.tar | tar xSv
euca-bundle-image -i vmlinuz-2.6.32-23-server --kernel true
euca-bundle-image -i initrd.img-2.6.32-23-server --ramdisk true
euca-bundle-image -i ubuntu-lucid.img

# 26 July 2010 :The next commands will fail if you don't create the bucket prior to uploading
#https://bugs.launchpad.net/nova/+bug/607541

euca-upload-bundle -b mybucket -m /tmp/vmlinuz-2.6.32-23-server.manifest.xml
euca-upload-bundle -b mybucket -m /tmp/initrd.img-2.6.32-23-server.manifest.xml
euca-upload-bundle -b mybucket -m /tmp/ubuntu-lucid.img.manifest.xml

kernel=$(euca-register mybucket/vmlinuz-2.6.32-23-server.manifest.xml | awk '{print $2}')
ramdisk=$(euca-register mybucket/initrd.img-2.6.32-23-server.manifest.xml | awk '{print $2}')
machine=$(euca-register mybucket/ubuntu-lucid.img.manifest.xml | awk '{print $2}')
euca-run-instances $machine --kernel $kernel --ramdisk $ramdisk
# wait a while
ssh ubuntu@192.168.1.222   
# password is ubuntu