Is there a way to restart pre-emptible Google Cloud VM instances (Compute Engine) on an hourly basis if it has stopped?
Per this document, Compute Engine always terminates preemptible instances after they run for 24 hours. If you start or shut down the instance via the click “start” or “stop” button in the Google Cloud Console instance page, these actions will reset the 24-hour counter for preemptible instances.
If your science jobs always run longer than 24 hours, and you want to avoid jobs being interrupted, or if you want restart your preemptible instance hourly, you can use Cloud scheduler to start or stop your instance at a fixed time.
How do I automatically restart a GCE preemptible 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.
Related Topics
How to Put All Command Arguments in One Variable
Find Port Number of Ibm Mq Queue Manager
How to Find Libstdc++.So.6: That Contain Glibcxx_3.4.19 for Rhel 6
Cygwin Xwin Server Randomly Loses Connection
Linux: Get a Script to Be Able to Ask The User for a File Name Then Open That File
How to Enter Private Key Password with Ansible
Why Questionmark Comes in The End of Filename When I Create .Txt File Through Shell Script
Search Ip from a Text File in .Csv Log File, If Found Add New Column Next to It
Put Graphics on The Screen Without /Dev/Fb0
Executing Shell Script from Current Directory Without '"./Filename"
Bypass Dev/Urandom|Random for Testing
Difference Between Double and Single Bigger Than in Linux Terminal
Golang Math Can Not Finished with My Code, But Python Is Ok