Issues
On gcloud compute, I created an instance in project gvm. Then the command gcloud compute ssh
failed to log into that instance. The error message is
1 | $ gcloud compute ssh instance-1 |
Troubleshooting
According to this Google Cloud Document. The reason for this case is the instance zone and gcloud default zone are different. The command line didn’t specified the instance zone. So the google cloud compute default zone was used. Obviously, The instance should not be found in the default zone. Just adding the zone
option in command could solve the problem. The command format is like
1 | gcloud compute --project "gvm" ssh --zone "instance-zone" "instance-name" |
The cmd info could be fount in vm instances page in gcloud console.
- find the instance
- scroll the SSH list
- choose View gcloud command
This post is based on the original blog. The text and snapshot are updated.