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

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

Một tính năng chính của máy chủ ảo (VMs) trên cloud đó là bạn chỉ phải trả cho những tài nguyên nào mà bạn sử dụng. Trên 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, giúp lập lịch biểu công việc trên GCP, cung cấp một giải pháp đơn giản để tự động dừng hoặc khởi động các VM. Với việc triển khai Cloud Scheduler với Cloud Pub/Sub để kích hoạt các Cloud Functions theo lịch biểu, bạn cũng có thể bật hoặc tắt các cụm VM được đánh dấu qua các nhãn (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.

Đồng thời giúp bạn có nhiều quyền kiểm soát trên Compute Engine VMs, bởi các chức năng trên GCP đều sử dụngservice account to stop or start the VM Compute Engine servers. Use Cloud Identity and Access Management (IAM), bạn có thể thực hiện theo nguyên lý quyền tối thiểu and limit the permissions to the most necessary for this service account.

Khi lên lịch dừng hệ thống, các VM sẽ thực thi các shutdown scripts để đảm bảo chúng được hoạt động đúng cách. Bất kỳ ổ đĩa đính kèm nào mà vô hiệu hóa tự động xóa 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.

Để xem ví dụ về thiết kế triển khai, bạn có thể xem thêm về Scheduling compute instances với Cloud Scheduler.

Để biết thêm những gì bạn có thể thực hiện với Cloud Scheduler, xem thêm về Reliable task scheduling on Compute Engine with Cloud Scheduler.

Nếu doanh nghiệp của bạn cần tư vấn các thông tin liên quan dịch vụ Google Cloud.  Contact now:

  • Gimasys – Google Cloud Premier Partner
  • Hotline: Hanoi: 0987 682 505 - Ho Chi Minh: 0974 417 099
  • Email: gcp@gimasys.com
  • Đăng ký dùng thử: Here

Gimasys

Back To Top
0974 417 099