Compute Engine Spot/preemptible VM was preempted (instance terminated by Compute Engine)

Compute Engine reclaimed a Spot or preemptible VM, so your workload stopped abruptly.

Exact message you may see Instance was preemptedSpot VM terminated by Compute EngineThe instance was preemptedpreemptible instance stopped
Seen on: Google Cloud

Meaning

Spot VMs can be stopped at any time with a 30 s warning (ACPI G2 soft off). Handle the shutdown signal, checkpoint work, use a managed instance group to recreate them, mix with on-demand capacity, and keep stateful data on persistent disks.

Common causes

  • Spot/preemptible capacity reclaimed
  • Maximum 24 h runtime (preemptible)
  • Zone resource shortage
  • No shutdown handler/checkpointing
  • Using Spot for non-fault-tolerant services

⚡ Quick fix

  1. Add a shutdown script/checkpoints
  2. Use a MIG with auto-recreate
  3. Fall back to standard VMs for critical services

Detailed fix by platform

Shell

  1. bash
    curl -s -H "Metadata-Flavor: Google" http://metadata.google.internal/computeMetadata/v1/instance/preempted
    gcloud compute operations list --filter="operationType=compute.instances.preempted"

How to diagnose

  1. Preempted — True?
  2. Checkpointing — Present?
  3. Fallback — Standard VMs?

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

Where this error sits

Origin: Platform & cloud. Errors that are often confused with or caused by this one (click to open):

autohealing — Managed instance group keeps recreating VMs: autohealing health check failing (Google Cloud / Firebase)autohealingCompute Engine: Quota exceeded (regional limit) — Compute Engine: Quota 'N2_CPUS' exceeded. Limit: 24.0 in region europe-west1 / QUOTA_EXCEEDED (Google Cloud / Firebase)Compute Engine: Quota…disk full — Compute Engine VM disk full: No space left on device — resize the persistent disk and filesystem (Google Cloud / Firebase)disk fullGKE: 0/3 nodes are available: Insufficient cpu — GKE/Kubernetes: Pod unschedulable — 0/3 nodes are available: 3 Insufficient cpu (Google Cloud / Firebase)GKE: 0/3 nodes are av…image family — Compute Engine: The resource 'projects/X/global/images/family/Y' was not found (image or family missing) (Google Cloud / Firebase)image familyIN_USE_ADDRESSES — Quota 'IN_USE_ADDRESSES' exceeded (external IP addresses) in region (Google Cloud / Firebase)IN_USE_ADDRESSESZONE_RESOURCE_POOL_EXHAUSTED — Compute Engine: The zone 'projects/p/zones/us-central1-a' does not have enough resources available to fulfill the request (ZONE_RESOURCE_POOL_EXHAUSTED) (Google Cloud / Firebase)ZONE_RESOURCE_POOL_EX…preemption

Explore the map of this error Full error map →

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.

💬 What worked for others

No tips yet — did something else fix this for you?

Share what worked for you

Tips are checked by an editor before they appear. Links are removed.