| ... | ... |
@@ -4,8 +4,8 @@ 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 |
-Install Xenserver |
|
| 7 |
+Step 1: Install Xenserver |
|
| 8 |
+------------------------ |
|
| 8 | 9 |
Install XenServer 5.6 on a clean box. |
| 9 | 10 |
Here are some sample Xenserver network settings for when you are just |
| 10 | 11 |
getting started (I used settings like this using a lappy + cheap wifi router): |
| ... | ... |
@@ -15,20 +15,22 @@ getting started (I used settings like this using a lappy + cheap wifi router): |
| 15 | 15 |
* XenServer Gateway: 192.168.1.1 |
| 16 | 16 |
* XenServer DNS: 192.168.1.1 |
| 17 | 17 |
|
| 18 |
-Prepare DOM0 |
|
| 18 |
+Step 2: Prepare DOM0 |
|
| 19 |
+------------------- |
|
| 19 | 20 |
At this point, your server is missing some critical software that you will |
| 20 | 21 |
need to run devstack (like git). Do this to install required software: |
| 21 | 22 |
|
| 23 |
+ wget https://github.com/cloudbuilders/devstack/raw/xen/tools/xen/prepare_dom0.sh |
|
| 24 |
+ chmod 755 prepare_dom0.sh |
|
| 22 | 25 |
./prepare_dom0.sh |
| 23 | 26 |
|
| 24 | 27 |
This script will also clone devstack in /root/devstack |
| 25 | 28 |
|
| 26 |
-Configure your localrc |
|
| 27 |
-Devstack uses a localrc for user-specific configuration. Note that while |
|
| 28 |
-the first 4 passwords are arbitrary, the XENAPI_PASSWORD must be your dom0 |
|
| 29 |
-root password. And of course, use a real password if this machine is exposed. |
|
| 29 |
+Step 3: Configure your localrc |
|
| 30 |
+----------------------------- |
|
| 31 |
+Devstack uses a localrc for user-specific configuration. Note that |
|
| 32 |
+the XENAPI_PASSWORD must be your dom0 root password. |
|
| 33 |
+Of course, use real passwords if this machine is exposed. |
|
| 30 | 34 |
|
| 31 | 35 |
cd /root/devstack |
| 32 | 36 |
|
| ... | ... |
@@ -37,15 +39,25 @@ root password. And of course, use a real password if this machine is exposed. |
| 37 | 37 |
SERVICE_TOKEN=my_super_secret |
| 38 | 38 |
ADMIN_PASSWORD=my_super_secret |
| 39 | 39 |
RABBIT_PASSWORD=my_super_secret |
| 40 |
+ # This is the password for your guest (for both stack and root users) |
|
| 41 |
+ GUEST_PASSWORD=my_super_secret |
|
| 40 | 42 |
# IMPORTANT: The following must be set to your dom0 root password! |
| 41 | 43 |
XENAPI_PASSWORD=my_super_secret |
| 44 |
+ # Do not download the usual images yet! |
|
| 45 |
+ IMAGE_URLS="" |
|
| 42 | 46 |
EOF |
| 43 | 47 |
|
| 44 |
-Run ./build_domU.sh |
|
| 48 |
+Step 4: Run ./build_domU.sh |
|
| 49 |
+-------------------------- |
|
| 45 | 50 |
This script does a lot of stuff, it is probably best to read it in its entirety. |
| 46 | 51 |
But in a nutshell, it performs the following: |
| 47 | 52 |
|
| 48 | 53 |
* Configures bridges and vlans for public, private, and management nets |
| 49 | 54 |
* Creates and installs a OpenStack all-in-one domU in an HA-FlatDHCP configuration |
| 50 |
-** A script to create a multi-domU (ie. head node separated from compute) configuration is coming soon! |
|
| 55 |
+* A script to create a multi-domU (ie. head node separated from compute) configuration is coming soon! |
|
| 56 |
+ |
|
| 57 |
+Step 5: Do cloudy stuff! |
|
| 58 |
+-------------------------- |
|
| 59 |
+* Play with dashboard |
|
| 60 |
+* Play with the CLI |
|
| 61 |
+* Log bugs to devstack and core projects, and submit fixes! |
| ... | ... |
@@ -143,6 +143,7 @@ fi |
| 143 | 143 |
|
| 144 | 144 |
# Directory where our conf files are stored |
| 145 | 145 |
FILES_DIR=$TOP_DIR/files |
| 146 |
+TEMPLATES_DIR=$TOP_DIR/templates |
|
| 146 | 147 |
|
| 147 | 148 |
# Directory for supporting script files |
| 148 | 149 |
SCRIPT_DIR=$TOP_DIR/scripts |
| ... | ... |
@@ -154,7 +155,7 @@ KERNEL_VERSION=`ls $STAGING_DIR/boot/vmlinuz* | head -1 | sed "s/.*vmlinuz-//"` |
| 154 | 154 |
# Setup fake grub |
| 155 | 155 |
rm -rf $STAGING_DIR/boot/grub/ |
| 156 | 156 |
mkdir -p $STAGING_DIR/boot/grub/ |
| 157 |
-cp $FILES_DIR/menu.lst.in $STAGING_DIR/boot/grub/menu.lst |
|
| 157 |
+cp $TEMPLATES_DIR/menu.lst.in $STAGING_DIR/boot/grub/menu.lst |
|
| 158 | 158 |
sed -e "s,@KERNEL_VERSION@,$KERNEL_VERSION,g" -i $STAGING_DIR/boot/grub/menu.lst |
| 159 | 159 |
|
| 160 | 160 |
# Setup fstab, tty, and other system stuff |
| ... | ... |
@@ -197,7 +198,7 @@ PRODUCT_VERSION=${PRODUCT_VERSION:-001}
|
| 197 | 197 |
BUILD_NUMBER=${BUILD_NUMBER:-001}
|
| 198 | 198 |
LABEL="$PRODUCT_BRAND $PRODUCT_VERSION-$BUILD_NUMBER" |
| 199 | 199 |
OVA=$STAGING_DIR/tmp/ova.xml |
| 200 |
-cp templates/ova.xml.in $OVA |
|
| 200 |
+cp $TEMPLATES_DIR/ova.xml.in $OVA |
|
| 201 | 201 |
sed -e "s,@VDI_SIZE@,$VDI_SIZE,g" -i $OVA |
| 202 | 202 |
sed -e "s,@PRODUCT_BRAND@,$PRODUCT_BRAND,g" -i $OVA |
| 203 | 203 |
sed -e "s,@PRODUCT_VERSION@,$PRODUCT_VERSION,g" -i $OVA |
| ... | ... |
@@ -222,8 +223,7 @@ fi |
| 222 | 222 |
|
| 223 | 223 |
# Run devstack on launch |
| 224 | 224 |
cat <<EOF >$STAGING_DIR/etc/rc.local |
| 225 |
-STAGING_DIR=/ DO_TGZ=0 bash /opt/stack/devstack/tools/xen/prepare_guest.sh |
|
| 226 |
-STAGING_DIR=/ DO_TGZ=0 bash /opt/stack/devstack/tools/xen/prepare_guest.sh |
|
| 225 |
+GUEST_PASSWORD=$GUEST_PASSWORD $STAGING_DIR=/ DO_TGZ=0 bash /opt/stack/devstack/tools/xen/prepare_guest.sh |
|
| 227 | 226 |
su -c "/opt/stack/run.sh > /opt/stack/run.sh.log" stack |
| 228 | 227 |
exit 0 |
| 229 | 228 |
EOF |
| ... | ... |
@@ -262,7 +262,7 @@ rm -f $XVA |
| 262 | 262 |
# Configure the network |
| 263 | 263 |
set_hostname $GUEST_NAME |
| 264 | 264 |
INTERFACES=$STAGING_DIR/etc/network/interfaces |
| 265 |
-cp templates/interfaces.in $INTERFACES |
|
| 265 |
+cp $TEMPLATES_DIR/interfaces.in $INTERFACES |
|
| 266 | 266 |
sed -e "s,@ETH1_NETMASK@,$VM_NETMASK,g" -i $INTERFACES |
| 267 | 267 |
sed -e "s,@ETH2_IP@,$MGT_IP,g" -i $INTERFACES |
| 268 | 268 |
sed -e "s,@ETH2_NETMASK@,$MGT_NETMASK,g" -i $INTERFACES |
| ... | ... |
@@ -286,3 +286,15 @@ fi |
| 286 | 286 |
|
| 287 | 287 |
# Start guest |
| 288 | 288 |
$TOP_DIR/scripts/install-os-vpx.sh -f $XVA -v $VM_BR -m $MGT_BR -p $PUB_BR |
| 289 |
+ |
|
| 290 |
+echo "################################################################################" |
|
| 291 |
+echo "" |
|
| 292 |
+echo "All Finished!" |
|
| 293 |
+echo "Now, you can monitor the progress of the stack.sh installation by " |
|
| 294 |
+echo "tailing /opt/stack/run.sh.log from within your domU." |
|
| 295 |
+echo "" |
|
| 296 |
+echo "ssh into your domU now: 'ssh stack@$PUB_IP' using your password" |
|
| 297 |
+echo "and then do: 'tail -f /opt/stack/run.sh.log'" |
|
| 298 |
+echo "" |
|
| 299 |
+echo "When the script completes, you can then visit the OpenStack Dashboard" |
|
| 300 |
+echo "at http://$PUB_IP, and contact other services at the usual ports." |
| ... | ... |
@@ -1,7 +1,7 @@ |
| 1 | 1 |
#!/bin/bash |
| 2 | 2 |
|
| 3 | 3 |
# Configurable nuggets |
| 4 |
-PASSWORD=${PASSWORD:-secrete}
|
|
| 4 |
+GUEST_PASSWORD=${GUEST_PASSWORD:-secrete}
|
|
| 5 | 5 |
STAGING_DIR=${STAGING_DIR:-stage}
|
| 6 | 6 |
DO_TGZ=${DO_TGZ:-1}
|
| 7 | 7 |
KERNEL_VERSION=3.0.0-12-virtual |
| ... | ... |
@@ -46,7 +46,7 @@ echo a | chroot $STAGING_DIR cracklib-packer |
| 46 | 46 |
|
| 47 | 47 |
# Make /etc/shadow, and set the root password |
| 48 | 48 |
chroot $STAGING_DIR "pwconv" |
| 49 |
-echo "root:$PASSWORD" | chroot $STAGING_DIR chpasswd |
|
| 49 |
+echo "root:$GUEST_PASSWORD" | chroot $STAGING_DIR chpasswd |
|
| 50 | 50 |
|
| 51 | 51 |
# Put the VPX into UTC. |
| 52 | 52 |
rm -f $STAGING_DIR/etc/localtime |
| ... | ... |
@@ -54,7 +54,7 @@ rm -f $STAGING_DIR/etc/localtime |
| 54 | 54 |
# Add stack user |
| 55 | 55 |
chroot $STAGING_DIR groupadd libvirtd |
| 56 | 56 |
chroot $STAGING_DIR useradd stack -s /bin/bash -d /opt/stack -G libvirtd |
| 57 |
-echo stack:$PASSWORD | chroot $STAGING_DIR chpasswd |
|
| 57 |
+echo stack:$GUEST_PASSWORD | chroot $STAGING_DIR chpasswd |
|
| 58 | 58 |
echo "stack ALL=(ALL) NOPASSWD: ALL" >> $STAGING_DIR/etc/sudoers |
| 59 | 59 |
|
| 60 | 60 |
# Give ownership of /opt/stack to stack user |