Browse Source

(fix) Added retries for genesis.sh

Added retries to rsync the genesis.sh to the genesis node, in case genesis
is rebooted as part of pre-genesis stage. This fix waits and retries until
genesis node is reachab, during reboot or for any other reason.

Added wait in genesis.sh to wait for genesis node to come up, in case it
was rebooted in the previous stage.

Change-Id: I538f2c7b1543e6775ad580ccd3dc0b5cc88d68b1
changes/07/725707/1
Ahmad Mahmoudi 2 months ago
parent
commit
7754441df1
1 changed files with 13 additions and 1 deletions
  1. +13
    -1
      tools/deployment/seaworthy-virt/airship_gate/stages/genesis.sh

+ 13
- 1
tools/deployment/seaworthy-virt/airship_gate/stages/genesis.sh View File

@@ -18,7 +18,19 @@ 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.
#rsync_cmd "${SCRIPT_DEPOT}/genesis.sh" "${GENESIS_NAME}:/root/airship/"
retries=5
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}"


Loading…
Cancel
Save