Score:0

Can not connect to a Google Cloud TPU using ssh (putty) in Windows

eg flag

I have a google v3-8 TPU, i can't figure out how to connect to it using ssh in windows. I did every guide there is, but the connection just times out.

What i tried (among others): 1. Dos command line: gcloud config set compute/zone europe-west4-a

gcloud config set account [email protected]

gcloud config set project myprojectname

gcloud services enable tpu.googleapis.com

gcloud alpha compute tpus tpu-vm ssh --zone europe-west4-a vm_name

This just opens Putty which then timeouts.

  1. Create a pub/priv key using Puttygen and adding the public key in the (2a)Google Cloud Platform website > Compute Engine Metadata > SSH keys Adding the same key to ~/.ssh/google_compute_engine.pub , and private key to ~/.ssh/google_compute_engine on the TPU VM using the web-console of GCP. (The key files where empty) When connecting with putty it timeouts

  2. Did step 1. but with this as the last line. gcloud alpha compute tpus tpu-vm ssh --zone europe-west4-a vm_name --ssh-key-file=C:\Users\my_username\Documents\putty_keys\gc (there are three files, gcloud adds the extensions, gc.pub with the public key, gc with the private key, and gc.ppk ) Putty does not connect.

  3. Did the reverse, created the ssh-keys on the TPU server using ssh-gen renamed keys to ~/.ssh/google_compute_engine.pub , and private key to ~/.ssh/google_compute_engine Copy pasted them to putty-gen to convert to windows putty keys, added keys using (2a) Connected putty to vm outside-ip and nothing.

  4. Created the ssh-keys on the TPU server using ssh-gen adding them to ~/.ssh/authorized_keys and installing them with ssh-copy-id and entering password Copied the keys to puttygen and used them to connect to VM ip.

I did more to connect, but to no avail.

What is the right way to connect to a TPU VM ? Note, it's not a Compute VM, it's a TPU. not the same settings as a VM in GCP console, so no nice add ssh key in the edit settings, because there ARE NO edit settings in GCPC.

I'm at a loss.

PS threw away the TPU instance and recreated it after each step, to make sure i wasn't messing things up too badly.

/EDIT:

i fixed it using this batch file

ECHO OFF
CLS
SET PATH=C:\Users\username\AppData\Local\Google\Cloud SDK\google-cloud-sdk\bin;%PATH%;
cd C:\Users\username\AppData\Local\Google\Cloud SDK
call gcloud config set compute/zone europe-west4-a
call gcloud config set account [email protected]
call gcloud config set project projectname
gcloud alpha compute tpus tpu-vm ssh --zone europe-west4-a username@TPU_VM
John Hanley avatar
cn flag
1) Stop playing around with setting SSH keys. 2) Where are you connecting to the TPU VM from? 3) Did you enable a firewall rule for port 22 ingress if connecting from outside Google Cloud. 4) launch a small VM in the same VPC network and connect from the VM to the TPU VM using the internal IP. Refer to the command line option `--internal-ip`.
John Hanley avatar
cn flag
5) Execute this command `gcloud alpha compute tpus tpu-vm ssh --dry-run`. Notice the output. You can then use a Windows SSH client to connect and debug such as Bitvise. Google sometimes does not test commands on Windows enough on alpha release features. Also notice the SSH port number. Edit your question with these details.
Score:1
eg flag

i fixed it using this batch file

ECHO OFF
CLS
SET PATH=C:\Users\username\AppData\Local\Google\Cloud SDK\google-cloud-sdk\bin;%PATH%;
cd C:\Users\username\AppData\Local\Google\Cloud SDK
call gcloud config set compute/zone europe-west4-a
call gcloud config set account [email protected]
call gcloud config set project projectname
gcloud alpha compute tpus tpu-vm ssh --zone europe-west4-a username@TPU_VM
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.