1. Home
  2. Blog
  3. Computer Science & IT
  4. Google Compute Engine (GCE): Virtual Machines on Google Cloud Explained

Google Compute Engine (GCE): Virtual Machines on Google Cloud Explained

Google Compute Engine (GCE)
On this page
  1. What is Google Compute Engine used for?
  2. How Compute Engine works
  3. Machine families and series
  4. Storage options
  5. Creating a VM: a quick example
  6. Scaling and reliability
  7. Pricing basics
  8. Compute Engine vs App Engine vs Cloud Run vs GKE
  9. Pros and cons of Compute Engine
  10. FAQs
  11. Related Topics on EngineeringHulk

Google Compute Engine (GCE) is Google Cloud’s Infrastructure-as-a-Service (IaaS): it lets you create and run virtual machines (VMs) on Google’s data centres and pay per second for what you use. You choose the operating system, the number of vCPUs, memory, disks and network, and you manage everything from the OS upward. It is Google’s direct equivalent of Amazon EC2 and Azure Virtual Machines.

Advertisement

What is Google Compute Engine used for?

  • Hosting websites, APIs and backend servers that need a full Linux or Windows machine.
  • Running databases such as MySQL or PostgreSQL yourself, when you want control that a managed service does not give.
  • Training and serving machine-learning models on attached GPUs.
  • Batch jobs, rendering, scientific simulation and CI build agents, often on cheap Spot VMs.
  • “Lift and shift” migration: moving existing on-premises servers to the cloud without rewriting them.

How Compute Engine works

Every VM (Google calls it an instance) is made of a few building blocks that you pick when you create it:

Building block What you choose Example
Region and zone Where the VM physically runs asia-south1-a (Mumbai), asia-south2 (Delhi)
Machine type vCPUs and memory e2-standard-4 = 4 vCPUs, 16 GB RAM
Boot image Operating system Debian, Ubuntu, Rocky Linux, Windows Server
Disks Block storage for the OS and data Persistent Disk, Hyperdisk, Local SSD
Network VPC, subnet, IP address, firewall rules Allow TCP 80/443 for a web server
Provisioning model Standard (on-demand) or Spot Spot for fault-tolerant batch work

Under the hood each VM runs on Google’s KVM-based hypervisor. Google can live-migrate running VMs to another host during maintenance, so most hardware work happens without a reboot.

Machine families and series

Machine types are grouped into families by workload. The series names change as Google releases new hardware; this is the line-up listed in Google’s documentation as of 2026:

Family Series Good for
General-purpose E2, N4, N4D, N2, N2D, N1, C4, C4D, C3, C3D, Tau T2D; Arm: N4A, C4A, T2A Web servers, apps, small databases, dev/test
Compute-optimised H4D, H3, C2, C2D High-performance computing, gaming servers
Memory-optimised X4, M4, M3, M2, M1 Very large in-memory databases such as SAP HANA
Storage-optimised Z3, Z4D Workloads that need lots of fast local SSD
Accelerator-optimised A4X, A4, A3, A2, G4, G2 AI training and inference, graphics on NVIDIA GPUs

Machine type names follow a pattern: series-class-vCPUs. So n2-highmem-8 is an N2 machine with 8 vCPUs and extra memory per vCPU. You can also create custom machine types on several series (for example 6 vCPUs with 20 GB) if no predefined size fits.

Advertisement

Storage options

  • Persistent Disk: network block storage that survives VM deletion if you choose. Types include standard (HDD), balanced and SSD.
  • Hyperdisk: the newer block storage where you set capacity, IOPS and throughput separately. Newer series such as C4 and N4 use it.
  • Local SSD: physically attached to the host, very fast, but data is lost when the VM stops.
  • Snapshots and images: point-in-time backups of disks, and templates for creating identical VMs.

Creating a VM: a quick example

From the Cloud Shell or any machine with the gcloud CLI installed:

gcloud compute instances create web-1 \
  --zone=asia-south1-a \
  --machine-type=e2-medium \
  --image-family=debian-12 --image-project=debian-cloud \
  --tags=http-server

That creates a Debian 12 VM with 2 shared vCPUs and 4 GB RAM in Mumbai. Add a firewall rule for the http-server tag and install a web server over SSH, and you have a live site. The same thing can be done by clicking through the Cloud Console.

Scaling and reliability

  • Instance templates save a VM configuration so you can stamp out copies.
  • Managed instance groups (MIGs) run many identical VMs, recreate any that fail health checks, and autoscale on CPU load or request rate.
  • Cloud Load Balancing spreads traffic across MIGs in one or several regions behind one IP address.
  • Regional MIGs spread VMs across zones so one zone going down does not take the service offline.

Pricing basics

Compute Engine bills per second, with a one-minute minimum. Exact rates vary by region and machine series, so check the Google Cloud pricing calculator before you commit. The main ways to pay less:

