Skip to content

Commit

Permalink
Improve devstack docs for Xenserver
Browse files Browse the repository at this point in the history
Minor fixes to scripts

Fixes bug 943508

Change-Id: Iaf12b9d67efa78623e8253599010f60192b4af64
  • Loading branch information
Renuka Apte committed Mar 8, 2012
1 parent 165121f commit c56885a
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 11 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ Read more at http://devstack.org (built from the gh-pages branch)

IMPORTANT: Be sure to carefully read stack.sh and any other scripts you execute before you run them, as they install software and may alter your networking configuration. We strongly recommend that you run stack.sh in a clean and disposable vm when you are first getting started.

# Devstack on Xenserver

If you would like to use Xenserver as the hypervisor, please refer to the instructions in ./tools/xen/README.md.

# Versions

The devstack master branch generally points to trunk versions of OpenStack components. For older, stable versions, look for branches named stable/[release]. For example, you can do the following to create a diablo OpenStack cloud:
Expand Down
43 changes: 33 additions & 10 deletions tools/xen/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,19 @@ The purpose of the code in this directory it to help developers bootstrap
a XenServer 5.6 + Openstack development environment. This file gives
some pointers on how to get started.

Xenserver is a Type 1 hypervisor, so it needs to be installed on bare metal.
The Openstack services are configured to run within a "privileged" virtual
machine on the Xenserver host (called OS domU). The VM uses the XAPI toolstack
to communicate with the host.

Step 1: Install Xenserver
------------------------
Install XenServer 5.6 on a clean box. You can get XenServer by signing
Install XenServer 5.6+ on a clean box. You can get XenServer by signing
up for an account on citrix.com, and then visiting:
https://www.citrix.com/English/ss/downloads/details.asp?downloadId=2311504&productId=683148

For details on installation, see: http://wiki.openstack.org/XenServer/Install

Here are some sample Xenserver network settings for when you are just
getting started (I use settings like this with a lappy + cheap wifi router):

Expand All @@ -18,24 +25,33 @@ getting started (I use settings like this with a lappy + cheap wifi router):
* XenServer Gateway: 192.168.1.1
* XenServer DNS: 192.168.1.1

Note:
------
It is advisable (and necessary if you are using Xenserver 6.0, due to space
limitations), to create the above mentioned OS domU, on a separate dev machine.
To do this, you will need to run Steps 2 on the dev machine (if required) as
well as the Xenserver host. Steps 3 and 4 should be run on the dev machine.
This process requires you to be root on the dev machine.

Step 2: Prepare DOM0
-------------------
At this point, your server is missing some critical software that you will
At this point, your host is missing some critical software that you will
need to run devstack (like git). Do this to install required software:

wget --no-check-certificate https://github.com/cloudbuilders/devstack/raw/xen/tools/xen/prepare_dom0.sh
wget --no-check-certificate https://raw.github.com/openstack-dev/devstack/master/tools/xen/prepare_dom0.sh
chmod 755 prepare_dom0.sh
./prepare_dom0.sh

This script will also clone devstack in /root/devstack
This step will also clone devstack in $DEVSTACKSRCROOT/devstack.
$DEVSTACKSRCROOT=/root by default.

Step 3: Configure your localrc
-----------------------------
Devstack uses a localrc for user-specific configuration. Note that
the XENAPI_PASSWORD must be your dom0 root password.
Of course, use real passwords if this machine is exposed.

cat > /root/devstack/localrc <<EOF
cat > $DEVSTACKSRCROOT/devstack/localrc <<EOF
MYSQL_PASSWORD=my_super_secret
SERVICE_TOKEN=my_super_secret
ADMIN_PASSWORD=my_super_secret
Expand All @@ -52,16 +68,20 @@ Of course, use real passwords if this machine is exposed.
MULTI_HOST=1
# Give extra time for boot
ACTIVE_TIMEOUT=45
# Interface on which you would like to access services
HOST_IP_IFACE=ethX
EOF

Step 4: Run ./build_xva.sh
--------------------------
This script prpares your nova xva image. This script can be run on a separate machine
and copied to dom0. If you run this on a different machine, copy the resulting xva
file to tools/xen/xvas/[GUEST_NAME].xva (by default tools/xen/xvas/ALLINONE.xva)
This script prepares your nova xva image. If you run this on a different machine,
copy the resulting xva file to tools/xen/xvas/[GUEST_NAME].xva
(by default tools/xen/xvas/ALLINONE.xva) on the Xenserver host.

It is likely that for XS6 you will need to build_xva.sh on a separate machine due
to dom0 space constraints.
cd $DEVSTACKSRCROOT/devstack/tools/xen
./build_xva.sh

You will also need to copy your localrc to the Xenserver host.

Step 5: Run ./build_domU.sh
--------------------------
Expand All @@ -72,6 +92,9 @@ But in a nutshell, it performs the following:
* Creates and installs a OpenStack all-in-one domU in an HA-FlatDHCP configuration
* A script to create a multi-domU (ie. head node separated from compute) configuration is coming soon!

cd $DEVSTACKSRCROOT/devstack/tools/xen
./build_domU.sh

Step 6: Do cloudy stuff!
--------------------------
* Play with horizon
Expand Down
4 changes: 4 additions & 0 deletions tools/xen/build_domU.sh
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,10 @@ if [ -z $PUB_BR ]; then
fi
$TOP_DIR/scripts/install-os-vpx.sh -f $XVA -v $VM_BR -m $MGT_BR -p $PUB_BR -l $GUEST_NAME -w -k "flat_network_bridge=${VM_BR}"

if [ $PUB_IP == "dhcp" ]; then
PUB_IP=$(xe vm-list --minimal name-label=$GUEST_NAME params=networks | sed -ne 's,^.*3/ip: \([0-9.]*\).*$,\1,p')
fi

# If we have copied our ssh credentials, use ssh to monitor while the installation runs
WAIT_TILL_LAUNCH=${WAIT_TILL_LAUNCH:-1}
if [ "$WAIT_TILL_LAUNCH" = "1" ] && [ -e ~/.ssh/id_rsa.pub ] && [ "$COPYENV" = "1" ]; then
Expand Down
3 changes: 2 additions & 1 deletion tools/xen/build_xva.sh
Original file line number Diff line number Diff line change
Expand Up @@ -187,4 +187,5 @@ if [ ! -e $XVA ]; then
UID=0 $SCRIPT_DIR/mkxva -o $XVA -t xva -x $OVA $STAGING_DIR $VDI_MB /tmp/
fi

echo "Built $XVA. If your dom0 is on a different machine, copy this to [devstackdir]/tools/xen/$XVA"
echo "Built $(basename $XVA). If your dom0 is on a different machine, copy this to [devstackdir]/tools/xen/$(basename $XVA)"
echo "Also copy your localrc to [devstackdir]"
5 changes: 5 additions & 0 deletions tools/xen/prepare_dom0.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,8 @@ if ! which git; then
make install
fi

# Clone devstack
DEVSTACK=${DEVSTACKROOT:/root/devstack}
if [ ! -d $DEVSTACK ]; then
git clone git://github.com/openstack-dev/devstack.git $DEVSTACK
fi

0 comments on commit c56885a

Please sign in to comment.