diff --git a/tools/deployment/seaworthy-virt/airship_gate/stages/genesis.sh b/tools/deployment/seaworthy-virt/airship_gate/stages/genesis.sh index c78a68924..79901241a 100755 --- a/tools/deployment/seaworthy-virt/airship_gate/stages/genesis.sh +++ b/tools/deployment/seaworthy-virt/airship_gate/stages/genesis.sh @@ -18,7 +18,18 @@ set -e source "${GATE_UTILS}" # Copies script and virtmgr private key to genesis VM -rsync_cmd "${SCRIPT_DEPOT}/genesis.sh" "${GENESIS_NAME}:/root/airship/" +# waits for the genesis node to complete reboot, if it is rebooted during +# genesis setup stage. +retries=10 +while ! rsync_cmd "${SCRIPT_DEPOT}/genesis.sh" "${GENESIS_NAME}:/root/airship/"; do + retries=$((retries-1)) + if [[ "${reties}" == "0" ]]; then + log_error "Genesis is not reachable after ${retries} retries." + break + fi + log "Genesis node is not reachable yet. Retrying in 30 seconds." + sleep 30 +done set -o pipefail ssh_cmd_raw "${GENESIS_NAME}" "PROMENADE_ENCRYPTION_KEY=${PROMENADE_ENCRYPTION_KEY} /root/airship/genesis.sh" 2>&1 | tee -a "${LOG_FILE}"