skip to Main Content
Welcome to Gimasys!
Hotline: +84 974 417 099 (HCM) | +84 987 682 505 (HN)

Save costs by setting up a schedule to automatically turn on/off the Compute Engine server

A key feature of virtual servers (VMs) in the cloud is that you only pay for the resources you use. On Google Cloud Platform (GCP), Compute Engine VMs are billed every second. The service system usually operates 24/7; However, there are still some cases where VMs, like for service development or testing environments, are usually only used during business hours. It's pointless to keep running these types of servers all night or on weekends, so you can turn off the service to save money. But manually stopping and starting large clusters of VMs on a daily basis can easily lead to mistakes and be difficult to control throughout the organization.

Cloud Scheduler, helps schedule the above jobs GCP, provides a simple solution to automatically stop or start VMs. With Cloud Scheduler deployment with Cloud Pub/Sub to enable Cloud Functions on a schedule, you can also enable or disable VM clusters are marked via labels (created in Compute Engine).

In the image below you can see the schedules (examples) to stop all VMs labeled “dev” at 5pm and restart at 9am, while those labeled “prod” ' is not affected.

Save costs by setting up a schedule to automatically turn on/off the Compute Engine server

Using this setup allows great flexibility, you can assign different schedules to different VM clusters by creating multiple Cloud Schedulers.

At the same time, it helps you have more control over Compute Engine VMs, because functions on GCP all use service accounts. to stop or start the VM Compute Engine servers. Use Cloud Identity and Access Management (IAM), you can follow the principle of least rights and limit the permissions to the most necessary for this service account.

When scheduling a system shutdown, VMs will execute shutdown scripts to ensure they are functioning properly. Any attached drives that disable auto-erase will still retain the data and may be available as soon as the VM reboots. Last but not least, if someone needs to deploy or test VMs unexpectedly, you can simply remove the label from that VM temporarily or simply restart the VM if it has been disabled.

To see an example of a deployment design, you can see more about Scheduling compute instances with Cloud Scheduler.

To learn more about what you can do with Cloud Scheduler, see Reliable task scheduling on Compute Engine with Cloud Scheduler.

If your business needs advice on information related to Google Cloud services.  Contact now:

  • Gimasys – Google Cloud Premier Partner
  • Hotline: Hanoi: 0987 682 505 - Ho Chi Minh: 0974 417 099
  • Email:
  • Sign up for a trial: Here


Back To Top
0974 417 099