blob: a012a08561c723772f512c94e7a16ae8274105b9 [file] [log] [blame]
Anthony Youngb62b4ca2011-10-26 22:29:08 -07001#!/bin/bash
2
Mate Lakat0b3804b2013-05-07 16:58:17 +01003# This script must be run on a XenServer or XCP machine
John Garbuttdaadf742012-04-27 18:28:28 +01004#
5# It creates a DomU VM that runs OpenStack services
6#
7# For more details see: README.md
8
Renuka Apte0af143b2012-04-02 15:46:53 -07009set -o errexit
Mate Lakat0b3804b2013-05-07 16:58:17 +010010set -o nounset
John Garbuttdaadf742012-04-27 18:28:28 +010011set -o xtrace
Renuka Apte0af143b2012-04-02 15:46:53 -070012
Anthony Youngb62b4ca2011-10-26 22:29:08 -070013# Abort if localrc is not set
14if [ ! -e ../../localrc ]; then
15 echo "You must have a localrc with ALL necessary passwords defined before proceeding."
16 echo "See the xen README for required passwords."
17 exit 1
18fi
19
Anthony Youngaf6ed6b2011-11-02 07:50:27 -050020# This directory
Mate Lakata8bf0f22013-03-07 18:37:31 +000021THIS_DIR=$(cd $(dirname "$0") && pwd)
Anthony Youngaf6ed6b2011-11-02 07:50:27 -050022
Anthony Youngb3e2f332012-03-16 17:01:49 -070023# Source lower level functions
Mate Lakata8bf0f22013-03-07 18:37:31 +000024. $THIS_DIR/../../functions
Anthony Youngb3e2f332012-03-16 17:01:49 -070025
John Garbuttdaadf742012-04-27 18:28:28 +010026# Include onexit commands
Mate Lakata8bf0f22013-03-07 18:37:31 +000027. $THIS_DIR/scripts/on_exit.sh
John Garbuttdaadf742012-04-27 18:28:28 +010028
Mate Lakat57e3da92013-03-22 16:34:05 +000029# xapi functions
30. $THIS_DIR/functions
31
Bob Ball46691222013-08-12 17:28:50 +010032# Determine what system we are running on.
33# Might not be XenServer if we're using xenserver-core
34GetDistro
35
John Garbuttdaadf742012-04-27 18:28:28 +010036#
37# Get Settings
38#
39
Anthony Youngb3e2f332012-03-16 17:01:49 -070040# Source params - override xenrc params in your localrc to suit your taste
Mate Lakat0b3804b2013-05-07 16:58:17 +010041source $THIS_DIR/xenrc
Anthony Youngaf6ed6b2011-11-02 07:50:27 -050042
Renuka Apte0af143b2012-04-02 15:46:53 -070043xe_min()
44{
45 local cmd="$1"
46 shift
47 xe "$cmd" --minimal "$@"
48}
Anthony Youngb62b4ca2011-10-26 22:29:08 -070049
John Garbuttdaadf742012-04-27 18:28:28 +010050#
51# Prepare Dom0
52# including installing XenAPI plugins
53#
54
Mate Lakata8bf0f22013-03-07 18:37:31 +000055cd $THIS_DIR
John Garbuttdaadf742012-04-27 18:28:28 +010056
Mate Lakatd8511032013-07-03 10:44:44 +010057# Die if multiple hosts listed
58if have_multiple_hosts; then
59 cat >&2 << EOF
60ERROR: multiple hosts found. This might mean that the XenServer is a member
61of a pool - Exiting.
62EOF
63 exit 1
64fi
65
Mate Lakat57e3da92013-03-22 16:34:05 +000066# Install plugins
John Garbuttdaadf742012-04-27 18:28:28 +010067
Mate Lakat57e3da92013-03-22 16:34:05 +000068## Nova plugins
69NOVA_ZIPBALL_URL=${NOVA_ZIPBALL_URL:-$(zip_snapshot_location $NOVA_REPO $NOVA_BRANCH)}
Mate Lakatabe56ee2013-07-24 11:06:27 +010070EXTRACTED_NOVA=$(extract_remote_zipball "$NOVA_ZIPBALL_URL")
71install_xapi_plugins_from "$EXTRACTED_NOVA"
72
73LOGROT_SCRIPT=$(find "$EXTRACTED_NOVA" -name "rotate_xen_guest_logs.sh" -print)
74if [ -n "$LOGROT_SCRIPT" ]; then
75 mkdir -p "/var/log/xen/guest"
76 cp "$LOGROT_SCRIPT" /root/consolelogrotate
77 chmod +x /root/consolelogrotate
78 echo "* * * * * /root/consolelogrotate" | crontab
79fi
80
81rm -rf "$EXTRACTED_NOVA"
Maru Newby2298ca42012-10-25 23:46:42 +000082
Mate Lakat57e3da92013-03-22 16:34:05 +000083## Install the netwrap xapi plugin to support agent control of dom0 networking
Maru Newby2298ca42012-10-25 23:46:42 +000084if [[ "$ENABLED_SERVICES" =~ "q-agt" && "$Q_PLUGIN" = "openvswitch" ]]; then
Mark McClainb05c8762013-07-06 23:29:39 -040085 NEUTRON_ZIPBALL_URL=${NEUTRON_ZIPBALL_URL:-$(zip_snapshot_location $NEUTRON_REPO $NEUTRON_BRANCH)}
Mate Lakatabe56ee2013-07-24 11:06:27 +010086 EXTRACTED_NEUTRON=$(extract_remote_zipball "$NEUTRON_ZIPBALL_URL")
87 install_xapi_plugins_from "$EXTRACTED_NEUTRON"
88 rm -rf "$EXTRACTED_NEUTRON"
Maru Newby2298ca42012-10-25 23:46:42 +000089fi
90
Mate Lakat57e3da92013-03-22 16:34:05 +000091create_directory_for_kernels
Bob Ball39aeda22013-06-17 12:51:33 +010092create_directory_for_images
John Garbuttdaadf742012-04-27 18:28:28 +010093
94#
95# Configure Networking
96#
Mate Lakat9e326772013-05-08 16:42:22 +010097setup_network "$VM_BRIDGE_OR_NET_NAME"
98setup_network "$MGT_BRIDGE_OR_NET_NAME"
99setup_network "$PUB_BRIDGE_OR_NET_NAME"
Anthony Youngb62b4ca2011-10-26 22:29:08 -0700100
Mark McClainb05c8762013-07-06 23:29:39 -0400101# With neutron, one more network is required, which is internal to the
Mate Lakatf652e0f2013-05-21 18:12:48 +0100102# hypervisor, and used by the VMs
Mark McClainb05c8762013-07-06 23:29:39 -0400103if is_service_enabled neutron; then
Mate Lakatf652e0f2013-05-21 18:12:48 +0100104 setup_network "$XEN_INT_BRIDGE_OR_NET_NAME"
105fi
106
Mate Lakat9e326772013-05-08 16:42:22 +0100107if parameter_is_specified "FLAT_NETWORK_BRIDGE"; then
108 cat >&2 << EOF
109ERROR: FLAT_NETWORK_BRIDGE is specified in localrc file
110This is considered as an error, as its value will be derived from the
111VM_BRIDGE_OR_NET_NAME variable's value.
112EOF
113 exit 1
Anthony Youngb62b4ca2011-10-26 22:29:08 -0700114fi
115
Mate Lakat9e326772013-05-08 16:42:22 +0100116if ! xenapi_is_listening_on "$MGT_BRIDGE_OR_NET_NAME"; then
117 cat >&2 << EOF
118ERROR: XenAPI does not have an assigned IP address on the management network.
119please review your XenServer network configuration / localrc file.
120EOF
121 exit 1
122fi
123
124HOST_IP=$(xenapi_ip_on "$MGT_BRIDGE_OR_NET_NAME")
John Garbuttdaadf742012-04-27 18:28:28 +0100125
126# Set up ip forwarding, but skip on xcp-xapi
John Garbuttd8f1a872012-06-26 11:16:38 +0100127if [ -a /etc/sysconfig/network ]; then
John Garbuttdaadf742012-04-27 18:28:28 +0100128 if ! grep -q "FORWARD_IPV4=YES" /etc/sysconfig/network; then
129 # FIXME: This doesn't work on reboot!
130 echo "FORWARD_IPV4=YES" >> /etc/sysconfig/network
131 fi
132fi
Anthony Youngb62b4ca2011-10-26 22:29:08 -0700133# Also, enable ip forwarding in rc.local, since the above trick isn't working
134if ! grep -q "echo 1 >/proc/sys/net/ipv4/ip_forward" /etc/rc.local; then
135 echo "echo 1 >/proc/sys/net/ipv4/ip_forward" >> /etc/rc.local
136fi
Anthony Youngb62b4ca2011-10-26 22:29:08 -0700137# Enable ip forwarding at runtime as well
138echo 1 > /proc/sys/net/ipv4/ip_forward
139
John Garbuttdaadf742012-04-27 18:28:28 +0100140
141#
Anthony Young346e4912011-11-05 00:22:47 -0500142# Shutdown previous runs
John Garbuttdaadf742012-04-27 18:28:28 +0100143#
144
Anthony Young346e4912011-11-05 00:22:47 -0500145DO_SHUTDOWN=${DO_SHUTDOWN:-1}
John Garbuttdaadf742012-04-27 18:28:28 +0100146CLEAN_TEMPLATES=${CLEAN_TEMPLATES:-false}
Anthony Young346e4912011-11-05 00:22:47 -0500147if [ "$DO_SHUTDOWN" = "1" ]; then
Anthony Young40b57372011-11-05 00:30:07 -0500148 # Shutdown all domU's that created previously
John Garbuttdaadf742012-04-27 18:28:28 +0100149 clean_templates_arg=""
150 if $CLEAN_TEMPLATES; then
151 clean_templates_arg="--remove-templates"
152 fi
153 ./scripts/uninstall-os-vpx.sh $clean_templates_arg
Anthony Young346e4912011-11-05 00:22:47 -0500154
155 # Destroy any instances that were launched
156 for uuid in `xe vm-list | grep -1 instance | grep uuid | sed "s/.*\: //g"`; do
157 echo "Shutting down nova instance $uuid"
Mate Lakat0d97cbe2013-07-29 09:41:50 +0100158 xe vm-uninstall uuid=$uuid force=true
Anthony Young346e4912011-11-05 00:22:47 -0500159 done
Anthony Youngfa4ecc62011-11-11 10:23:22 -0800160
161 # Destroy orphaned vdis
162 for uuid in `xe vdi-list | grep -1 Glance | grep uuid | sed "s/.*\: //g"`; do
163 xe vdi-destroy uuid=$uuid
164 done
Anthony Young346e4912011-11-05 00:22:47 -0500165fi
Anthony Youngb62b4ca2011-10-26 22:29:08 -0700166
Renuka Apte0af143b2012-04-02 15:46:53 -0700167
John Garbuttdaadf742012-04-27 18:28:28 +0100168#
169# Create Ubuntu VM template
170# and/or create VM from template
171#
Renuka Apte0af143b2012-04-02 15:46:53 -0700172
John Garbuttdaadf742012-04-27 18:28:28 +0100173GUEST_NAME=${GUEST_NAME:-"DevStackOSDomU"}
Mate Lakatc02b2f82013-07-30 19:43:10 +0100174TNAME="jeos_template_for_devstack"
175SNAME_TEMPLATE="jeos_snapshot_for_devstack"
John Garbuttdaadf742012-04-27 18:28:28 +0100176SNAME_FIRST_BOOT="before_first_boot"
177
178function wait_for_VM_to_halt() {
Bob Ball63c6c2b2013-01-24 13:13:51 +0000179 set +x
180 echo "Waiting for the VM to halt. Progress in-VM can be checked with vncviewer:"
181 mgmt_ip=$(echo $XENAPI_CONNECTION_URL | tr -d -c '1234567890.')
182 domid=$(xe vm-list name-label="$GUEST_NAME" params=dom-id minimal=true)
183 port=$(xenstore-read /local/domain/$domid/console/vnc-port)
Mate Lakat97621a12013-08-30 13:12:17 +0100184 echo "vncviewer -via root@$mgmt_ip localhost:${port:2}"
Renuka Apte0af143b2012-04-02 15:46:53 -0700185 while true
186 do
187 state=$(xe_min vm-list name-label="$GUEST_NAME" power-state=halted)
188 if [ -n "$state" ]
189 then
190 break
191 else
Bob Ball63c6c2b2013-01-24 13:13:51 +0000192 echo -n "."
John Garbuttdaadf742012-04-27 18:28:28 +0100193 sleep 20
Renuka Apte0af143b2012-04-02 15:46:53 -0700194 fi
195 done
Bob Ball63c6c2b2013-01-24 13:13:51 +0000196 set -x
John Garbuttdaadf742012-04-27 18:28:28 +0100197}
Renuka Apte0af143b2012-04-02 15:46:53 -0700198
John Garbuttdaadf742012-04-27 18:28:28 +0100199templateuuid=$(xe template-list name-label="$TNAME")
200if [ -z "$templateuuid" ]; then
201 #
202 # Install Ubuntu over network
203 #
204
John Garbuttdaadf742012-04-27 18:28:28 +0100205 # always update the preseed file, incase we have a newer one
206 PRESEED_URL=${PRESEED_URL:-""}
207 if [ -z "$PRESEED_URL" ]; then
208 PRESEED_URL="${HOST_IP}/devstackubuntupreseed.cfg"
209 HTTP_SERVER_LOCATION="/opt/xensource/www"
210 if [ ! -e $HTTP_SERVER_LOCATION ]; then
211 HTTP_SERVER_LOCATION="/var/www/html"
212 mkdir -p $HTTP_SERVER_LOCATION
213 fi
Mate Lakata8bf0f22013-03-07 18:37:31 +0000214 cp -f $THIS_DIR/devstackubuntupreseed.cfg $HTTP_SERVER_LOCATION
Mate Lakatd3740f72013-05-09 15:02:21 +0100215
216 sed \
217 -e "s,\(d-i mirror/http/hostname string\).*,\1 $UBUNTU_INST_HTTP_HOSTNAME,g" \
218 -e "s,\(d-i mirror/http/directory string\).*,\1 $UBUNTU_INST_HTTP_DIRECTORY,g" \
219 -e "s,\(d-i mirror/http/proxy string\).*,\1 $UBUNTU_INST_HTTP_PROXY,g" \
220 -i "${HTTP_SERVER_LOCATION}/devstackubuntupreseed.cfg"
John Garbuttdaadf742012-04-27 18:28:28 +0100221 fi
222
John Garbuttd8f1a872012-06-26 11:16:38 +0100223 # Update the template
Mate Lakata8bf0f22013-03-07 18:37:31 +0000224 $THIS_DIR/scripts/install_ubuntu_template.sh $PRESEED_URL
John Garbuttdaadf742012-04-27 18:28:28 +0100225
Mate Lakat2f524bd2013-06-19 12:32:23 +0100226 # create a new VM from the given template with eth0 attached to the given
227 # network
Mate Lakat9e326772013-05-08 16:42:22 +0100228 $THIS_DIR/scripts/install-os-vpx.sh \
229 -t "$UBUNTU_INST_TEMPLATE_NAME" \
Mate Lakat2f524bd2013-06-19 12:32:23 +0100230 -n "$UBUNTU_INST_BRIDGE_OR_NET_NAME" \
Mate Lakat9e326772013-05-08 16:42:22 +0100231 -l "$GUEST_NAME" \
Mate Lakat8ff33ce2013-05-30 13:26:58 +0100232 -r "$OSDOMU_MEM_MB"
John Garbuttdaadf742012-04-27 18:28:28 +0100233
234 # wait for install to finish
235 wait_for_VM_to_halt
236
237 # set VM to restart after a reboot
Renuka Apte0af143b2012-04-02 15:46:53 -0700238 vm_uuid=$(xe_min vm-list name-label="$GUEST_NAME")
239 xe vm-param-set actions-after-reboot=Restart uuid="$vm_uuid"
240
241 # Make template from VM
Mate Lakatc02b2f82013-07-30 19:43:10 +0100242 snuuid=$(xe vm-snapshot vm="$GUEST_NAME" new-name-label="$SNAME_TEMPLATE")
John Garbuttdaadf742012-04-27 18:28:28 +0100243 xe snapshot-clone uuid=$snuuid new-name-label="$TNAME"
244else
245 #
246 # Template already installed, create VM from template
247 #
248 vm_uuid=$(xe vm-install template="$TNAME" new-name-label="$GUEST_NAME")
Renuka Apte0af143b2012-04-02 15:46:53 -0700249fi
250
Mate Lakatc02b2f82013-07-30 19:43:10 +0100251#
252# Prepare VM for DevStack
253#
254
255# Install XenServer tools, and other such things
256$THIS_DIR/prepare_guest_template.sh "$GUEST_NAME"
257
258# start the VM to run the prepare steps
259xe vm-start vm="$GUEST_NAME"
260
261# Wait for prep script to finish and shutdown system
262wait_for_VM_to_halt
263
Mate Lakat5a56cd62013-06-17 13:54:43 +0100264## Setup network cards
265# Wipe out all
266destroy_all_vifs_of "$GUEST_NAME"
267# Tenant network
268add_interface "$GUEST_NAME" "$VM_BRIDGE_OR_NET_NAME" "$VM_DEV_NR"
269# Management network
270add_interface "$GUEST_NAME" "$MGT_BRIDGE_OR_NET_NAME" "$MGT_DEV_NR"
271# Public network
272add_interface "$GUEST_NAME" "$PUB_BRIDGE_OR_NET_NAME" "$PUB_DEV_NR"
John Garbuttdaadf742012-04-27 18:28:28 +0100273
274#
275# Inject DevStack inside VM disk
276#
Mate Lakata8bf0f22013-03-07 18:37:31 +0000277$THIS_DIR/build_xva.sh "$GUEST_NAME"
Renuka Apte0af143b2012-04-02 15:46:53 -0700278
Mate Lakatf652e0f2013-05-21 18:12:48 +0100279# Attach a network interface for the integration network (so that the bridge
Mark McClainb05c8762013-07-06 23:29:39 -0400280# is created by XenServer). This is required for Neutron. Also pass that as a
Mate Lakat8ff33ce2013-05-30 13:26:58 +0100281# kernel parameter for DomU
Mark McClainb05c8762013-07-06 23:29:39 -0400282if is_service_enabled neutron; then
Mate Lakatd8511032013-07-03 10:44:44 +0100283 attach_network "$XEN_INT_BRIDGE_OR_NET_NAME"
Mate Lakat8ff33ce2013-05-30 13:26:58 +0100284
285 XEN_INTEGRATION_BRIDGE=$(bridge_for "$XEN_INT_BRIDGE_OR_NET_NAME")
286 append_kernel_cmdline \
287 "$GUEST_NAME" \
288 "xen_integration_bridge=${XEN_INTEGRATION_BRIDGE}"
Mate Lakatf652e0f2013-05-21 18:12:48 +0100289fi
290
Mate Lakat8ff33ce2013-05-30 13:26:58 +0100291FLAT_NETWORK_BRIDGE=$(bridge_for "$VM_BRIDGE_OR_NET_NAME")
292append_kernel_cmdline "$GUEST_NAME" "flat_network_bridge=${FLAT_NETWORK_BRIDGE}"
293
Mate Lakat68ac03c2013-06-06 16:22:34 +0100294# Add a separate xvdb, if it was requested
295if [[ "0" != "$XEN_XVDB_SIZE_GB" ]]; then
296 vm=$(xe vm-list name-label="$GUEST_NAME" --minimal)
297
298 # Add a new disk
299 localsr=$(get_local_sr)
300 extra_vdi=$(xe vdi-create \
301 name-label=xvdb-added-by-devstack \
302 virtual-size="${XEN_XVDB_SIZE_GB}GiB" \
303 sr-uuid=$localsr type=user)
304 xe vbd-create vm-uuid=$vm vdi-uuid=$extra_vdi device=1
305fi
306
John Garbuttdaadf742012-04-27 18:28:28 +0100307# create a snapshot before the first boot
308# to allow a quick re-run with the same settings
309xe vm-snapshot vm="$GUEST_NAME" new-name-label="$SNAME_FIRST_BOOT"
310
John Garbuttdaadf742012-04-27 18:28:28 +0100311#
312# Run DevStack VM
313#
Renuka Apte0af143b2012-04-02 15:46:53 -0700314xe vm-start vm="$GUEST_NAME"
Anthony Young3eb8f592011-10-26 23:11:52 -0700315
John Garbuttdaadf742012-04-27 18:28:28 +0100316function ssh_no_check() {
317 ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no "$@"
318}
319
Mate Lakat86446762013-05-12 18:34:29 +0100320# Get hold of the Management IP of OpenStack VM
321OS_VM_MANAGEMENT_ADDRESS=$MGT_IP
322if [ $OS_VM_MANAGEMENT_ADDRESS == "dhcp" ]; then
Mate Lakat5a56cd62013-06-17 13:54:43 +0100323 OS_VM_MANAGEMENT_ADDRESS=$(find_ip_by_name $GUEST_NAME $MGT_DEV_NR)
Mate Lakat86446762013-05-12 18:34:29 +0100324fi
325
326# Get hold of the Service IP of OpenStack VM
Mate Lakat5a56cd62013-06-17 13:54:43 +0100327if [ $HOST_IP_IFACE == "eth${MGT_DEV_NR}" ]; then
Mate Lakat86446762013-05-12 18:34:29 +0100328 OS_VM_SERVICES_ADDRESS=$MGT_IP
John Garbuttdaadf742012-04-27 18:28:28 +0100329 if [ $MGT_IP == "dhcp" ]; then
Mate Lakat5a56cd62013-06-17 13:54:43 +0100330 OS_VM_SERVICES_ADDRESS=$(find_ip_by_name $GUEST_NAME $MGT_DEV_NR)
John Garbuttdaadf742012-04-27 18:28:28 +0100331 fi
332else
Mate Lakat86446762013-05-12 18:34:29 +0100333 OS_VM_SERVICES_ADDRESS=$PUB_IP
John Garbuttdaadf742012-04-27 18:28:28 +0100334 if [ $PUB_IP == "dhcp" ]; then
Mate Lakat5a56cd62013-06-17 13:54:43 +0100335 OS_VM_SERVICES_ADDRESS=$(find_ip_by_name $GUEST_NAME $PUB_DEV_NR)
John Garbuttdaadf742012-04-27 18:28:28 +0100336 fi
Renuka Aptec56885a2012-02-29 16:09:26 -0800337fi
338
Anthony Young1de18c62011-11-01 14:19:18 -0500339# If we have copied our ssh credentials, use ssh to monitor while the installation runs
340WAIT_TILL_LAUNCH=${WAIT_TILL_LAUNCH:-1}
John Garbuttdaadf742012-04-27 18:28:28 +0100341COPYENV=${COPYENV:-1}
Anthony Young1de18c62011-11-01 14:19:18 -0500342if [ "$WAIT_TILL_LAUNCH" = "1" ] && [ -e ~/.ssh/id_rsa.pub ] && [ "$COPYENV" = "1" ]; then
Bob Ball7fcc1572013-02-20 15:56:25 +0000343 set +x
Anthony Young1de18c62011-11-01 14:19:18 -0500344
Bob Ball7fcc1572013-02-20 15:56:25 +0000345 echo "VM Launched - Waiting for startup script"
John Garbuttdaadf742012-04-27 18:28:28 +0100346 # wait for log to appear
Mate Lakat86446762013-05-12 18:34:29 +0100347 while ! ssh_no_check -q stack@$OS_VM_MANAGEMENT_ADDRESS "[ -e run.sh.log ]"; do
John Garbuttdaadf742012-04-27 18:28:28 +0100348 sleep 10
Anthony Young1de18c62011-11-01 14:19:18 -0500349 done
Bob Ball7fcc1572013-02-20 15:56:25 +0000350 echo -n "Running"
Mate Lakat86446762013-05-12 18:34:29 +0100351 while [ `ssh_no_check -q stack@$OS_VM_MANAGEMENT_ADDRESS pgrep -c run.sh` -ge 1 ]
Mate Lakat9efcf602012-12-19 10:23:06 +0000352 do
John Garbuttdaadf742012-04-27 18:28:28 +0100353 sleep 10
Mate Lakat9efcf602012-12-19 10:23:06 +0000354 echo -n "."
Anthony Young1de18c62011-11-01 14:19:18 -0500355 done
Mate Lakat9efcf602012-12-19 10:23:06 +0000356 echo "done!"
357 set -x
Anthony Young1de18c62011-11-01 14:19:18 -0500358
Mate Lakat9efcf602012-12-19 10:23:06 +0000359 # output the run.sh.log
Mate Lakat86446762013-05-12 18:34:29 +0100360 ssh_no_check -q stack@$OS_VM_MANAGEMENT_ADDRESS 'cat run.sh.log'
Anthony Young1de18c62011-11-01 14:19:18 -0500361
Mate Lakat9efcf602012-12-19 10:23:06 +0000362 # Fail if the expected text is not found
Mate Lakat86446762013-05-12 18:34:29 +0100363 ssh_no_check -q stack@$OS_VM_MANAGEMENT_ADDRESS 'cat run.sh.log' | grep -q 'stack.sh completed in'
Mate Lakat9efcf602012-12-19 10:23:06 +0000364
Bob Ball63c6c2b2013-01-24 13:13:51 +0000365 set +x
John Garbuttdaadf742012-04-27 18:28:28 +0100366 echo "################################################################################"
Anthony Young1de18c62011-11-01 14:19:18 -0500367 echo ""
John Garbuttdaadf742012-04-27 18:28:28 +0100368 echo "All Finished!"
369 echo "You can visit the OpenStack Dashboard"
Mate Lakat86446762013-05-12 18:34:29 +0100370 echo "at http://$OS_VM_SERVICES_ADDRESS, and contact other services at the usual ports."
Anthony Young1de18c62011-11-01 14:19:18 -0500371else
Bob Ball63c6c2b2013-01-24 13:13:51 +0000372 set +x
Anthony Young1de18c62011-11-01 14:19:18 -0500373 echo "################################################################################"
374 echo ""
375 echo "All Finished!"
376 echo "Now, you can monitor the progress of the stack.sh installation by "
377 echo "tailing /opt/stack/run.sh.log from within your domU."
378 echo ""
Mate Lakat86446762013-05-12 18:34:29 +0100379 echo "ssh into your domU now: 'ssh stack@$OS_VM_MANAGEMENT_ADDRESS' using your password"
Anthony Young1de18c62011-11-01 14:19:18 -0500380 echo "and then do: 'tail -f /opt/stack/run.sh.log'"
381 echo ""
382 echo "When the script completes, you can then visit the OpenStack Dashboard"
Mate Lakat86446762013-05-12 18:34:29 +0100383 echo "at http://$OS_VM_SERVICES_ADDRESS, and contact other services at the usual ports."
Anthony Young1de18c62011-11-01 14:19:18 -0500384fi