Joe Lowery
Joe Lowery

Reputation: 572

Can't get Compute Engine instances list

I'm testing out Compute Engine and am hitting a snag. I've set up a project (jwl-project-1) and created an instance (instance-1). After authenticating with gcloud auth login, I set the project like this:

gcloud config set project jwl-project-1

And then tried to get a list of instances:

gcloud compute instances list

In return, I get this error:

ERROR: (gcloud.compute.instances.list) Some requests did not succeed:
- Invalid value for project: jwl-project-1

I basically accepted the default values for project and instances (micro-disk). What am I missing?

Upvotes: 2

Views: 2595

Answers (3)

Misha Brukman
Misha Brukman

Reputation: 13424

You can see all of your projects on the Google Cloud Platform Console. Use the name under the Project ID heading, not the Project Name heading.

The Project ID is a unique identifier which cannot be changed after project creation and is used everywhere to identify the project, whereas the Project Name is a human-readable name which can be changed after project creation.

Upvotes: 3

dor laor
dor laor

Reputation: 870

Make sure you authenticate using oauth2 and a browser: 'gcloud auth login' Paste the link to the browser, complete the authentication and then check by 'gcloud compute instances list '

Upvotes: 1

Kamran
Kamran

Reputation: 3537

As the error indicates there is no project called 'jwl-project-1' under your account. Try to use your Project ID instead:

$ gcloud config set project <project-id>

Upvotes: 8

Related Questions