Google Cloud: Creating VM’s Through GCP console and Command Line

Share At:

Introduction

Google Cloud Platform (GCP), offered by Google, is a suite of cloud computing services that runs on the same infrastructure that Google uses internally for its end-user products, such as Google Search, Gmail, file storage, and YouTube.[1] Alongside a set of management tools, it provides a series of modular cloud services including computing, data storage, data analytics and machine learning.[2] Registration requires a credit card or bank account details.[3]

Google Cloud Platform provides infrastructure as a service, platform as a service, and serverless computing environments.

In this tutorial, we’ll understand how to launch VM instances in Google Cloud platform through “GCP console” and through Command Line using “gcloud Shell”.

Prerequisites:

  1. It Is believed that you have already setup your free account for GCP.

Check this link for free sign up: https://cloud.google.com/free

2. Check GCP’s documentation what is free and what not, so that you don’t incur charges at end of the month.

Caution: While launching VM and selecting Machine Type, at the right hand of your screen, It will show you the monthly estimate of the machine. Please check this out before launching the machine.

Create a virtual machine using the GCP Console

  1. In the Navigation menu , click Compute Engine > VM instances.
  2. Click Create.

3. On the Create an Instance page, for Name, type my-vm-1

4. For Region and Zone, select the region as us-central1 and Zone as us-central1-a

5. For Machine type, Select e2-Micro.

6. For Boot disk, if the Image shown is not Debian GNU/Linux 9 (stretch), click Change and select Debian GNU/Linux 9 (stretch).

7. Leave the defaults for Identity and API access unmodified.

8. For Firewall, click Allow HTTP traffic.

9. Leave all other defaults unmodified.

10. To create and launch the VM, click Create.

Note: The VM can take about two minutes to launch and be fully available for use.

11. Now click on the SSH Icon next to it. You will see a terminal opens up. Run some commands to validate your settings.

Create a virtual machine using the gcloud command line

Now let’s understand how to create VM’s in GCP through gcloud shell. Please perform next steps:

12. In GCP console, on the top right toolbar, click the Open Cloud Shell button:

13. You will see a window like below. Click Continue.

14. To display a list of all the zones in the region enter this command:

gcloud compute zones list | grep us-central1

15. To set your default zone to another zone ( us-central1-b), enter the below command

gcloud config set compute/zone us-central1-b

16. Now Lets create another VM using command line.

  • To create a VM instance called my-vm-2 in that zone, execute this command:
  • You will see your new VM has been launched:

That concludes our Tutorial.

Happy Learning !!!


Share At:
0 0 votes
Article Rating
Subscribe
Notify of
guest
7 Comments
Newest
Oldest Most Voted
Inline Feedbacks
View all comments
Lavina
1 month ago

Hmm is anyone else experiencing problems with
the images on this blog loading? I’m trying to find out if its
a problem on my end or if it’s the blog.
Any feedback would be greatly appreciated.

Marlon
1 month ago

At this time it looks like WordPress is the best blogging platform out there right now.
(from what I’ve read) Is that what you are using on your blog?

Annette
1 month ago

You need to take part in a contest for one of the greatest sites on the internet.
I am going to highly recommend this site!

Hayley
1 month ago

Wow that was strange. I just wrote an very long comment but after I clicked submit
my comment didn’t show up. Grrrr… well I’m not writing all that over again. Anyhow, just wanted to say fantastic blog!

Jacquie
2 months ago

What’s up to every body, it’s my first pay a quick visit of this weblog;
this web site carries awesome and really good information in support of readers.

dedicated server hosting

Your style is unique in comparison to other folks I have read stuff from.
Thank you for posting when you have the opportunity,
Guess I will just book mark this site.

Back To Top

Contact Us