
Overview
Google Cloud SDK contains tools and libraries that enable you to easily create and manage resources on Google Cloud Platform, including App Engine , Compute Engine , Cloud Storage , BigQuery , Cloud SQL , and Cloud DNS .
Lab Details
In this lab we will learn how to install Cloud SDK to a virtual machine, initialize it and run core gcloud commands from the command-line.
The Cloud SDK RPM packages are supported for Red Hat Enterprise Level 7 and CentOS 7.
Set up a VM to configure and use SDK
Create a VM with either Centos or Redhat. You can choose which one to use, the steps will be the same.
In the Cloud Console, go to Compute Engine > VM instances, then click Create.
In the Boot disk section, click Change to begin configuring your boot disk:
- Choose CentOS 7, then click the Select button.

In the Firewall section, select Allow HTTP traffic.
Click Create.

Update the Cloud SDK RPM packages
The Cloud SDK RPM packages are supported for Red Hat Enterprise Level 7 and CentOS 7. They may also work on Fedora systems using yum or dnf, but this has not been tested.
- Login to the newly created my-vm using ssh.
2. Run the following in the SSH window to set up Cloud SDK:
# Update YUM with Cloud SDK repo information:sudo tee -a /etc/yum.repos.d/google-cloud-sdk.repo << EOM
[google-cloud-sdk]
name=Google Cloud SDK
baseurl=https://packages.cloud.google.com/yum/repos/cloud-sdk-el7-x86_64
enabled=1
gpgcheck=1
repo_gpgcheck=1
gpgkey=https://packages.cloud.google.com/yum/doc/yum-key.gpg
https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg
EOM# The indentation for the 2nd line of gpgkey is important.# Install the Cloud SDKsudo yum install google-cloud-sdkcontent_copy

3. Respond Y when prompted to confirm the total download size.


Initialize the SDK in your instance
Use the gcloud init
command to perform several common SDK setup tasks. These include authorizing the SDK tools to access Google Cloud using your user account credentials and setting up the default SDK configuration.
- To initialize the SDK, run the following:
gcloud init --console-only
Note: This prevents the gcloud init
command from launching a web browser.
2. Choose option 2, to log in with a new account.

3. You will get confirmation that you’re running on virtual machine. Type Y to allow the credentials you logged into the lab with (this is your personal account for this lab) to be used to authenticate your account.

4. You’ll be given a long URL click on it or paste it into a new browser.

5. Now Login with your personal GCP credentials. you will be presented with a Verification code.
6. Copy the code and paste it into the SSH window at the command prompt, then press Enter.

7. Now type the number corresponding to you Project ID.
You will see a confirmation that you have completed the setup steps successfully that will look like this:

You are all set to use cloud SDK now!!
Run core “gcloud“ commands
Run these gcloud
commands to view information about your SDK installation:
- List accounts whose credentials are stored on this VM:
gcloud auth list
A list of credentialed accounts displays:

2. This command will list the properties in your active SDK configuration:
gcloud config list
The list of properties will display:

3. Run the following to view information on your Cloud SDK installation and the active SDK configuration:
gcloud info
The summary includes information about:
- your system
- the installed SDK components
- the active user account and current project
- the properties in the active SDK configuration

4. You can see information about gcloud
commands and other topics from the command line by running the following:
gcloud help compute instances create
You’ll see a help topic that contains a description of the command, a list of command flags and arguments, and examples of how to use it.
Working with gcloud : VM Creation Scenarios
The gcloud auth list command Lists accounts whose credentials have been obtained using gcloud init
, gcloud auth login
and gcloud auth activate-service-account
, and shows which account is active. The active account is used by gcloud and other Cloud SDK tools to access Google Cloud Platform. While there is no limit on the number of accounts with stored credentials, there is only one active account.
Below Command shows that “rajeevgcp21@gmail.com” is the current active account.

Now Let’s try to create a VM using below command:
gcloud compute instances create my-vm2

You will see that a vm called “my-vm2” is up and running.
Now Try to change the active account to 331552173063-compute@developer.gserviceaccount.com using below command:
gcloud config set account 331552173063-compute@developer.gserviceaccount.com

Now try to create another vm called “my-vm3″ using below command:
gcloud compute instances create my-vm3
We get an error. why So?

The reason we get the error is because we have not authenticated to gcloud init with the service account 331552173063-compute@developer.gserviceaccount.com.
Note: We can’t use service account to login to GCP directly either.
Interestingly when we have created “my-vm2” using account “rajeevgcp21@gmail.com”, it used the service account — 331552173063-compute@developer.gserviceaccount.com to create the VM.
See below.

