How do I automatically restart a preemptible Google Compute Engine instance? I only have one instance that doesn't need 100% uptime but that I would like to restart once the data center becomes unloaded again. The instance/server that I'm trying to automatically restart has its own boot disk that I'd like to use each time it restarts.
Using vCenter. In the vSphere vCenter, select the virtual machine. Right-click the VM and select Migrate for Google Compute Engine Operations > Restart.
Preemptible VMs always stop after 24 hours. Preemptible VMs are recommended only for fault-tolerant applications that can withstand VM preemption.
Performing a reset on your instance is similar to pressing the reset button on your computer, which wipes the memory contents of the machine and resets the virtual machine to its initial state. https://cloud.google.com/compute/docs/instances/restarting-an-instance.
You could try using Instance Group Manager to set up a pool of size 1. It will then try to re-create instances after they are preempted.
You should be aware that there is no guarantee that there is going to be capacity for your instance. As the docs say:
Preemptible instances are available from a finite amount of Compute Engine resources, and might not always be available.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With