Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

gcloud compute ssh fails

Tags:

ssh

gcloud

I'm using Windows Server 2008.

on issuing gcloud compute ssh instance-1 --zone us-central1-a I receive the error:

ERROR: (gcloud.compute.ssh) Could not fetch instance:
 - Invalid value 'EFOnline'. Values must match the following regular expression: '(?:(?:[-a-z0-9]{1,63}\.)*(?:[a-z](?:[-
a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?))'

To be clear, I did do a gcloud auth login and received a successful 'you are now authenticated' My project Name is EFOnline my instance name is : instance-1 us-central1-a (cut and paste there)

So why the weird regex error?? Thanks

like image 798
Eric Avatar asked May 01 '15 11:05

Eric


2 Answers

Additionally, one can log into their developer console, open up your VM instance and click on the SSH widget at the top of the page, selecting View Gcloud Command. This will generate your specific string for terminal.

gcloud compute --project "project_name" ssh --zone "us-central1-a" "vm_instance_name"

like image 101
Taylor Avatar answered Sep 22 '22 04:09

Taylor


Google Cloud projects have both a name and an id.

Your project ID is the string that uniquely identifies your project to Google. Project IDs show up in URI paths to cloud resources, and have to be "good" strings to put in URIs. You can find the project id for your project at the "Overview" in http://console.developers.google.com/ page.

The project name is a human-readable string that can, for example, contain spaces and some special characters.

GCloud (and most of the GCP tooling) uses project ID.

So... please try the following: Look up your project id here: http://console.developers.google.com/ then run

$ gcloud config set project <id>
$ gcloud compute ssh instance-1 --zone us-central1-a

Also, we're working on fixing the error message.

like image 20
Jeffrey Vaughan Avatar answered Sep 19 '22 04:09

Jeffrey Vaughan