This is the code:
gcloud compute instances create gcelab2 --machine-type e2-medium --zone=$ZONE
ERROR: (gcloud.compute.instances.create) could not parse resource []
this is not working for us-west1-b zone.
Somebody is facing this issue, finally I got the solution for the new cloud terminal syntax.
Ans:
gcloud compute instances create gcelab2 --machine-type e2-medium --zone='us-west1-b'
Created [https://www.googleapis.com/compute/v1/projects/qwiklabs-gcp-03-6fba5558b812/zones/us-west1-b/instanc...].
NAME: gcelab2
ZONE: us-west1-b
MACHINE_TYPE: e2-medium
PREEMPTIBLE:
...
Solved! Go to Solution.
Thanks for the solution.
Hi @S_Majumder2003,
Welcome to Google Cloud Community!
Thank you for sharing your insights on potential solutions. The first command you provided gcloud compute instances create gcelab2 --machine-type e2-medium --zone=$ZONE
requires the $ZONE to be set or exported as us-west1-b
.
To export $ZONE, you can execute the following command :
export ZONE=us-west1-b
To verify if $ZONE has been successfully exported run the command below. The output should display us-west1-b
:
echo $ZONE
If you prefer not to use $ZONE you can directly specify the zone using the second command you provided. For further information you can check this guide Create Compute Instances.
I hope the above information is helpful.
Thanks for the solution.
User | Count |
---|---|
4 | |
3 | |
2 | |
1 | |
1 |