Browse code

Improve devstack docs for Xenserver

Minor fixes to scripts

Fixes bug 943508

Change-Id: Iaf12b9d67efa78623e8253599010f60192b4af64

Renuka Apte authored on 2012/03/01 09:09:26
Showing 5 changed files
... ...
@@ -12,6 +12,10 @@ Read more at http://devstack.org (built from the gh-pages branch)
12 12
 
13 13
 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.
14 14
 
15
+# Devstack on Xenserver
16
+
17
+If you would like to use Xenserver as the hypervisor, please refer to the instructions in ./tools/xen/README.md.
18
+
15 19
 # Versions
16 20
 
17 21
 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:
... ...
@@ -4,12 +4,19 @@ The purpose of the code in this directory it to help developers bootstrap
4 4
 a XenServer 5.6 + Openstack development environment.  This file gives
5 5
 some pointers on how to get started.
6 6
 
7
+Xenserver is a Type 1 hypervisor, so it needs to be installed on bare metal.
8
+The Openstack services are configured to run within a "privileged" virtual
9
+machine on the Xenserver host (called OS domU). The VM uses the XAPI toolstack
10
+to communicate with the host.
11
+
7 12
 Step 1: Install Xenserver
8 13
 ------------------------
9
-Install XenServer 5.6 on a clean box. You can get XenServer by signing
14
+Install XenServer 5.6+ on a clean box. You can get XenServer by signing
10 15
 up for an account on citrix.com, and then visiting:
11 16
 https://www.citrix.com/English/ss/downloads/details.asp?downloadId=2311504&productId=683148
12 17
 
18
+For details on installation, see: http://wiki.openstack.org/XenServer/Install
19
+
13 20
 Here are some sample Xenserver network settings for when you are just
14 21
 getting started (I use settings like this with a lappy + cheap wifi router):
15 22
 
... ...
@@ -18,16 +25,25 @@ getting started (I use settings like this with a lappy + cheap wifi router):
18 18
 * XenServer Gateway: 192.168.1.1
19 19
 * XenServer DNS: 192.168.1.1
20 20
 
21
+Note:
22
+------
23
+It is advisable (and necessary if you are using Xenserver 6.0, due to space
24
+limitations), to create the above mentioned OS domU, on a separate dev machine.
25
+To do this, you will need to run Steps 2 on the dev machine (if required) as
26
+well as the Xenserver host. Steps 3 and 4 should be run on the dev machine.
27
+This process requires you to be root on the dev machine.
28
+
21 29
 Step 2: Prepare DOM0
22 30
 -------------------
23
-At this point, your server is missing some critical software that you will
31
+At this point, your host is missing some critical software that you will
24 32
 need to run devstack (like git).  Do this to install required software:
25 33
 
26
-    wget --no-check-certificate https://github.com/cloudbuilders/devstack/raw/xen/tools/xen/prepare_dom0.sh
34
+    wget --no-check-certificate https://raw.github.com/openstack-dev/devstack/master/tools/xen/prepare_dom0.sh
27 35
     chmod 755 prepare_dom0.sh
28 36
     ./prepare_dom0.sh
29 37
 
30
-This script will also clone devstack in /root/devstack
38
+This step will also clone devstack in $DEVSTACKSRCROOT/devstack.
39
+$DEVSTACKSRCROOT=/root by default.
31 40
 
32 41
 Step 3: Configure your localrc
33 42
 -----------------------------
... ...
@@ -35,7 +51,7 @@ Devstack uses a localrc for user-specific configuration.  Note that
35 35
 the XENAPI_PASSWORD must be your dom0 root password.
36 36
 Of course, use real passwords if this machine is exposed.
37 37
 
38
-    cat > /root/devstack/localrc <<EOF
38
+    cat > $DEVSTACKSRCROOT/devstack/localrc <<EOF
39 39
     MYSQL_PASSWORD=my_super_secret
