When it comes to virtual machines, Google Cloud Platform is anything but standard, which is no wonder why they mix things up by offering Google preemptible VMs. Traditionally, VMs only shut down when told to, but preemptible VMs only last up to 24 hours (if available at all), and you can stop them at any time. So the big question is — what’s the point?
Why to Use Google Preemptible VMs
First things first — cost. By opting to use preemptible VMs, you could save as much as 80% in comparison to on-demand (the same reason why AWS users opt for spot instances, and Azure users can run with low priority VMs). 80% is a massive discount, and a great option if your workload doesn’t have a deadline or your processes are short-lived, like financial modeling, rendering and encoding, and even some of your CI/CD processes like code testing.
Setting Up Google Preemptible VMs
Use the Google Cloud API or the ‘gcloud’ command line tool in to the GCP console to create your own preemptible VM. It’s just like the standard process— pick your instance size, networking options, disk setup, so on and so forth. The only difference is that you’ll need to enable the ‘preemptible’ flag while you’re setting up. Just in case, you should also come up with a shutdown script to have a process in place for what happens if that instance stops unexpectedly, which is quite possible in this case.
To get the most out of your workload in performance, capability, and cost effectiveness, take advantage of the fact that you can attach local SSD drives and GPUs to preemptible VMs. Put your VMs in managed instance groups for the benefit of scalability while the instances are available to you.
Saving Money with Google Preemptible VMs
The smartest and most cost optimal way to use Google Preemptible VMs is to mix them with other types of instances that pair well with your workload. If your instances need to be on all day and night, try committed-discounts and save up to 57% on those servers. For instances that don’t need to run 24/7, try ParkMyCloud — an automated scheduling tool that saves you up to 65% by turning your instances when you’re not using them (and really — why waste money leaving something on when you don’t need it?). Finally, for your batch workloads or non-urgent jobs, go for the Google preemptible VMs and save up to 80%.