comparison master/bin/internal/vmss_setup.sh @ 16:c3e9ad8a42cf

fix (1st, but not only?) fail when using after vmss restart
author Henry S. Thompson <ht@markup.co.uk>
date Fri, 19 Oct 2018 11:34:26 +0000
parents 68cca895e872
children
comparison
equal deleted inserted replaced
15:68cca895e872 16:c3e9ad8a42cf
9 if ! ssh-keyscan -p $port $host >>~/.ssh/known_hosts 2>/dev/null; then 9 if ! ssh-keyscan -p $port $host >>~/.ssh/known_hosts 2>/dev/null; then
10 echo $host:$port does not seem to be up, might be overprovisioned 1>&2 10 echo $host:$port does not seem to be up, might be overprovisioned 1>&2
11 exit 1 11 exit 1
12 fi 12 fi
13 #Copy azure credentials over and make delete/deallocate commands 13 #Copy azure credentials over and make delete/deallocate commands
14 (echo $@ --instance-ids $instance; cd ~; tar c .azure) |ssh -o ConnectTimeout=5 -p $port $host 'read a; mkdir bin; echo -e '\''#!/bin/bash\n'\''az vmss deallocate $a >deallocate && echo -e '\''#!/bin/bash\n'\''az vmss delete-instances $a >delete && chmod +x deallocate delete && tar x && sudo mv deallocate delete /bin' 14 (echo $@ --instance-ids $instance; cd ~; tar c .azure) |ssh -o ConnectTimeout=5 -p $port $host 'read a; mkdir -p bin; echo -e '\''#!/bin/bash\n'\''az vmss deallocate $a >deallocate && echo -e '\''#!/bin/bash\n'\''az vmss delete-instances $a >delete && chmod +x deallocate delete && tar x && sudo mv deallocate delete /bin'
15 echo ssh -p $port $host " #id $instance" 15 echo ssh -p $port $host " #id $instance"