Add option to skip snapshot cycles

This patch adds a new option for ignoring the snapshot_cycle command.
Instead of shutting down the machine, taking a snapshot and rebooting it
again, the next script in the list is immediately executed. Only
snapshots created with the snapshot_cycle command are affected.

This speeds up the build time for the cluster considerably.

The patch also starts the network interfaces in init_xxx_node to have
them ready for the next script without having to reboot the machine.

Change-Id: I12a11144113a1fcde60a64a525e2217f4a758577
This commit is contained in:
Roger Luethi
2015-11-25 18:02:06 +01:00
parent 8a927975ab
commit 965fe952b1
3 changed files with 16 additions and 0 deletions

View File

@@ -345,6 +345,10 @@ function command_from_config {
vm_wait_for_shutdown "$vm_name"
;;
snapshot_cycle)
# Skip command if user disabled snapshot cycles
if [ "${SNAP_CYCLE:-}" = "no" ]; then
continue
fi
# Format: snapshot_cycle [-g <gui_type>] [-n <node_name>]
# comprises shutdown, boot, wait_for_shutdown, snapshot
get_cmd_options $args

View File

@@ -38,6 +38,7 @@ function usage {
echo "-g GUI GUI type during build"
#echo "-e EXPORT Export node VMs"
echo "--no-color Disables colors during build"
echo "--no-snap-cycle Disables snapshot cycles during build"
echo
echo "TARGET basedisk: build configured basedisk"
echo " cluster : build OpenStack cluster [all nodes]"
@@ -60,6 +61,10 @@ function print_config {
echo -e "${CInfo:-}Distribution name: ${CData:-} $(get_distro_name "$DISTRO")${CReset:-}"
fi
if [ "${SNAP_CYCLE:-}" = "no" ]; then
echo -e "${CInfo:-}Skipping snapshot cycles.${CReset:-}"
fi
if [ -n "${EXPORT_OVA:-}" ]; then
echo "Exporting to OVA: ${EXPORT_OVA}"
elif [ -n "${EXPORT_VM_DIR:-}" ]; then
@@ -115,6 +120,9 @@ while getopts :be:g:-:hnt:w opt; do
no-color)
unset CError CStatus CInfo CProcess CData CMissing CReset
;;
no-snap-cycle)
SNAP_CYCLE="no"
;;
help)
usage
;;

View File

@@ -29,3 +29,7 @@ echo "$NODE_NAME" | sudo tee /etc/hostname > /dev/null
# Configure network interfaces
config_network
for iface in $(ip -o link show|grep -o "eth[[:digit:]]"); do
sudo ifup "$iface"
done