I have some science jobs to run where the instance is has a mounted network drive to a server that is always. Since the cost of always on VMs cost double, I wanted to run pre-emptible VMs but restart them hourly if they have stopped. I want the jobs to finish, but I also don't want to blow the budget on always on instances when I can have a little down time pay half the hourly rate.
Asked
Active
Viewed 1,070 times
3
-
1Per this [document](https://cloud.google.com/compute/docs/instances/preemptible#limitations), Compute Engine always terminates preemptible instances after they run for 24 hours. If your jobs run time longer than 24 hours, you can use cloud scheduler per this [document](https://cloud.google.com/scheduler/docs/start-and-stop-compute-engine-instances-on-a-schedule) to start it at a fixed time. Please clarify your question. – Hao Z May 05 '20 at 02:27
-
what is not clear to you? – Sun May 05 '20 at 15:05
-
1Do you means that you want to restart your preemption instances hourly ? If yes, you can use Cloud scheduler to start them. Per this [document](https://cloud.google.com/compute/docs/instances/preemptible#preemption_selection), Certain actions will reset the 24-hour counter for preemptible instances. Specifically, if you stop and start them, Compute Engine will reset the counter if the instance transitions into a TERMINATED state. However, other actions, where the instance remains in RUNNING state, do not reset the counter. – Hao Z May 05 '20 at 20:29
1 Answers
4
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.

Hao Z
- 157
- 6