Creating a Virtual Machine on Google Cloud

Guneet Kohli
4 min readNov 30, 2021

Google Cloud Platform, or GCP is a platform offered by Google which provides cloud computing services, collaboratively known as the SPI model of cloud computing. The SPI model is the most common service model which provides Software-as-a-Service(SaaS), Platform-as-a-Service(PaaS) and Infrastructure-as-a-Service(Iaas). GCP has various elements under the navigation menu, which provide these services to users.

Elements Of Google Cloud: GCP has various elements like Compute Engine, Google Cloud App Engine, Google Cloud Container Engine, Google Cloud Storage, Google Cloud Dataflow, Google BigQuery, Google Cloud Machine Learning Engine, etc. Each element has its own unique purpose. For instance, Google BigQuery can be used for analysis providing the user with SQL workplace as well as for the Administration part, which provides facilities like Monitoring, BI Engine, etc.

For creating a Virtual Machine, Cloud Engine under the Navigation Menu will be employed. Compute Engine is an IaaS service which provides user to work with virtual instances for workload hosting.

Steps for creation of a Virtual Machine

  1. Under the Navigation Menu, select Compute Engine and then click on VM instances.

2. Under the dropdown menu, click CREATE INSTANCE for creating a new instance and create a new VM instance by configuring various parameters, like Machine configuration, Bootdisk, Identity and API access along with firewalls.

3. Click CREATE. It will take a minute for the machine to be created. To check, if the machine is created successfully, check the VM instances page. The green mark against the status shows that the VM instance was succesfully created.

4. SSH(Secure Shell) also known as Secure Socket Shell, is a network protocol that gives users, particularly system administrators, a secure way to access a computer over an unsecured network.It is used to connect to virtual machine, in the row for your machine. To do this, click on SSH. Then a pop-up would appear which will ask the user if they want to initiate SSH connection.

5. After successfully connecting, SSH keys will be transferred to the VM and our VM, here Debian GNU/Linux is created.

CREATING A NEW INSTANCE USING COMMAND PROMPT

Instead of using the Cloud Console to create a virtual machine instance, one can use the command line tool, “gcloud”.

Command used for creation of VM instance,

“gcloud compute instances create <new-instance> — machine-type <machine-details> — zone <zone-name>”

THE NEW INSTANCE, GUNEET-KOHLI2 HAS THESE DEFAULT VALUES:

•The latest Debian 10 (buster) image.

•The n1-standard-2 machine type

  • A root persistent disk with the same name as the instance; the disk is automatically attached to the instance.

SSH is used to connect this newly created instance using via gcloud. The command used is,” gcloud compute ssh <new-instance> — zone <zone-name>”

After connecting to SSH, public/ private rsa key pair will be generated, and instance details will be presented.

To check, if the new instance was created successfully, go to the VM instances page, and check if the instances you created are present.

After creation of virtual machine, one can map existing server infrastructure, host a web page, create load balancers, network topology and what not to GCP.

The ascendancy of Virtualization and the indispensable need of creation of VMs, to optimize Quicker Desktop Provisioning and deployment. This technology is not only cost-effective, but it also assists the environment by reducing carbon footprint, because of its ability to cut down on number of servers and addressing ones needs logically rather than physically.

--

--

Guneet Kohli

Inquisitive CS grad, thriving in the world of Ravenclaws && Gryffindors.