40 40
     SERVICE_TOKEN=my_super_secret
41 41
     ADMIN_PASSWORD=my_super_secret
... ...
@@ -52,16 +68,20 @@ Of course, use real passwords if this machine is exposed.
52 52
     MULTI_HOST=1
53 53
     # Give extra time for boot
54 54
     ACTIVE_TIMEOUT=45
55
+    # Interface on which you would like to access services
56
+    HOST_IP_IFACE=ethX
55 57
     EOF
56 58
 
57 59
 Step 4: Run ./build_xva.sh
58 60
 --------------------------
59
-This script prpares your nova xva image.  This script can be run on a separate machine
60
-and copied to dom0.  If you run this on a different machine, copy the resulting xva
61
-file to tools/xen/xvas/[GUEST_NAME].xva (by default tools/xen/xvas/ALLINONE.xva)
61
+This script prepares your nova xva image. If you run this on a different machine,
62
+copy the resulting xva file to tools/xen/xvas/[GUEST_NAME].xva
63
+(by default tools/xen/xvas/ALLINONE.xva) on the Xenserver host.
62 64
 
63
-It is likely that for XS6 you will need to build_xva.sh on a separate machine due
64
-to dom0 space constraints.
65
+cd $DEVSTACKSRCROOT/devstack/tools/xen
66
+./build_xva.sh
67
+
68
+You will also need to copy your localrc to the Xenserver host.
65 69
 
66 70
 Step 5: Run ./build_domU.sh
67 71
 --------------------------
... ...
@@ -72,6 +92,9 @@ But in a nutshell, it performs the following:
72 72
 * Creates and installs a OpenStack all-in-one domU in an HA-FlatDHCP configuration
73 73
 * A script to create a multi-domU (ie. head node separated from compute) configuration is coming soon!
74 74
 
75
+cd $DEVSTACKSRCROOT/devstack/tools/xen
76
+./build_domU.sh
77
+
75 78
 Step 6: Do cloudy stuff!
76 79
 --------------------------
77 80
 * Play with horizon
... ...
@@ -184,6 +184,10 @@ if [ -z $PUB_BR ]; then
184 184
 fi
185 185
 $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}"
186 186
 
187
+if [ $PUB_IP == "dhcp" ]; then
188
+    PUB_IP=$(xe vm-list --minimal name-label=$GUEST_NAME params=networks |  sed -ne 's,^.*3/ip: \([0-9.]*\).*$,\1,p')
189
+fi
190
+
187 191
 # If we have copied our ssh credentials, use ssh to monitor while the installation runs
188 192
 WAIT_TILL_LAUNCH=${WAIT_TILL_LAUNCH:-1}
189 193
 if [ "$WAIT_TILL_LAUNCH" = "1" ]  && [ -e ~/.ssh/id_rsa.pub  ] && [ "$COPYENV" = "1" ]; then
... ...
@@ -187,4 +187,5 @@ if [ ! -e $XVA ]; then
187 187
     UID=0 $SCRIPT_DIR/mkxva -o $XVA -t xva -x $OVA $STAGING_DIR $VDI_MB /tmp/
188 188
 fi
189 189
 
190
-echo "Built $XVA.  If your dom0 is on a different machine, copy this to [devstackdir]/tools/xen/$XVA"
190
+echo "Built $(basename $XVA).  If your dom0 is on a different machine, copy this to [devstackdir]/tools/xen/$(basename $XVA)"
191
+echo "Also copy your localrc to [devstackdir]"
... ...
@@ -34,3 +34,8 @@ if ! which git; then
34 34
     make install
35 35
 fi
36 36
 
37
+# Clone devstack
38
+DEVSTACK=${DEVSTACKROOT:/root/devstack}
39
+if [ ! -d $DEVSTACK ]; then
40
+    git clone git://github.com/openstack-dev/devstack.git $DEVSTACK
41
+fi