diff options
author | Harry Huang <huangxiangyu5@huawei.com> | 2018-12-04 11:41:34 +0800 |
---|---|---|
committer | Harry Huang <huangxiangyu5@huawei.com> | 2019-02-01 17:24:50 +0800 |
commit | e29a4ea1b77bdb9e78e2fabac8a3029c4c2b61fc (patch) | |
tree | 9279936c6157e4877a6f9630ef6918ef248beaef /deploy/host_virtual.sh | |
parent | 5999d29ded67ee2847e58fa559dd9da29e1bd150 (diff) |
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 <huangxiangyu5@huawei.com>
Diffstat (limited to 'deploy/host_virtual.sh')
-rwxr-xr-x | deploy/host_virtual.sh | 59 |
1 files changed, 15 insertions, 44 deletions
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 } |