In conversation with GCP | Part-1

In this blog, we shall be looking at following concepts :-

  • Introduction to Regions in GCP.
  • Introduction to Zones in GCP.
  • Increasing Fault Tolerance within same region.
  • Increasing Availability across the regions.
  • GCP resources & Interfaces.
  • Setting up Compute Engine (VM Instance) @ GCP.
  • Difference between External & Internal IP Address.
  • Associating Static External IP Address.
  • StartUp-Script to specify softwares at launch of Instance.
  • Generating Instance Template.
  • Launching VM instances using Custom-Image

Question:- What is a Region in GCP ?

Answer:- Regions are independent geographic area that consist of zones. And this is like you can think of it’s a partition independent area.

The main purpose is to host application near to your users reduce latency unavailability and durability.

Question:- What are Zones in GCP ?

Answer:- Zones are the actual physical locations inside the Regions.

Question:- How many Regions and Zones are there as of now ?

Answer:- There are 20 regions which are out there right now 61 zones. These are the 61 physical location. That’s where I have data centers. You can think of as an actual data-center. It is available in 200 plus countries.

Question:- What are the challenges associated with single data centre in one Region ?

Question:- How do we address the problem of a Data Centre crash in above scenario ?

Answer:- Solution is to add the another data centre in same region.

Question:- How do we address the problem of Crash of full region t

Answer:- Solution is to have multiple regions and each region would have multiple data centres in it.

Question:- What’s the advantage of procuring services from Goggle in above situations ?

Question:- How do we achieve Increased availability within same region ?

Question:- List down some examples of Regions & their respective zones in GCP ?

Question:- Which all services are provided by GCP ?

Answer:- There are plenty of services being provided by GCP :-

Following are the services chart available from GCP side :-

Following are the Management related tools available from GCP side :-

Question:- What all Interfaces are possible in GCP ?

Answer:- Following are various interfaces available in GCP :-

Here is how the CLI looks like. These days, there are options for GCP shell as well :-

Question:- What is the Project in GCP ?

Answer:- Project is container in JCP. If we created this account there is a default project which is created for you.

Shutting down the project means it is going to decommission all your cloud resources in your project :-

NOTE:- The charging happens at the Project level.

Question:- What are the GCP Resources ?

Answer:- Anything which is you can think of. For example :-

  • If you go ahead and create virtual machine.
  • If you go ahead and create App Engine instance.
  • If you create a SQL database.
  • If you create a network.
  • If you want to create a firewall rules.

Question:- What are the various types of GCP Resources ?

Answer:- There are three types of resources :-

Below is how the resources are organised usually :-

Question:- What is a Quota in GCP ?

Question:- What are the benefits of Quota in GCP ?

Question:- On which basis, does Project Quotas and Limits works in GCP ?

Question:- How and where do we access Infrastructure in Google’s parlance ?

Question:- What are the features of the Google Compute Engine ?

Question:- Which are the various families available for the Google Compute Engine ?

Question:- Which are the various variants available under E2 family of VM ?

Question:- How do we know the RAM & CPU available with eachVM type ?

Question:- Which OS do we install at our VM ?

Question:- Demonstrate an example for launching a simple Compute-Engine in GCP ?

Step #1.) Go to VM Instances :-

Step #2.) Specify the name of the Instance, allocate some labels to it and choose from region & zone :-

Step #3.) Choose the family type with which instance to work :-

Step #4.) Select the HDD to be attached with the VM instance :-

Step #5.) Let’s now choose the operating-System to install on our Compute-Engine instance :-

Step #6.) Last but not least, we select the Firewall rules :-

Step #7.) Finally, we have the instance launched here :-

Question:- Demonstrate the setting up of an Apache Web Server on the afore-launched Google Compute Engine VM Instance ?

* sudo su
* apt update
*
apt install apache2
* echo "Hello world from $(hostname) $(hostname -i)" > /var/www/html/index.html
* sudo service apache2 start

Question:- What’s the concept of the External & Internal IP Address ?

Question:- Now so, we know that each time our VM instance is restarted, External IP Address changes, how do we solve this problem ?

