Google Certified Associate Cloud Engineer 2020

Sign Up Free or Log In to participate!

Will the zone and region once set would not stay forever until i change it again?

So, i did setup zone and and region using the command from the video to us-west2-b and us-west2. But then when i got disconnected and log back into the shell, and when i login to my vm, its asking "Did you mean zone[us-central1-b] for instance [myhappyvm] ? , when i entered "n", it says No zone specified. Using zone [us-west2-b] for instance [myhappyvm]

As i did setup my vm setting the zone to what i want, and when i open my vm will it not know what region i created on? Also is there a command to know what region i did set my region and zone ?

1 Answers

Ah, yes! Good question, actually. The key thing here is that Cloud Shell, by default, is configured to store gcloud settings under /tmp/–which means that they will get cleaned up when your Cloud Shell instance is reset. To explore this further, you can run gcloud info or more specifically gcloud info | grep -i config. Here’s an example:

User Config Directory: [/tmp/tmp.zwBf8qMxlC]

Active Configuration Name: [cloudshell-22921]

Active Configuration Path: [/tmp/tmp.zwBf8qMxlC/configurations/config_cloudshell-22921]

To change this, though–and make gcloud act more like it would on a normal (i.e. non-CloudShell) installation–you can set the CLOUDSDK_CONFIG environment variable. For example, by running this:

CLOUDSDK_CONFIG=~/.config/gcloud  

And for your last question, the easiest way to list the properties currently set in your active configuration is with gcloud config list, but I talk more about this (including an alternative) in the "Rundown on gcloud" lecture.

I hope this helps!

Mattias

Sign In
Welcome Back!

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

Get Started
Who’s going to be learning?