Can I start and stop instances of Google Compute on a schedule?

I run a simple task 3 times a day from my desktop computer. It connects to a particular website at 16:00, 8:00 and 1:00, downloads a small amount of data (less than 50 mb) and saves it on the hard drive. It is important that this is done every day, so I study this in Google Compute. I know that I can just create an instance and leave it 24/7/365, but it's expensive. Is there a way to turn on the instance only at 16:00, 8:00 and 1:00 for 10 minutes so that the data can be downloaded and then turn it off, so I get paid 30 minutes a day from Google Compute time? By the way, I would use a Windows Server 2008 image (which is now limited to limited viewing in Google Compute, I believe), and not a Linux image, if that matters.

+4
source share
2 answers

There is no built-in scheduler for instances of the Compute Engine.

You can use the cron App Engine scheduler to call Compute Engine API calls. Here is an example application that uses cron for list instances and deletes those that have been running for more than 8 hours .

You can do something similar by creating an App Engine URL that launches the instance with a script that launches your task, copies the data to the cloud storage and then terminates the instance as soon as it is complete. Then create a cron job to use this URL in your schedule.

+7
source

VMPower, . , script .

+1

Source: https://habr.com/ru/post/1535127/


All Articles