GCP – Compute Engine



Join Telegram GCP Study Group

What is Google Compute Engine? 

  • Google Compute Engine (GCE) is a Virtual Machine which is created on the Google Cloud Infrastructure.
  • Google Compute Engine is an example of Infrastructure-as-a-Service (IaaS).
  • Google Compute Engine helps you to create scalable computing capacity on Google Cloud Infrastructure. It means you can spin up or spin down Compute Engine VMs on GCP based on your requirement.
  • Once you don’t need the computing capacity, you can stop the Compute Engine instance and then no cost will be incurred further.
  • You can choose Compute Engine configuration (like RAM, CPU etc) based on your requirement.




Join GCP – Professional Cloud Architect Online Training 

When to Choose Google Compute Engine?

  • When you need control over infrastructure and direct access to compute and network resources
  • When you need to make Operating System-level changes
  • While migrating the application, if you don’t want to rewrite the code



Ways to Create Google Compute Engine

  • You can create Compute Engine in three ways –
    • Using Google Cloud Console – Google Cloud Console in an UI using which you can easily navigate to different services and resources on the Google Cloud.
    • Using Command-line tool ‘gcloud – You can use Command-line tool gcloud also to create Compute Engine. 
      • You can run gcloud command on Cloud Shell which is accessed through browser itself. It is embedded in Cloud Console UI. 
      • Or, you can install Google Cloud SDK on your system and then can use gcloud command-line tool.
    • Using RESTful Compute Engine API – You use this option when you need to call the Compute Engine API service from your application’s code. You can do this by using Google-provided client libraries.


Create Google Compute Engine Instance

You need to specify below parameters to create Google Compute Engine instance –

  • Specify the Region and Zone in which you want to create it. Based on the Region, the cost to create the instance will vary. 
  • For workloads like machine learning and data processing – take advantage of GPUs. Many GCP zones have GPU’s available.
  • You need to install Operating system, other required software and other configurations to create Compute Engine instance. So, you can use Images.
  • You need to attach a persistent storage boot disk to Compute Engine instance. This is needed to install Operating System, store data etc. Apart from the primary boot disk, you can create multiple secondary boot disks for Compute Engine instance.
  • There are different ways in which pricing is done on Compute Engine instance resources. Also, there are multiple Discount Options which you can avail based on your requirement.

Startup Script

  • Startup script is used to start VMs with certain configurations like installing software packages on first boot. 
  • Other kinds of metadata can also be passed in the startup script.

Instance Groups

  • In case of horizontal scaling or scale-out, VM instances are added and removed as per the need.
  • You can create Instance Group for specified purpose and add or remove VM instances as per the traffic.

Scale-up and Scale-out Use Cases

  • For Memory-intensive and Compute-intensive workloads, scale-out option is preferred; where you add more RAM and CPUs to the same VM.
  • For resilient and scalable solutions, scale-up option is preferred; where you create more VMs to handle increase in traffic.

Reference Topics Covered on this Page


Leave a Comment

Your email address will not be published. Required fields are marked *