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