diff --git a/3-create-virtual-machine.sh b/3-create-virtual-machine.sh index 925a080..d3430e3 100755 --- a/3-create-virtual-machine.sh +++ b/3-create-virtual-machine.sh @@ -7,8 +7,11 @@ # Tangle the shell block below to a shell script by pressing *, b t* in emacs command mode: +# Ensure compute engine apis are enabled in the project +gcloud services enable compute.googleapis.com + # Create name for virtual machine based on date export gcp_machine_name="gitlab-gcp-"$(date +"%Y-%m-%d") # Create the new machine -gcloud compute instances create $gcp_machine_name +gcloud compute instances create $gcp_machine_name --zone australia-southeast1-a diff --git a/README.org b/README.org index 6384dec..2b4b75f 100644 --- a/README.org +++ b/README.org @@ -70,14 +70,17 @@ gcloud config set project $gcp_project_id #+end_src -Once we have a project we can create a new virtual machine. +Once we have a project we can create a new virtual machine. To create a virtual machine we need to ensure compute engine apis are enabled. Tangle the shell block below to a shell script by pressing *, b t* in emacs command mode: #+begin_src bash :shebang #!/bin/bash :tangle 3-create-virtual-machine.sh +# Ensure compute engine apis are enabled in the project +gcloud services enable compute.googleapis.com + # Create name for virtual machine based on date export gcp_machine_name="gitlab-gcp-"$(date +"%Y-%m-%d") # Create the new machine -gcloud compute instances create $gcp_machine_name +gcloud compute instances create $gcp_machine_name --zone australia-southeast1-a #+end_src