From 40478d870d3883df3b4a21cc4a881f3c731bb9a6 Mon Sep 17 00:00:00 2001 From: Robert Carr Date: Wed, 12 Oct 2011 08:02:21 -0700 Subject: [PATCH 01/10] Fixed: now checked and works --- lxc_network_hostonlyplusnat.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lxc_network_hostonlyplusnat.sh b/lxc_network_hostonlyplusnat.sh index 4e29ed70..91aeaefb 100755 --- a/lxc_network_hostonlyplusnat.sh +++ b/lxc_network_hostonlyplusnat.sh @@ -31,7 +31,7 @@ for arg in "$@"; do process_option $arg done -if [ $dry_run ]; then +if [ "$dry_run" -eq "1" ]; then DRIER=echo fi From 8f86bb04896ff64c14f9ce5f1329cb3a57b3bd90 Mon Sep 17 00:00:00 2001 From: Robert Carr Date: Wed, 12 Oct 2011 16:22:40 +0000 Subject: [PATCH 02/10] Change permissions on /dev/pts/0 to fix screen creation error --- stack.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/stack.sh b/stack.sh index f6bf534e..96223c7f 100755 --- a/stack.sh +++ b/stack.sh @@ -545,6 +545,10 @@ function screen_it { fi } +# Fix issue with permissions on /dev/pts/0 for normal user +# Otherwise, screen call fails. +sudo chmod o=r+w /dev/pts/0 + # create a new named screen to run processes in screen -d -m -S nova -t nova sleep 1 From b85458488e261486cb74e3e29dd1c781ef514eb2 Mon Sep 17 00:00:00 2001 From: Robert Carr Date: Thu, 20 Oct 2011 04:05:24 +0000 Subject: [PATCH 03/10] EC2: Added HOST_PUBLIC_IP to expose endpointTemplate public IP --- stack.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/stack.sh b/stack.sh index 96223c7f..ffc556f6 100755 --- a/stack.sh +++ b/stack.sh @@ -522,6 +522,7 @@ if [[ "$ENABLED_SERVICES" =~ "key" ]]; then KEYSTONE_DATA=$KEYSTONE_DIR/bin/keystone_data.sh cp $FILES/keystone_data.sh $KEYSTONE_DATA sudo sed -e "s,%HOST_IP%,$HOST_IP,g" -i $KEYSTONE_DATA + sudo sed -e "s,%HOST_PUBLIC_IP%,$HOST_PUBLIC_IP,g" -i $KEYSTONE_DATA sudo sed -e "s,%SERVICE_TOKEN%,$SERVICE_TOKEN,g" -i $KEYSTONE_DATA sudo sed -e "s,%ADMIN_PASSWORD%,$ADMIN_PASSWORD,g" -i $KEYSTONE_DATA # initialize keystone with default users/endpoints From 5501fd271cff18b2aa67dd0867397660097ca9d4 Mon Sep 17 00:00:00 2001 From: Robert Carr Date: Thu, 20 Oct 2011 04:11:17 +0000 Subject: [PATCH 04/10] EC2: Added HOST_PUBLIC_IP to keystone_data.sh --- files/keystone_data.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/files/keystone_data.sh b/files/keystone_data.sh index f48eaf9f..ec8b9d4a 100755 --- a/files/keystone_data.sh +++ b/files/keystone_data.sh @@ -28,9 +28,9 @@ $BIN_DIR/keystone-manage $* service add glance image "Glance Image Service" $BIN_DIR/keystone-manage $* service add keystone identity "Keystone Identity Service" #endpointTemplates -$BIN_DIR/keystone-manage $* endpointTemplates add RegionOne nova http://%HOST_IP%:8774/v1.1/%tenant_id% http://%HOST_IP%:8774/v1.1/%tenant_id% http://%HOST_IP%:8774/v1.1/%tenant_id% 1 1 +$BIN_DIR/keystone-manage $* endpointTemplates add RegionOne nova http://%HOST_PUBLIC_IP%:8774/v1.1/%tenant_id% http://%HOST_IP%:8774/v1.1/%tenant_id% http://%HOST_IP%:8774/v1.1/%tenant_id% 1 1 $BIN_DIR/keystone-manage $* endpointTemplates add RegionOne glance http://%HOST_IP%:9292/v1.1/%tenant_id% http://%HOST_IP%:9292/v1.1/%tenant_id% http://%HOST_IP%:9292/v1.1/%tenant_id% 1 1 -$BIN_DIR/keystone-manage $* endpointTemplates add RegionOne keystone http://%HOST_IP%:5000/v2.0 http://%HOST_IP%:35357/v2.0 http://%HOST_IP%:5000/v2.0 1 1 +$BIN_DIR/keystone-manage $* endpointTemplates add RegionOne keystone http://%HOST_PUBLIC_IP%:5000/v2.0 http://%HOST_IP%:35357/v2.0 http://%HOST_IP%:5000/v2.0 1 1 # $BIN_DIR/keystone-manage $* endpointTemplates add RegionOne swift http://%HOST_IP%:8080/v1/AUTH_%tenant_id% http://%HOST_IP%:8080/ http://%HOST_IP%:8080/v1/AUTH_%tenant_id% 1 1 # Tokens From 093c64a64b847572e4164273e006e930ae8e8010 Mon Sep 17 00:00:00 2001 From: Robert Carr Date: Thu, 20 Oct 2011 04:17:17 +0000 Subject: [PATCH 05/10] EC2: Removed user input from scripts so they run unattended --- build_lxc.sh | 18 ++---------------- lxc_network_hostonlyplusnat.sh | 18 ------------------ 2 files changed, 2 insertions(+), 34 deletions(-) diff --git a/build_lxc.sh b/build_lxc.sh index 643da7e4..48c952e9 100755 --- a/build_lxc.sh +++ b/build_lxc.sh @@ -233,19 +233,5 @@ fi # Start our container lxc-start -d -n $CONTAINER -# Done creating the container, let's tail the log -echo -echo "=============================================================" -echo " -- YAY! --" -echo "=============================================================" -echo -echo "We're done creating the container, about to start tailing the" -echo "stack.sh log. It will take a second or two to start." -echo -echo "Just CTRL-C at any time to stop tailing." - -while [ ! -e "$ROOTFS/$DEST/run.sh.log" ]; do - sleep 1 -done - -tail -F $ROOTFS/$DEST/run.sh.log +echo "Installation complete...." + diff --git a/lxc_network_hostonlyplusnat.sh b/lxc_network_hostonlyplusnat.sh index 91aeaefb..a6ecb1fd 100755 --- a/lxc_network_hostonlyplusnat.sh +++ b/lxc_network_hostonlyplusnat.sh @@ -48,19 +48,6 @@ if [ ! -x "$BRCTL" ]; then exit 1 fi -# Scare off the nubs. -echo "=====================================================" -echo -echo "WARNING" -echo -echo "This script will modify your current network setup," -echo "this can be a scary thing and it is recommended that" -echo "you have something equivalent to physical access to" -echo "this machine before continuing in case your network" -echo "gets all funky." -echo -echo "If you don't want to continue, hit CTRL-C now." - if [ -z "$host_ip" ]; then echo "Otherwise, please type in your host's ip address and" @@ -68,11 +55,6 @@ then echo echo "=====================================================" read host_ip -else - echo "Otherwise hit enter." - echo - echo "=====================================================" - read accept fi From 5a50a6466542d2d36b264bfb173d451337109e8c Mon Sep 17 00:00:00 2001 From: Robert Carr Date: Thu, 20 Oct 2011 16:13:18 +0000 Subject: [PATCH 06/10] EC2: Added volume start --- stack.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/stack.sh b/stack.sh index ffc556f6..4a69f5e0 100755 --- a/stack.sh +++ b/stack.sh @@ -130,7 +130,7 @@ OPENSTACKX_DIR=$DEST/openstackx NOVNC_DIR=$DEST/noVNC # Specify which services to launch. These generally correspond to screen tabs -ENABLED_SERVICES=${ENABLED_SERVICES:-g-api,g-reg,key,n-api,n-cpu,n-net,n-sch,n-vnc,dash,mysql,rabbit} +ENABLED_SERVICES=${ENABLED_SERVICES:-g-api,g-reg,key,n-vol,n-api,n-cpu,n-net,n-sch,n-vnc,dash,mysql,rabbit} # Nova hypervisor configuration. We default to **kvm** but will drop back to # **qemu** if we are unable to load the kvm module. Stack.sh can also install @@ -559,6 +559,7 @@ if [[ "$ENABLED_SERVICES" =~ "g-reg" ]]; then screen_it g-reg "cd $GLANCE_DIR; bin/glance-registry --config-file=etc/glance-registry.conf" fi + # launch the glance api and wait for it to answer before continuing if [[ "$ENABLED_SERVICES" =~ "g-api" ]]; then screen_it g-api "cd $GLANCE_DIR; bin/glance-api --config-file=etc/glance-api.conf" @@ -585,6 +586,12 @@ if [[ "$ENABLED_SERVICES" =~ "n-api" ]]; then sleep 1 done fi + +# launch volume service +if [[ "$ENABLED_SERVICES" =~ "n-vol" ]]; then + screen_it n-vol "cd $NOVA_DIR; bin/nova-volume" +fi + # Launching nova-compute should be as simple as running ``nova-compute`` but # have to do a little more than that in our script. Since we add the group # ``libvirtd`` to our user in this script, when nova-compute is run it is From b88387025e37a2f902366391eed07c2321318155 Mon Sep 17 00:00:00 2001 From: Robert Carr Date: Thu, 20 Oct 2011 16:40:28 +0000 Subject: [PATCH 07/10] EC2: Suppress wget output on image download to keep RightLink from choking --- stack.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stack.sh b/stack.sh index 4a69f5e0..f6b73620 100755 --- a/stack.sh +++ b/stack.sh @@ -626,7 +626,7 @@ if [[ "$ENABLED_SERVICES" =~ "g-reg" ]]; then # we upload to glance with the glance cli tool. TTY is a stripped down # version of ubuntu. if [ ! -f $FILES/tty.tgz ]; then - wget -c http://images.ansolabs.com/tty.tgz -O $FILES/tty.tgz + wget -q -c http://images.ansolabs.com/tty.tgz -O $FILES/tty.tgz fi # extract ami-tty/image, aki-tty/image & ari-tty/image @@ -647,7 +647,7 @@ if [[ "$ENABLED_SERVICES" =~ "g-reg" ]]; then # Downloaded from ubuntu enterprise cloud images. This # image doesn't use the ramdisk functionality if [ ! -f $FILES/natty.tgz ]; then - wget -c http://uec-images.ubuntu.com/natty/current/natty-server-cloudimg-amd64.tar.gz -O $FILES/natty.tgz + wget -q -c http://uec-images.ubuntu.com/natty/current/natty-server-cloudimg-amd64.tar.gz -O $FILES/natty.tgz fi tar -zxf $FILES/natty.tgz -C $FILES/images From f8088265ecc61777e661dc69d0cfe6dc3ec4c90c Mon Sep 17 00:00:00 2001 From: Robert Carr Date: Thu, 20 Oct 2011 17:19:54 +0000 Subject: [PATCH 08/10] EC2: Fix up exec problems --- stack.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/stack.sh b/stack.sh index f6b73620..e6e3077c 100755 --- a/stack.sh +++ b/stack.sh @@ -70,9 +70,10 @@ if [[ $EUID -eq 0 ]]; then echo "Running the script as stack in 3 seconds..." sleep 3 if [[ "$SHELL_AFTER_RUN" != "no" ]]; then - exec su -c "cd /home/stack/$THIS_DIR/; bash stack.sh; bash" stack + #exec su -c "cd /home/stack/$THIS_DIR/; bash stack.sh; bash" stack + $(su -c "cd /home/stack/$THIS_DIR/; bash stack.sh" stack) else - exec su -c "cd /home/stack/$THIS_DIR/; bash stack.sh" stack + $(su -c "cd /home/stack/$THIS_DIR/; bash stack.sh" stack) fi exit 0 fi From dc54f5a8a3d58c5fc08f4deab061308f07972c9d Mon Sep 17 00:00:00 2001 From: Robert Carr Date: Thu, 20 Oct 2011 21:16:16 +0000 Subject: [PATCH 09/10] EC2: Added sudo to screen command --- stack.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/stack.sh b/stack.sh index e6e3077c..a10af417 100755 --- a/stack.sh +++ b/stack.sh @@ -542,17 +542,16 @@ fi function screen_it { NL=`echo -ne '\015'` if [[ "$ENABLED_SERVICES" =~ "$1" ]]; then - screen -S nova -X screen -t $1 - screen -S nova -p $1 -X stuff "$2$NL" + sudo screen -S nova -X screen -t $1 + sudo screen -S nova -p $1 -X stuff "$2$NL" fi } # Fix issue with permissions on /dev/pts/0 for normal user # Otherwise, screen call fails. -sudo chmod o=r+w /dev/pts/0 # create a new named screen to run processes in -screen -d -m -S nova -t nova +sudo screen -d -m -S nova -t nova sleep 1 # launch the glance registery service From f5afcc9dfb9b01593a9eca0bb7674b4b669a05ff Mon Sep 17 00:00:00 2001 From: Robert Carr Date: Sat, 22 Oct 2011 00:55:51 +0000 Subject: [PATCH 10/10] EC2: Added Public IP for VNCProxy URL --- stack.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stack.sh b/stack.sh index a10af417..78925b5d 100755 --- a/stack.sh +++ b/stack.sh @@ -467,7 +467,7 @@ add_nova_flag "--vlan_interface=$VLAN_INTERFACE" add_nova_flag "--sql_connection=$BASE_SQL_CONN/nova" add_nova_flag "--libvirt_type=$LIBVIRT_TYPE" add_nova_flag "--osapi_extensions_path=$OPENSTACKX_DIR/extensions" -add_nova_flag "--vncproxy_url=http://$HOST_IP:6080" +add_nova_flag "--vncproxy_url=http://$HOST_PUBLIC_IP:6080" add_nova_flag "--vncproxy_wwwroot=$NOVNC_DIR/" add_nova_flag "--api_paste_config=$KEYSTONE_DIR/examples/paste/nova-api-paste.ini" add_nova_flag "--image_service=nova.image.glance.GlanceImageService"