4 # shellcheck disable=SC1091
10 function check_provisioned {
11 declare -i prev_host_state=0
13 echo "VM state: 1 means provisioned & 0 means not yet provisioned"
14 while IFS=',' read -r name address user password mac; do
15 declare -i current_host_state=0
16 state=$(kubectl get baremetalhosts $name -n metal3 -o json | jq -r '.status.provisioning.state')
17 echo "VM host metal3 state - "$name" : "$state
19 if [ $state == "provisioned" ];then
23 echo "VM $name current_host_state : "$current_host_state
24 echo "VMs prev_host_state : "$prev_host_state
27 prev_host_state=$current_host_state
32 if [ $current_host_state -eq 1 ] && [ $prev_host_state -eq 1 ]; then
38 echo "All VM hosts aggregated state - prev_host_state:"$prev_host_state
41 return $prev_host_state
44 function warm_up_time {
45 echo "Wait for 75s for all VM to reboot and network is up"
49 function wait_for_provisioned {
53 echo "Try $k/$timeout iteration : Wait for $interval seconds to check all bmh state"
55 if ! list_nodes | check_provisioned; then
56 echo "All the VMs are provisioned - success"
66 function verify_bm_hosts {