Answer:- The solution is to use Static External IP Address. Here are steps to create the same :-

Step #1.) Let’s search into our console : “External IP Addresses”.

Step #2.) Let’s now click on “Reserve Static Address” and work with the same :-

Step #3.) Let’s create a static address :-

Step #4.) Next, we click on button “CHANGE”. Note in the below snapshot that, there is a new row for external ip-address has been created well :-

Step #5.) Now, allocate this ip-address to our compute-engine instance :-

Step #6.) Here is our compute-engine instance has been binded with External IP Address :-

Question:- What are the other important features of the “Static IP Address” ?

Question:- How do we release the “Static IP Address” ?

Question:- How do we reduce the number of steps, while creating VM instance ?

Concept #1.) :- Demonstrate the process of setting up an HttpServer using the Startup-script ?

Step #1.) Let’s create a new VM compute-engine instance :-

Step #2.) Next step is to create the management :-

Step #3.) Following is the startUp-script, that we can specify at the time of the boot up. This is also called as StartUp Script.

Now, using StartUp Script, we have reduced the time that we would perhaps had to invest post boot-up. Also, we can install OS patches and software @ the time of VM launch itself.

Concept #2.) :- What is an “Instance Template” and why do we need it ?

Answer:- Basically, while launching the VM instance, we need to mandatorily specify the hardware-details, VM instance details like Instance-Type, etc. and then specify the startup-scripts. This is a very time-consuming process. We can avoid all of them by specifying instance-template.

Question:- Demonstrate the step by step process of creating a “Instance Template” and launching the VM from this template ?

Step #1.) In the GCP console, click inside the “Instance Template” :-

Step #2.) While creating the “Instance Template”, we can specify the machine type and family of compute-engine :-

Step #3.) Next, we can also specify the disk capacity along with the OS that we would want :-

Step #4.) Next, we allow the Incoming traffic from Internet over Http and therefore, we select the option #1 below :-

Step #5.) Next, we specify the startUp-script which here shall be used as automation-script :-

Step #6.) Finally, we have the Instance-Template created with us. Next, we click on the “Create VM” from it :-

Step #7.) At the end, we have our VM instance created from this template :-

Question:- What’s the problem with launching VM instances using this VM Template ? How same can be solved ?

Answer:- Yes, this process increases boot-up time for our compute-engine-instances. This is something, which we shall definitely like to avoid in the production auto scaling scenarios. This problem can be solved by using Custom-Image, to launch VM instances.

Concept #3.) :- Demonstrate the process of creating the Custom-Image and launching VM instance from that Custom-Image ?

Answer:- The Custom-Image can be created using the HDD (Disk) of any running VM instance. So, It’s necessary to have at-least full-fledged running VM instance, with the help of which we can create custom-image.

Step #1.) Let’s goto the disk of our own VM instance, that we launched above :-

Step #2.) Now, select the image-name and below details :-

Step #3.) Hit on the click button :-

Step #4.) Here are our images we have finally :-

Step #5.) Now, we can create VM instances using the template that we created above :-

Step #6.) Next we select the image using which instance has to be launched :-

Step #7.) Finally, we have the VM instance with us :-

That’s all in this section. If you liked reading this blog, kindly do press on clap button multiple times, to indicate your appreciation. We would see you in next series.

--

--

--

Software Engineer for Big Data distributed systems

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Convert Unity Project to URP

Lightning 201: Lightning Latency — Suredbits

Happy Number with Ruby

Junior vs Senior Developers, and Why They Both Matter

What is HTML | Features | properties | Limitations:

17th PXP Burn Completed

How to connect wirelessly to an android device for development

AWS: Introduction to Cloud Computing

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
aditya goel

aditya goel

Software Engineer for Big Data distributed systems

More from Medium

GCP Cloud Run (Part 1)

Google Cloud Platform Overview

Google Cloud Platform | QB3

Deploy and Manage Cloud Environments with Google Cloud: Challenge Lab

Deploy and Manage Cloud Environments with Google Cloud: Challenge Lab

Cloud Functions and Cloud Scheduler using Pub/Sub triggers