Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

gcloud compute instances create command fails when creating an instance

Creating an instance using gcloud does not seem to work: google-cloud> gcloud compute instances create minecraft-instance --image ubuntu-14-10 --tags minecraft NAME ZONE MACHINE_TYPE INTERNAL_IP EXTERNAL_IP STATUS ERROR: (gcloud.compute.instances.create) Unable to fetch a list of zones. Specifying [--zone] may fix this issue: - Project marked for deletion.

Adding the zone name fails differently: google-cloud> gcloud compute instances create minecraft-instance --image ubuntu-14-10 --zone us-central1-a --tags minecraft NAME ZONE MACHINE_TYPE INTERNAL_IP EXTERNAL_IP STATUS ERROR: (gcloud.compute.instances.create) Failed to find image for alias [ubuntu-14-10] in public image project [ubuntu-os-cloud]. - Project marked for deletion.

Providing a different image name fails too: google-cloud> gcloud compute instances create minecraft-instance --image ubuntu-1410-utopic --zone us-central1-a --tags minecraft NAME ZONE MACHINE_TYPE INTERNAL_IP EXTERNAL_IP STATUS ERROR: (gcloud.compute.instances.create) Could not fetch image resource: - Project marked for deletion.

What is the exact command to create an instance using gcloud?

like image 344
Arun Gupta Avatar asked Mar 23 '15 14:03

Arun Gupta


2 Answers

Did you authenticate before and set the default project?

gcloud auth login
gcloud config set project PROJECT

The base setup of gcloud is in the Google Cloud documentation.

Or did you delete your project?

Project marked for deletion.

like image 72
Paul Avatar answered Oct 11 '22 19:10

Paul


You have several things going on, one of which is reading the docs:

https://cloud.google.com/compute/docs/gcloud-compute/#creating

You syntax should be:

gcloud compute instances create minecraftinstance \
--image ubuntu-14-10 \
--zone [SOME-ZONE-ID]  \
--machine-type [SOME-MACHINE-TYPE]

Where SOME-ZONE-ID is a geographic zone to create the instance in, found by running:

gcloud compute zones list

SOME-MACHINE-TYPE is the machince type to create. Valid types are found by running:

gcloud compute machine-types list

But specifically, you seem to be creating an instance in a Project that has been deleted:

- Project marked for deletion.

Also, you need to authenticate and set a default project:

gcloud auth

and

gcloud config set project [ID]
like image 43
regretoverflow Avatar answered Oct 11 '22 20:10

regretoverflow