From b5fc7a6e44b2a428f1d104ed50b246459cc707e8 Mon Sep 17 00:00:00 2001 From: Roger Luethi Date: Sat, 16 Aug 2014 09:26:16 +0200 Subject: [PATCH] labs: split wait_for_shutdown off from boot The boot command in config/scripts.* implies that osbash is going to wait for the VM to shutdown before it proceeds. That means we currently can't leave a VM running while booting another which is unfortunate when the compute node needs access to controller services to build. This patch splits the boot command into two separate commands, boot and wait_for_shutdown, so we can omit wait_for_shutdown as desired. All the configuration files are updated to keep build behavior unchanged, with one exception: after the controller has been built, shutdown, and snapshotted, it is booted again. Change-Id: Ib6ba789f1b41909ef2398e9f78b343c41230e57b Implements: blueprint openstack-training-labs --- labs/config/scripts.compute | 1 + labs/config/scripts.controller | 2 ++ labs/config/scripts.network | 1 + labs/config/scripts.nodeinit_osbash | 1 + labs/lib/osbash/functions.host | 3 +++ labs/lib/osbash/virtualbox.install_node | 1 - 6 files changed, 8 insertions(+), 1 deletion(-) diff --git a/labs/config/scripts.compute b/labs/config/scripts.compute index 057d1fe9..0bfdb6b2 100644 --- a/labs/config/scripts.compute +++ b/labs/config/scripts.compute @@ -2,4 +2,5 @@ scripts setup_nova_compute.sh scripts shutdown.sh boot +wait_for_shutdown snapshot "pre-installed" diff --git a/labs/config/scripts.controller b/labs/config/scripts.controller index 9b400fcd..5988f705 100644 --- a/labs/config/scripts.controller +++ b/labs/config/scripts.controller @@ -10,4 +10,6 @@ scripts setup_cinder_volumes.sh scripts setup_horizon.sh scripts shutdown.sh boot +wait_for_shutdown snapshot "pre-installed" +boot diff --git a/labs/config/scripts.network b/labs/config/scripts.network index 8c71787d..4d7a25a4 100644 --- a/labs/config/scripts.network +++ b/labs/config/scripts.network @@ -1,4 +1,5 @@ # Scripts for network node scripts shutdown.sh boot +wait_for_shutdown snapshot "pre-installed" diff --git a/labs/config/scripts.nodeinit_osbash b/labs/config/scripts.nodeinit_osbash index 42e24c3a..6f811d50 100644 --- a/labs/config/scripts.nodeinit_osbash +++ b/labs/config/scripts.nodeinit_osbash @@ -4,4 +4,5 @@ osbash enable_vagrant_ssh_keys.sh #osbash wait_debug.sh scripts shutdown.sh boot +wait_for_shutdown snapshot "Network configured." diff --git a/labs/lib/osbash/functions.host b/labs/lib/osbash/functions.host index fc896083..2b39ed24 100644 --- a/labs/lib/osbash/functions.host +++ b/labs/lib/osbash/functions.host @@ -279,6 +279,9 @@ function autostart_from_config { # Format: snapshot "Description for snapshot" echo >&2 vm_snapshot "$NODE_NAME" "$field_2" vm_snapshot "$NODE_NAME" "$field_2" + elif [ "$field_1" == "wait_for_shutdown" ]; then + echo >&2 vm_wait_for_shutdown "$NODE_NAME" + vm_wait_for_shutdown "$NODE_NAME" else # Queue a script for autostart # Format: diff --git a/labs/lib/osbash/virtualbox.install_node b/labs/lib/osbash/virtualbox.install_node index b401de9c..8326eba1 100644 --- a/labs/lib/osbash/virtualbox.install_node +++ b/labs/lib/osbash/virtualbox.install_node @@ -33,7 +33,6 @@ function _vbox_boot_with_autostart { wait_for_autofiles echo >&2 "VM \"$VM\": autostart files executed" - vm_wait_for_shutdown "$VM" } function vm_build_node {