Google Certified Associate Cloud Engineer 2020

Sign Up Free or Log In to participate!

Zone Change

I was following along in this lab and set my VM’s zone as us-west2-b. When I do gcloud compute instances list, it showed the zone correctly as us-west2-b. However when I try to ssh using gcloud compute ssh myhappyvm, it gave me this message below:

"Did you mean zone [asia-southeast1-a] for instance: [myhappyvm] (Y/n)?

n

No zone specified. Using zone [us-west2-b] for instance: [myhappyvm].

Updating project ssh metadata…"

I did not see this happening when Rob was doing the Lab, so wondering if this happened because I am located in Asia and gcloud server simply tried to connect me to a nearer Zone or is there any other reason for this?

Appreciate your help!

Thanks,

Divya

2 Answers

Hmmm… That’s interesting, Divya.  I believe the default zone it offers will reflect your physical location as best as Google can determine from just your connection–but if the "compute/zone" property was still set, I wouldn’t expect it to prompt you, at all.  Before you ran gcloud compute ssh myhappyvm, did you possibly restart your Cloud Shell instance, run gcloud init, or somehow clear that "compute/zone" property?

Mattias

So in my case when I try to delete "myhappyvm" it prompts "Did you mean zone [asia-southeast1-b] for instance: [myhappyvm]" but thats not where my VM is….. not very sure why it even gives me such a message when it knows that my VM sits in "us-west2-b"

Upon reading very carefully when it prompts the wrong zone and when you say NO, then it wakes up and may be it tries to guess "No zone specified. Using zone [us-west2-b] for instance: [myhappyvm]." and then upon selecting "Y" it deletes my VM

Note: One of my VM "myvmclear" sits in zone asia-southeast1-b

———————–output from Command Line——————————————

[email protected]:~/.ssh (gcp-lab-226009)$ gcloud compute instances delete myhappyvm

Did you mean zone [asia-southeast1-b] for instance: [myhappyvm] (Y/n)?

Y

The following instances will be deleted. Any attached disks configured

to be auto-deleted will be deleted unless they are attached to any

other instances or the --keep-disks flag is given and specifies them

for keeping. Deleting a disk is irreversible and any data on the disk

will be lost.

  • [myhappyvm] in [asia-southeast1-b]

Do you want to continue (Y/n)? n

ERROR: (gcloud.compute.instances.delete) Deletion aborted by user.

[email protected]:~/.ssh (gcp-lab-226009)$ gcloud compute instances delete myhappyvm

Did you mean zone [asia-southeast1-b] for instance: [myhappyvm] (Y/n)?

n

No zone specified. Using zone [us-west2-b] for instance: [myhappyvm].

The following instances will be deleted. Any attached disks configured

to be auto-deleted will be deleted unless they are attached to any

other instances or the --keep-disks flag is given and specifies them

for keeping. Deleting a disk is irreversible and any data on the disk

will be lost.

  • [myhappyvm] in [us-west2-b]

Do you want to continue (Y/n)? Y

Deleted [https://www.googleapis.com/compute/v1/projects/gcp-lab-226009/zones/us-west2-b/instances/myhappyvm].

Sign In
Welcome Back!

Psst…this one if you’ve been moved to ACG!

Get Started
Who’s going to be learning?