Non-production Compute Engine VMs that could run on the Spot provisioning model
What does ZopNight detect here?
Dev, test, QA, staging, sandbox and demo Compute Engine VMs on standard pricing are flagged when Google's live Spot rate for the machine type is lower. Spot VMs created with `--provisioning-model=SPOT` cost up to 91% less, but Compute Engine can preempt them at any time, so ZopNight skips production, standby, stateful and Windows VMs.
Signal and threshold
| Field | Value |
|---|---|
| Rule IDs | RC-111 |
| Category | discount |
| Severity | low |
| Metric | none — pure configuration read |
| Threshold | non-production VM with a live Spot discount of 5% to 92% |
| Source | ZopNight |
| Permissions used | compute.instances.list · compute.instances.get |
Where it applies
The trade Spot pricing asks you to make
Spot VMs are spare Compute Engine capacity sold at a steep discount: Google quotes up to 91% off the on-demand price for many machine types. The catch is preemption. Compute Engine can stop or delete a Spot VM at any time to reclaim capacity, Spot VMs cannot live migrate or auto-restart on host events, and they are excluded from the Compute Engine SLA. There is no minimum or maximum runtime unless you set one.
For development and test machines, that trade is usually good. A preempted dev box is an annoyance; paying full price for it every hour of the month is a recurring cost.
Spotting standard-priced non-production VMs
gcloud compute instances list \ --format="table(name,zone,machineType,scheduling.provisioningModel,labels)"An empty or STANDARD provisioning model on a VM labelled or named for dev or test is a
candidate.
How a VM qualifies
- It is not terminated.
- It is non-production: an
env,environment,stageortierlabel says dev, test, qa, staging, sandbox or demo, or the name contains one of those words. - It is not already Spot or preemptible.
- Google’s live rates for the VM show a Spot price below on-demand, giving a discount between 5% and 92%; anything outside that band is treated as a bad rate and ignored.
VMs that are protected from this advice
A production label always wins, even if the name says test. Names with a dr or standby
segment are skipped, because a preemption during failover is an outage. So are stateful data
services recognised by name, engine or labels (databases, Kafka, Elasticsearch, SAP and similar)
or a tier=data label. Windows and SQL Server VMs are excluded too.
With no live Spot rate for the machine type, there is no finding; ZopNight does not fall back
to a typical discount.
Pricing the switch
spot discount = 1 - (live Spot rate / live on-demand rate)saving = current monthly cost x spot discountRecreating the VM as Spot
- Confirm the workload tolerates being stopped without warning, and add a shutdown script if it needs to save state.
- Snapshot the boot disk or create a machine image.
- Create the replacement from it:
Terminal window gcloud compute instances create VM_NAME-spot --zone=ZONE \--provisioning-model=SPOT --instance-termination-action=STOP \--source-machine-image=IMAGE_NAME - Move DNS or users over, then delete the standard VM.