From e29a4ea1b77bdb9e78e2fabac8a3029c4c2b61fc Mon Sep 17 00:00:00 2001 From: Harry Huang Date: Tue, 4 Dec 2018 11:41:34 +0800 Subject: Adapt compass4nfv scripts to new compass-deck JIRA: COMPASS-612 1. pass machine info through file 2. generate mac address in config_parse.py Change-Id: Iaaf0f2b1f4ab97e8200c8c046746168d991570e3 Signed-off-by: Harry Huang --- deploy/host_virtual.sh | 59 +++++++++++++------------------------------------- 1 file changed, 15 insertions(+), 44 deletions(-) (limited to 'deploy/host_virtual.sh') diff --git a/deploy/host_virtual.sh b/deploy/host_virtual.sh index d955b747..c3133cf6 100755 --- a/deploy/host_virtual.sh +++ b/deploy/host_virtual.sh @@ -25,20 +25,21 @@ function tear_down_machines() { } function reboot_hosts() { + echo "reboot" # We do need it for aarch64 - if [ "$COMPASS_ARCH" = "aarch64" ]; then - old_ifs=$IFS - IFS=, - for i in $HOSTNAMES; do - sudo virsh destroy $i - sleep 3 - sudo virsh start $i - sleep 3 - done - IFS=$old_ifs - else - log_warn "reboot_hosts do nothing" - fi +# if [ "$COMPASS_ARCH" = "aarch64" ]; then +# old_ifs=$IFS +# IFS=, +# for i in $HOSTNAMES; do +# sudo virsh destroy $i +# sleep 3 +# sudo virsh start $i +# sleep 3 +# done +# IFS=$old_ifs +# else +# log_warn "reboot_hosts do nothing" +# fi } function launch_host_vms() { @@ -97,37 +98,7 @@ function recover_host_vms() { } function get_host_macs() { - local mac_generator=${COMPASS_DIR}/deploy/mac_generator.sh - local machines= - - if [[ $REDEPLOY_HOST == "true" ]]; then - mac_array=`cat $WORK_DIR/switch_machines` - machines=`echo $mac_array|sed 's/ /,/g'` - else - if [[ -z $HOST_MACS ]]; then - if [[ "$EXPANSION" == "false" ]]; then - chmod +x $mac_generator - mac_array=`$mac_generator $VIRT_NUMBER` - echo $mac_array > $WORK_DIR/switch_machines - machines=`echo $mac_array|sed 's/ /,/g'` - else - machines_old=`cat $WORK_DIR/switch_machines` - chmod +x $mac_generator - machines_add=`$mac_generator $VIRT_NUMBER` - echo $machines_add $machines_old > $WORK_DIR/switch_machines - machines=`echo $machines_add $machines_old|sed 's/ /,/g'` - fi - else - if [[ "$EXPANSION" == "false" ]]; then - machines=`echo $HOST_MACS | sed -e 's/,/'\',\''/g' -e 's/^/'\''/g' -e 's/$/'\''/g'` - else - machines_old=`cat $WORK_DIR/switch_machines` - machines_add=`echo $HOST_MACS | sed -e 's/,/'\',\''/g' -e 's/^/'\''/g' -e 's/$/'\''/g'` - echo $machines_add $machines_old > $WORK_DIR/switch_machines - machines=`echo $machines_add $machines_old|sed 's/ /,/g'` - fi - fi - fi + local machines=`echo $HOST_MACS | sed -e 's/,/'\',\''/g' -e 's/^/'\''/g' -e 's/$/'\''/g'` echo $machines } -- cgit 1.2.3-korg