Google Compute Engine (GCE)

  • Linux-based and Windows-based virtual machines
  • Each instance you create belongs to a project
  • A project can have one or more instances

Configurations

  • Generally, when you create an instance, you should specify the following.
    • Zone
    • Operating System
    • Machine type
      • General purpose (E2, N1, N2, N2D) – provides a good balance of price and performance
      • Compute optimized (C2) – offers high-end vCPU performance for compute-intensive workloads
      • Memory optimized (M2) – offers the highest memory and are great for in-memory databases
      • Accelerator optimized (A2) – these machines are based on the A100 GPU, for very demanding applications
      • You can also create custom machine types depending on your infrastructure need.
    • Storage Options
      • Zonal persistent disk: Efficient, reliable block storage.
      • Regional persistent disk: Regional block storage replicated in two zones.
      • Local SSD: High performance, transient, local block storage.
      • Cloud Storage buckets: Affordable object storage.
      • Filestore: High-performance file storage for Google Cloud users.

Instance Templates

  • Instance templates are a convenient way to save a VM instance’s configuration so you can use it later to create VMs or groups of VMs.
  • You can use instance templates to provision a MIG or create individual VMs.
  • An instance template is a global resource that is not attached solely to a zone or a region. However, since you need to specify some zonal resources in an instance template, this restricts the template to the zone where that resource is located.

Instance Groups

  • An instance group is a set of virtual machine (VM) instances that you can collectively manage as a single entity.
  • IT Certification Category (English)728x90
  • There are two kinds of VM instance groups, namely:
    • Managed Instance Groups (MIGs)
      • Let you operate apps on multiple identical VMs.
      • MIG is scalable and highly available
      • It supports autoscaling, autohealing, regional (multiple zone) deployment, and automatic updating.
      • MIG can be set to perform autohealing to keep your instances running at all times. Activating this triggers health checks to determine the status of instances and will try to recreate them when an instance is unhealthy.
    • Unmanaged Instance Groups
      • Lets you load balance across a fleet of virtual machines (VMs) that you manage yourself.

Managing access to your instances

  • Linux instances
    • Manually create SSH keys in metadata
    • Use OS Login to associate SSH keys with your Google Account or G Suite Account and manage admin and non-admin access to the instance through IAM roles.
      • If you connect to your instance using the gcloud command-line tool or SSH from console, Compute Engine automatically generates SSH keys for you and applies them to your Google Account or GSuite Account.
      • If you manage your SSH keys by using OS Login on instances, metadata-based SSH key configurations on those instances are disabled.
  • Windows Server
    • Create a password for a Windows Server instance

Backing up your instance

  • To backup instances stored on regional and zonal persistent disks, Google Cloud gives you the ability to create snapshots. You can create snapshots from disks even while they are attached to running instances.
  • Snapshots are global resources, which means you can utilize them to restore data to a new disk or instance within the same project regardless of location. Moreover, you are also allowed to share snapshots across different projects.
  • It is best practice to create a snapshot schedule to regularly backup your instance.

Sole-tenant Nodes

  • A physical Compute Engine server dedicated exclusively for your use.

Preemptible Instances

  • A preemptible VM is an instance that you can provision at a much lower price point than normal instances.
  • Compute Engine might stop preemptible instances at any time due to system events.
  • This is perfect for fault-tolerant applications that can withstand possible instance preemption.

Shielded Instances

  • Offers verifiable integrity of your Compute Engine VM instances, so you can be confident that your instances haven’t been compromised by boot- or kernel-level malware or rootkits.
  • Shielded VM’s verifiable integrity is achieved through the use of:
    • Secure Boot
    • Virtual trusted platform module (vTPM)-enabled Measured Boot
    • Integrity monitoring.

Instance Life Cycle

An instance can have the following states:

  • Provisioning – means that resources are being allocated for the instance.
  • Staging – means that resources have been acquired and the instance is being prepared for the first boot.
  • Running – means that the instance is booting up and running. You should be able to ssh into the instance soon, but not immediately after it enters this state.
  • Stopping – means that the instance was stopped. This can be a user-made request or there was a failure. This serves as a temporary status and the instance will move to terminated state.
  • Repairing – means that the instance is being repaired. This can happen when the instance encountered an internal error or the machine is unavailable due to some maintenance.
  • Terminated – means that a user explicitly shut the instance down or the instance has encountered a failure.
  • Suspending – means that the instance is being suspended. A user has suspended the instance.
  • Suspended – means that the instance was suspended.

GCP Marketplace

  • To quickly deploy a Compute Engine instance, you can utilize the Google Cloud Marketplace which offers a wide array of loud solutions that you can choose from to quickly deploy your application.

Live Migration

    Tutorials Dojo Study Guide and Cheatsheet
  • GCE offers live migration to keep your virtual machine instances running even when a host system event, such as a software or hardware update, occurs.
  • Instead of requiring your VMs to be rebooted, GCE live migrates your running instances to another host in the same zone keeping infrastructure protected and reliable without interrupting any of your virtual machines.
  • Google provides a notification that migration is imminent when a VM is scheduled to be live migrated.

Pricing

  • Custom Machine Types
  • Reservation
    • You can create reservations for Virtual Machine instances in a specific zone.
  • Disk Pricing
    • Persistent disks are priced by the amount of provisioned space per disk.
  • Preemptible VMs
    • Low-cost, short-term instances designed to run batch jobs and fault-tolerant workloads.
    • Preemptible VM instances provide a significant amount of savings of up to 80%.
  • Suspended VM Instances
    • You will not be charged for the instance as if it was running, but suspended instances still incur charges for the following:
      • Memory and Device State
      • Persistent disk usage
      • Static IPs attached to the VM instance
    • Sustained Use Savings
      • Are automatic discounts when running specific Compute Engine resources for a significant portion of the billing month.
    • Commitment Savings
      • You can get committed use discounts by purchasing committed use contracts for instances you want to provision with no up-front cost or instance-type lock-in.
      • You commit to pay for provisioned resources for 1 year or 3 years.
      • The discount can be up to 57% for most resources

References:
https://cloud.google.com/compute
https://cloud.google.com/compute/docs/
https://cloud.google.com/compute/docs/instance-templates
https://cloud.google.com/compute/docs/instance-groups

New Year Sale – Upgrade Your Skills and Get a Chance to Win FREE Courses

NEW Course – AWS Certified Data Analytics Specialty Practice Exams

AWS Certified Data Analytics Sepcialty

Pass your AWS and Azure Certifications with the Tutorials Dojo Portal

Tutorials Dojo portal

Our Bestselling AWS Certified Solutions Architect Associate Practice Exams

AWS Certified Solutions Architect Associate Practice Exams

Enroll Now – Our AWS Practice Exams with 95% Passing Rate

AWS Practice Exams Tutorials Dojo

Enroll Now – Our Azure Certification Exam Reviewers

azure reviewers tutorials dojo

Tutorials Dojo Study Guide and Cheat Sheets eBooks

Tutorials Dojo Study Guide and Cheat Sheets-2

FREE Intro to Cloud Computing for Beginners

FREE AWS Practice Test Samplers

Browse Other Courses

Generic Category (English)300x250

Recent Posts