From 03e0abbb8a1b7537e739f2a1d3af5cefb2928f5d Mon Sep 17 00:00:00 2001 From: Timothy Middelkoop Date: Mon, 6 Dec 2021 09:16:09 -0600 Subject: [PATCH] Create local ssh file the same as other platforms --- content/GCP/02_intro_to_compute.ipynb | 2 +- scripts/gcp-create.sh | 18 ++++++++++++++++-- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/content/GCP/02_intro_to_compute.ipynb b/content/GCP/02_intro_to_compute.ipynb index 785c3e4..3fd69d4 100644 --- a/content/GCP/02_intro_to_compute.ipynb +++ b/content/GCP/02_intro_to_compute.ipynb @@ -97,7 +97,7 @@ "tags": [] }, "source": [ - "## Follow the Storage Allocation\n", + "## Follow the VM Allocation\n", "\n", "Just as with security, we will audit (follow) the *VM instance* creation by examining at the project *activity*.\n", "\n", diff --git a/scripts/gcp-create.sh b/scripts/gcp-create.sh index b174c0f..5c9cfab 100755 --- a/scripts/gcp-create.sh +++ b/scripts/gcp-create.sh @@ -15,10 +15,24 @@ REPO="git@${GITHUB}:CLASS/${PROJECT}.git" echo "=== gcp-dev.sh $PROJECT $BRANCH" -echo "+++ creating VM" -gcloud compute instances create --zone=$ZONE $VM --machine-type=e2-highcpu-4 --preemptible +echo "+++ creating/starting VM" +gcloud compute instances create --zone=$ZONE $VM \ + --scopes=cloud-platform \ + --machine-type=e2-highcpu-4 --preemptible +gcloud compute instances start $VM IP=$(gcloud compute instances describe essentials --format='value(networkInterfaces.accessConfigs[0].natIP)') +echo "+++ configure local ssh $IP" +gcloud compute config-ssh +ssh-keygen -R $IP +cat > ~/.ssh/$VM.config <