3 # Delete the stack if exists
4 openstack stack show -c id ${openstack_build_stack_name} && openstack stack delete -y --wait ${openstack_build_stack_name}
7 openstack stack create -f yaml -e ${heat_environment} -t ${heat_template} --wait ${openstack_build_stack_name}
10 #TODO: Check if need to remove reference to "om_ran" in line below [eronkeo: 10-10-2019] ** DONE **
11 # build_node_ip=$(openstack server list -c Name -c Networks -f value | egrep ${openstack_build_stack_name} | awk '{print $NF}' | sed 's/om_ran=//g')
12 build_node_ip=$(openstack server list -c Name -c Networks -f value | egrep ${openstack_build_stack_name} | awk '{print $NF}' | sed 's/.*=//g')
14 ### Checking if the VM is up, if not retry till it is and continue with the script ###
15 for n in $(seq 1 40); do
16 timeout 1 ping -c 1 "${build_node_ip}" > /dev/null 2>&1
18 if [ "$RESULT" -eq "0" ] ; then
19 echo "RESULT: $RESULT"
23 echo "Failed to connect to "${build_node_ip}". RESULT: $RESULT - Retrying in 10 seconds..."
29 echo "========================================"
30 echo "build node ip: ${build_node_ip}"
31 echo "========================================"