Option How it works Trade-off
On-demand (standard) Pay the list price per second Most flexible, most expensive
Sustained use discounts Automatic discount on some series when a VM runs a large part of the month Only on certain older series (such as N1, N2)
Committed use discounts Commit to 1 or 3 years of usage for a lower rate You pay even if you stop using it
Spot VMs Spare capacity at a large discount Google can stop them at any time with 30 seconds’ notice

Older “preemptible VMs” were the forerunner of Spot VMs and were always stopped after 24 hours; Spot VMs have no fixed maximum run time.

Free tier

Google Cloud’s always-free tier includes one e2-micro VM per month in us-west1 (Oregon), us-central1 (Iowa) or us-east1 (South Carolina), 30 GB-months of standard persistent disk and 1 GB of outbound data transfer from North America per month. GPUs are never free. New accounts also get a $300 credit for 90 days. These figures are from Google’s free-tier documentation as of 2026 and can change.

Advertisement

Compute Engine vs App Engine vs Cloud Run vs GKE

Service Model You manage Choose it when
Compute Engine IaaS (VMs) OS, patches, runtime, app You need full control or run software that expects a normal server
Google Kubernetes Engine (GKE) Managed Kubernetes Containers and cluster config You run many containerised services
Cloud Run Serverless containers Just the container Stateless web apps and APIs that scale to zero
App Engine PaaS Just the code Simple web apps in a supported language

GCE also sits alongside Amazon EC2 and Azure Virtual Machines, which offer the same IaaS model. For big-data platforms that often run on cloud VMs, see Hadoop pros and cons and what Databricks is. For the OS concepts behind VMs, virtual memory is a good starting point. Google’s own reference is the Compute Engine documentation.

Pros and cons of Compute Engine

  • Pros: full control of the machine; per-second billing; custom machine sizes; live migration during maintenance; strong global network; wide GPU choice.
  • Cons: you patch and secure the OS yourself; costs grow quietly if VMs are left running; more set-up work than serverless options; egress (outbound data) charges add up for high-traffic sites.

FAQs

Is Google Compute Engine IaaS or PaaS?

IaaS. It gives you virtual machines and you manage the operating system and software. App Engine is Google’s PaaS.

Is Google Compute Engine free?

Partly. The always-free tier covers one e2-micro VM a month in three US regions, 30 GB of standard disk and 1 GB of egress. Anything beyond that is billed.

What is the difference between Compute Engine and App Engine?

Compute Engine gives you a whole VM to manage. App Engine runs your code on servers Google manages, so you never see or patch the machine.

What is the AWS equivalent of Google Compute Engine?

Amazon EC2 (Elastic Compute Cloud). Azure’s equivalent is Azure Virtual Machines.

What are Spot VMs in Compute Engine?

Discounted VMs that run on Google’s spare capacity. Google can reclaim them at any time, so they suit batch or fault-tolerant jobs, not live websites.

Advertisement
Written by Imran Siddiqui

Mechanical engineer and AI researcher with 11+ years across machine learning, mechanical and civil engineering. Writes and reviews the study guides on EngineeringHulk. How we write and check our guides.

Keep reading

Computer Science & IT

NIST Explained: Standards, CSF 2.0, SP 800 and PQC for Engineers

What NIST is and which of its standards engineers use: CSF 2.0's six functions, SP 800 series, FIPS, post-quantum crypto, NVD changes and India equivalents.

Updated 27 Sep 2026
Computer Science & IT

Google Gemini: What It Is, Models and How It Works

Google Gemini is Google's family of multimodal AI models and the app built on them. Model timeline, context windows, how it works, uses and limits (2026).

Updated 24 Sep 2026
Computer Science & IT

Google Bard: What It Was and What Replaced It

Google Bard was Google's AI chatbot from 2023. Timeline from the LaMDA launch to PaLM 2 and Gemini, the demo error, and why it was renamed Gemini in 2024.

Updated 23 Sep 2026
Computer Science & IT

Domains of AI (Artificial Intelligence): The 9 Subfields Explained

The domains of AI are machine learning, deep learning, NLP, computer vision, robotics, expert systems, fuzzy logic, speech and planning. With examples.

Updated 21 Sep 2026
Computer Science & IT

Vulnerability Assessment: Process, Tools, Prioritisation and a Free Lab

What a vulnerability assessment is, the 6-step process, CVSS 4.0 vs EPSS vs CISA KEV prioritisation with a worked example, free tools, report format and a lab.

Updated 27 Sep 2026
Computer Science & IT

Agent-First Solutions: The Ultimate Guide to the Next Era

Agent-first software is built for AI agents that carry out whole tasks, not for people clicking through screens. How it differs from co-pilot tools, how it works, where i

Updated 24 Sep 2026