Build Preemptible and Spot VM configurations with scheduling policies and shutdown scripts.
Last verified: May 2026
Build Preemptible and Spot VM configurations with scheduling policies, shutdown scripts, and cost-optimized instance settings.
Required Fields
namezonemachineTypescheduling.provisioningModeldisksnetworkInterfacesOutput will appear here...Your team's nightly ML training jobs run on a fixed 20-VM Compute Engine fleet ($1,200/month always-on). Most of the day the fleet is idle. The builder generates a Spot-based instance template: e2-standard-8 with provisioning_model=SPOT, shutdown script that checkpoints model state to GCS, automatic restart disabled. Combined with a managed instance group + autoscaling, the fleet runs only when training jobs are queued. Monthly cost drops to ~$200 (job duration only × Spot pricing). Annual savings: $12K with no impact on training reliability thanks to checkpointing.
Build Preemptible and Spot VM configurations with scheduling policies and shutdown scripts. This tool helps GCP engineers generate valid configurations quickly without consulting documentation, reducing errors and accelerating infrastructure deployment. All processing runs in your browser with no data sent to external servers.
The builder constructs Spot/Preemptible VM configurations: instance scheduling block with provisioning_model=SPOT, instance_termination_action=DELETE or STOP, automatic_restart=false, on_host_maintenance=TERMINATE, plus shutdown script in metadata for graceful termination handling. Output is generated as gcloud compute instances create commands and Terraform google_compute_instance + google_compute_instance_template resources with spot scheduling.
Spot VMs (the modern replacement for Preemptible) deliver 60-91% cost savings with 30-second termination notice. Unlike old Preemptible's 24-hour max runtime, Spot VMs run indefinitely until GCE needs the capacity back — making them viable for many workloads that couldn't tolerate the 24-hour cap.
ALWAYS configure shutdown scripts for Spot VMs. The 30-second termination notice is delivered via the metadata server; your shutdown script should checkpoint state, drain connections, and gracefully exit. Without a shutdown script, the workload is killed mid-task with no chance to save state.
Combine Spot + on-demand in instance group pools (e.g., 30% on-demand for baseline, 70% Spot for burst capacity). When Spot capacity is reclaimed, the on-demand portion keeps the workload running. Pure-Spot deployments are vulnerable to fleet-wide reclamation events; mixed deployments are resilient.
Was this tool helpful?
Disclaimer: This tool runs entirely in your browser. No data is sent to our servers. Always verify outputs before using them in production. AWS, Azure, and GCP are trademarks of their respective owners.