Search code examples
google-cloud-platformgoogle-compute-enginegoogle-cloud-scheduler

GCP auto shutdown and startup using Google Cloud Schedulers


I want to start/stop a set of Compute engine instances in Google Cloud Platform using Google Cloud Scheduler. How can I do it?


Solution

  • There has been a steady improvement on this in the years since the question was posted. As of today, you can attach a schedule, or multiple schedules, directly to a vm via the console in the console; there's no need to use API auth or gcloud commands.

    Navigate to the 'VM Instances' page (not an individual instance details page) and select the 'Instance Schedules' tab on the top of that page, then select 'Create Schedule'

    This feature will start your instance and then stop it after a predetermined amount of time. That is, there is not an independent schedule for stopping an instance.

    https://cloud.google.com/compute/docs/instances/schedule-instance-start-stop