Course contentsShow
← Cloud and Infrastructure
Lesson 104 of 2,9892. Compute FoundationsFree lesson

GCP Preemptible and Spot VMs

Use short-lived preemptible VMs and Spot VMs for fault-tolerant batch workloads at significant cost savings.

GCP Preemptible and Spot VMs

What you'll learn: How to dramatically reduce compute costs using Google Cloud's short-lived, interruptible virtual machines.

The Core Idea

GCP offers two types of short-lived VMs that cost up to 91% less than standard on-demand instances: Preemptible VMs (older model) and Spot VMs (newer, more flexible model). The catch? Google can terminate them at any time with minimal notice—typically 30 seconds for Preemptible VMs and potentially less for Spot VMs.

Think of these like deeply discounted airline standby tickets: you get massive savings, but you might lose your seat if someone with a full-price ticket needs it.

When to Use Them

These VMs are perfect for fault-tolerant, batch workloads that can handle interruptions:

  • Batch processing jobs (data analysis, video transcoding)
  • Distributed computing tasks with checkpointing
  • CI/CD testing environments
  • Non-critical development servers

What You Cannot Use Them For

Avoid Preemptible/Spot VMs for:

  • Production databases
  • Critical web servers
  • Long-running tasks without checkpoints
  • Any workload requiring guaranteed uptime

Key Differences

Preemptible VMs always terminate after 24 hours maximum. Spot VMs have no maximum runtime and offer more flexible pricing—they're the recommended choice for new projects.

Both types use the same machine types you've already learned (from GCP Compute Engine Machine Types and Instance Groups). You simply select "Spot" or "Preemptible" when launching.

Key Takeaway: Use GCP Preemptible or Spot VMs for interruptible, fault-tolerant workloads to achieve up to 91% cost savings, but always design your application to handle sudden terminations gracefully.