cloudfoundry / bosh-google-cpi-release

BOSH Google CPI
Apache License 2.0
63 stars 96 forks source link

add the ability to use spot instances in gcp #340

Open ramonskie opened 1 year ago

ramonskie commented 1 year ago

as gcp supports spot prices voor vms it would be nice to implement this https://cloud.google.com/compute/docs/instances/spot

as aws and alicloud also support this for a long time

it should also support a fallback as been done in aws cpi https://github.com/cloudfoundry/bosh/pull/915 https://github.com/cloudfoundry/bosh-aws-cpi-release/commit/dedc2811b2b9100c3d366ebcb062821b0eb36f63

spots can be managed by setting the ProvisioningModel see https://pkg.go.dev/google.golang.org/api/compute/v1

it seems we already support preemptible, read diffrences below betwoon spot https://sudipta-deb.in/2023/01/what-is-preemptible-and-spot-virtual-machine-in-google-cloud-platform.html

Spot Virtual Machines are the latest version of Preemptible Virtual Machines. However, Spot Virtual Machines provide new features that Preemptible Virtual Machines do not support.

Unlike Preemptible Virtual Machine, Sport Virtual Machine doesn’t have any runtime restrictions like 24 hours. It can run any number of hours.