Bitzu

Associate Cloud Engineer ยท Compute Engine: choosing, launching and scaling

Spot VMs, custom machine types and discounts

Spot VM behavior (preemption, no max runtime, 30-second notice), when it fits, custom machine types and extended memory, and sustained-use or committed-use pricing at the level needed to choose.

Key points

  • Spot VMs: heavily discounted, but Compute Engine can reclaim them at any time.
  • Preempted Spot VM: stopped by default; no maximum runtime unless you set one.
  • For fault-tolerant, checkpointed work.
  • Custom machine types: pick the exact vCPU and memory count.
  • Sustained-use discounts: automatic on some machine series.
  • Committed-use discounts: 1 or 3 year commitment for steady load.

Source: https://docs.cloud.google.com/compute/docs/instances/spot

Practice questions

Single choice

By default, what happens to a Spot VM when Compute Engine preempts it?

  1. It is stopped
  2. It is deleted
  3. It is live-migrated to another host
  4. It restarts on its own in another zone
Show answer

Answer: A. It is stopped

The default termination action is STOP, so the VM moves to a terminated state and can be started again. It is not live-migrated or restarted by itself, and it is deleted only if you set DELETE.

Select all that apply

Which workloads are a good fit for Spot VMs?

  1. Batch analytics that checkpoints its progress
  2. Stateless workers in a pool where other workers keep running
  3. The only primary database, with no replica
  4. A licence server that must always be reachable
  5. A single VM serving a customer-facing checkout
Show answer

Answer: A. Batch analytics that checkpoints its progress, B. Stateless workers in a pool where other workers keep running

Checkpointed batch work and stateless workers with spare capacity elsewhere tolerate loss of a VM. A lone primary database and an always-on licence server cannot.

True or false

True or false: a Spot VM is always stopped after 24 hours.

Show answer

Answer: False

False. Spot VMs have no maximum runtime unless you configure one. The 24-hour limit belonged to the older preemptible VMs.

Practice 8 questions on this topic in Bitzu

Short lessons, instant explanations and spaced review of what you get wrong. Free on iOS and Android.

Download on the App StoreGet it on Google Play

More Associate Cloud Engineer topics in this module