aboutsummaryrefslogtreecommitdiffstats
path: root/deploy/host_virtual.sh
diff options
context:
space:
mode:
Diffstat (limited to 'deploy/host_virtual.sh')
-rwxr-xr-x[-rw-r--r--]deploy/host_virtual.sh19
1 files changed, 12 insertions, 7 deletions
diff --git a/deploy/host_virtual.sh b/deploy/host_virtual.sh
index 4cb33613..8e93b9b3 100644..100755
--- a/deploy/host_virtual.sh
+++ b/deploy/host_virtual.sh
@@ -1,10 +1,14 @@
+#!/bin/bash
host_vm_dir=$WORK_DIR/vm
function tear_down_machines() {
+ old_ifs=$IFS
+ IFS=,
for i in $HOSTNAMES; do
sudo virsh destroy $i
sudo virsh undefine $i
rm -rf $host_vm_dir/$i
done
+ IFS=$old_ifs
}
function reboot_hosts() {
@@ -14,7 +18,6 @@ function reboot_hosts() {
function launch_host_vms() {
old_ifs=$IFS
IFS=,
- tear_down_machines
#function_bod
mac_array=($machines)
log_info "bringing up pxe boot vms"
@@ -44,16 +47,18 @@ function launch_host_vms() {
}
function get_host_macs() {
- local config_file=$WORK_DIR/installer/compass-install/install/group_vars/all
local mac_generator=${COMPASS_DIR}/deploy/mac_generator.sh
local machines=
- chmod +x $mac_generator
- mac_array=`$mac_generator $VIRT_NUMBER`
- machines=`echo $mac_array|sed 's/ /,/g'`
+ if [[ $REDEPLOY_HOST == "true" ]]; then
+ mac_array=`cat $WORK_DIR/switch_machines`
+ else
+ chmod +x $mac_generator
+ mac_array=`$mac_generator $VIRT_NUMBER`
+ echo $mac_array > $WORK_DIR/switch_machines
+ fi
- echo "test: true" >> $config_file
- echo "pxe_boot_macs: [${machines}]" >> $config_file
+ machines=`echo $mac_array|sed 's/ /,/g'`
echo $machines
}