How to create a VM on Google Cloud Platform | part 3

Опубликовано: 01 Январь 1970
на канале: CodingHacks
124
12

In this video, I will be showing you how to create a basic virtual machine in Google Cloud platform. We will start by basic overview of Google Cloud Platform after that I will show you how to create virtual machine instance of various machine types using Google cloud Platform. Let’s get started
Google Cloud Platform overview
Google Cloud platform is large set of physical assets such as computers, hard disk, processors and virtual assets such as Virtual Machines, services that are contained in Google Cloud data centers. Each data center is present in a global region and each region is a collection of zones. Each zone is isolated from each other within the same region.
This distribution provides us many facilities like data redundancy in case of zone failure, reduced latency by locating resources closer to client and also provided more control over resources and how they can be used to improve the service and reduce the cost.
As this is a cloud platform you don’t have to worry about physically buying the hardware, buying data centers and installing them. You can use all the hardware/software provided by google as services. In GCP these services provides you access to the underlying hardware. When you will start developing you will notice that you product is just a mix match of services provided by google and your code.
Prerequisites
Google account with billing enabled(If you are doing it for the first time just create a billing account using any credit/debit card with international transaction enables and you will get free credits from Google)
Let’s Start
First step will be to login to your Google cloud console and create a new project with any name you want. Now you might be thinking what is the role of project here I just want to create a virtual machine right?. So, think of project as an organizing entity. Any cloud platform resource that you allocate and use must belong to a project. After creating a project you will be able to see project info on your dashboard. This project info contains the project name which will help you to identify the project, Project ID which will help google cloud platform to identify your project and this will be unique for every project, Project Number which will be used by the support team incase you need any help with your project.
You have three ways to create a virtual machine
Create using Google Cloud Console.
Create using “gcloud” command line tool.
Create using Compute Engine REST API
In this article I will show you it using Google Cloud console and gcloud
Creating Virtual Machine Using Google Cloud Console
Click menu icon on the top left of the screen
Then navigate to Compute engine and VM instances. It may take some time for the first time when you click on VM instances but once its initialized you will see something like this(keep in mind you need to enable billing for your project to see this).
Click on create
As you can see here you can specify the name of the instance that you want to create. Specify the zone in which you want to create this instance. You can select the machine type that you want to use for your instance. There are large number of machines available from which you can select depending upon your requirement. You can even customize and create your own machine type.
You can also choose the boot disk that you want to use to boot this virtual machine from.
You can select the service account which will be used by this instance. Don’t worry about service account right now just think of it as a way for Google Cloud Platform to identify and authorize your virtual machine in case if it wants to communicate with other services of GCP.
Now, to allow incoming and outgoing traffic we have firewall rules and those are applied to Virtual Machines using tags.
There are customizations available related to management, disks, SSH etc. We will look into them in future. For now just click on create.
This creation process is asynchronous but once the instance is created you will see a green checkmark with the name of the instance.
Congratulations you have successfully created a virtual machine.
Click on the SSH link that you are seeing there. You will be able to see the console of your virtual instance and the cool thing is you have the root access for it without doing anything.

#GoogleCloudPlatform #CreateVMonGCP