Confusing ?? Give it a thought.
Your article helped me a lot, is there any more related content? Thanks!
Your point of view caught my eye and was very interesting. Thanks. I have a question for you.
Reading your article helped me a lot, but I still had some doubts at the time, could I ask you for advice? Thanks.
Great blog, I follow you with pleasure, I admire your articles. You are also welcome to visit our website.
Great blog, I follow you with pleasure, I admire your articles. You are also welcome to visit our website.
tiktok follower kaufen
We are a bunch of volunteers and starting a new scheme in our
community. Your site provided us with useful info to work on. You’ve done an impressive process and
our entire neighborhood will be grateful to you.
Look into my web site – http://www.comptine.biz/modules.php?name=Your_Account&op=userinfo&username=ArguetaRoberto
Spot on with this write-up, I absolutely think this
site needs far more attention. I’ll probably be back again to read through more, thanks for the advice!
Howdy just wanted to give you a quick heads up and let you know a few of the images aren’t loading properly.
I’m not sure why but I think its a linking issue. I’ve tried it
in two different internet browsers and both show the same outcome.
my site :: http://forum.charmanders-underground.com/index.php?action=profile;u=786106
Hi there! I’m at work surrfing afound your blog from
mmy new iphone 3gs!Just wanted to say I love reading through your blog and look forward tto alll your posts!
Carry on the outstanding work!
I do trust all the ideas you’ve presented for your post. They are very convincing and will certainly work.
Nonetheless, the posts are too quick for beginners.
May just you please extend them a little from next time?
Thanks for the post.
Here is my page … wrinkle skin
Howdy, i read your blog occasionally and i own a similar one and
i was just wondering if you get a lot of spam comments? If so how do you stop
it, any plugin or anything you can suggest?
I get so much lately it’s driving me insane so any support is very much appreciated.
Also visit my site … summer skin care tips
I’ve been exploring for a bit for any high quality articles or
weblog posts in this kind of house . Exploring in Yahoo I finally stumbled upon this web site.
Studying this information So i’m satisfied to express that I have an incredibly good skin care uncanny feeling I found out exactly what I needed.
I such a lot for sure will make sure to don?t overlook this website and give it a glance on a relentless basis.
Hey there! Quick question that’s totally off topic.
Do you know how to make your site mobile friendly?
My website looks weird when viewing from my iphone 4.
I’m trying to find a theme or plugin that might be able to resolve this issue.
If you have any recommendations, please share. With thanks!
I?m impressed, I have to admit. Rarely do I encounter a blog that?s equally
educative and engaging, and without a doubt, you’ve
hit the nail on the head. The issue is something that too
few folks are speaking intelligently about. I am very happy
I found this during my search for something regarding this.
My homepage … lose weight
Wow, amazing weblog format! How lengthy have you ever been blogging
for? you made blogging look easy. The total look of your
site is magnificent, as neatly as the content!
Awsome site! I am loving it!! Will be back later to read some more.
I am bookmarking your feeds also
Here is my web-site :: agrocase.ru
I’d incessantly want to be update on new posts
on this website, saved to fav!
Stop by my page :: fat burning
It is not my first time to visit this web site, i am visiting this website dailly and get good data from
here every day.
Hello, i think that i saw you visited my website so
i came to “return the favor”.I’m trying to find things to
enhance my site!I suppose its ok to use a few of your ideas!!
Hello, Neat post. There is an issue with your website in web
explorer, might test this? IE still is the marketplace chief and a big component to other people will
omit your great writing because of this problem.
I am genuinely grateful to the holder of this website
who has shared this enormous article at at this time.
It’s actually a cool and useful piece of info.
I am happy that you just shared this useful info with us.
Please stay us up to date like this. Thanks for sharing.
Here is my homepage http://www.consulenzaleonardo.com
This excellent website truly has all the information I wanted concerning this subject and didn’t know
who to ask.
Look at my blog post marijuana seeds
Hurrah! After all I got a webpage from where I can genuinely take useful
facts regarding my study and knowledge.
Feel free to visit my homepage :: Johnie
What’s up Dear, are you actually visiting this website daily, if so then you will
absolutely get fastidious know-how.
Here is my web-site … oily skin
Undeniably consider that that you stated. Your favorite justification appeared to
be on the internet the simplest factor to be aware of.
I say to you, I certainly get irked at the same time as people
think about issues that they just do not understand about.
You controlled to hit the nail upon the top as neatly as outlined out the whole thing without
having side-effects , folks could take a signal. Will probably be back to get more.
Thank you
Hey! I know this is somewhat off topic but I was wondering which blog platform are you using for this site?
I’m getting fed up of WordPress because I’ve had issues with
hackers and I’m looking at options for another platform.
I would be great if you could point me in the direction of a good platform.
Feel free to visit my blog … beef protein
Hello there, I found your site via Google at the same time as searching for a comparable
matter, your site got here up, it looks good. I have bookmarked it in my google bookmarks.[X-N-E-W-L-I-N-S-P-I-N-X]Hi there, simply turned into alert to your weblog thru Google, and located that
it is really informative. I am gonna watch out for brussels.
I’ll be grateful when you continue this in future.
Lots of other folks will probably be benefited from
your writing. Cheers!
Also visit my website; natural libido pills
Very energetic article, I enjoyed that a lot.
Will there be a part 2?
My website … potatoes diet
I believe this web site has some very fantastic info for everyone :D.
my website skilled drug
The other day, while I was at work, my cousin stole
my iPad and tested to see if it can survive a thirty foot drop, just so
she can be a youtube sensation. My apple ipad is now destroyed
and she has 83 views. I know this is completely off topic but I had to share
it with someone!
Check out my webpage :: healthy skin care
Hello. remarkable job. I did not imagine this. This is a impressive story.
Thanks!
my webpage men skin products
I am not sure where you are getting your information, but good topic.
I needs to spend some time learning more or understanding more.
Thanks for excellent information I was looking for this info for my
mission.
Feel free to visit my web-site … carb nite solution
Hey there! Someone in my Myspace group shared this website with us so I
came to give it a look. I’m definitely enjoying the information. I’m bookmarking and will be
tweeting this to my followers! Outstanding blog
and superb design and style.
My coder is trying to convince me to move to .net from PHP.
I have always disliked the idea because of the
expenses. But he’s tryiong none the less. I’ve been using Movable-type on numerous websites for
about a year and am worried about switching to another
platform. I have heard great things about blogengine.net.
Is there a way I can transfer all my wordpress content into it?
Any kind of help would be really appreciated!
Here is my page … south beach diet
It’s fantastic that you are getting ideas
from this paragraph as well as from our argument made here.
Link exchange is nothing else but it is simply placing the other person’s web site link on your page at
appropriate place and other person will also do same for
you.
Feel free to visit my page 192.190.225.244
Hi, Neat post. There is a problem with your web site in web explorer, might
test this? IE nonetheless is the marketplace leader and a large portion of people will pass over your fantastic writing due to this problem.
Feel free to visit my page: skin care routine
Why people still make use of to read news papers when in this technological globe the whole thing is existing on net?
my web-site :: donkhamin.go.th
Hi, i think that i saw you visited my blog thus i came to “return the favor”.I am attempting to find things to enhance my
website!I suppose its ok to use some of your ideas!!
Thanks very nice blog!
Awsome blog! I am loving it!! Will come back again. I am taking
your feeds also
My site: review pre-workout supplements
Appreciate the recommendation. Will try it out.
You actually make it seem so easy with your presentation but I find this matter to be really something that I think I would never understand.
It seems too complicated and extremely broad for me.
I’m looking forward healthy eating tips for weight loss your next post, I
will try to get the hang of it!
I drop a leave a response when I especially enjoy a post on a site or if I have something to add to the discussion. Usually it is triggered by the sincerness communicated in the article I looked at.
And after this article Google Cloud: Introduction to Cloud SDK -.
I was moved enough to drop a comment 😛 I actually do have a couple of questions for you if it’s allright.
Is it just me or do a few of the responses appear as if they are written by brain dead
folks? 😛 And, if you are posting at additional places, I
would like to keep up with you. Would you list the complete urls of your community pages like your twitter feed, Facebook page or linkedin profile?
My page … http://www.hjzzj.com/
Great info once again. Thank you!
My homepage … routine skin
My developer is trying to convince me to move
to .net from PHP. I have always disliked the idea because of the costs.
But he’s tryiong none the less. I’ve been using WordPress on a variety of websites for about a
year and am worried about switching to another platform.
I have heard good things about blogengine.net. Is there a
way I can import all my wordpress content into it? Any kind
of help would be really appreciated!
I’ve been exploring for a little bit for any high quality articles or weblog posts in this kind of area .
Exploring in Yahoo I at last stumbled upon this web site.
Studying this info So i am glad to show that I have an incredibly excellent uncanny feeling
I discovered exactly what I needed. I most for sure will make sure to do not disregard
this web site and give it a look on a relentless basis.
Also visit my webpage – thaipurchase.com
I am glad to be one of several visitants on this outstanding site (:, thanks for posting.
Also visit my page … higher testosterone level