Skip to content

Commit

Permalink
Add zone info to a few gcloud commands (#12)
Browse files Browse the repository at this point in the history
I had trouble using the io500 start.sh scripts
The following changes were needed to get things into
a working state.

Signed-off-by: Keith Mannthey <[email protected]>
  • Loading branch information
Kmannth authored Jan 27, 2022
1 parent 8f1ee20 commit 08befbe
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions terraform/examples/io500/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ gcloud compute instance-groups managed wait-until ${TF_VAR_server_template_name}

printf "\nAdd external IP to first client\n\n"
gcloud compute instances add-access-config ${DAOS_FIRST_CLIENT} --zone ${TF_VAR_zone} && sleep 10
FIRST_CLIENT_IP=$(gcloud compute instances describe ${DAOS_FIRST_CLIENT} | grep natIP | awk '{print $2}')
FIRST_CLIENT_IP=$(gcloud compute instances describe ${DAOS_FIRST_CLIENT} --zone ${TF_VAR_zone} | grep natIP | awk '{print $2}')

log "Configure SSH access"
printf "\nCreate SSH key\n\n"
Expand All @@ -57,9 +57,9 @@ printf "\nConfiguring SSH for user '${SSH_USER}' on all nodes\n\n"
for node in $ALL_NODES
do
# Disable OSLogin to be able to connect with SSH keys uploaded in next command
gcloud compute instances add-metadata ${node} --metadata enable-oslogin=FALSE && \
gcloud compute instances add-metadata ${node} --zone ${TF_VAR_zone} --metadata enable-oslogin=FALSE && \
# Upload SSH key to instance, so that you could login to instance over SSH
gcloud compute instances add-metadata ${node} --metadata-from-file ssh-keys=keys.txt &
gcloud compute instances add-metadata ${node} --zone ${TF_VAR_zone} --metadata-from-file ssh-keys=keys.txt &
done

# Wait for SSH configuring tasks to finish
Expand Down

0 comments on commit 08befbe

Please sign in to comment.