
Ultimate access to all questions.
Your company operates its application workloads on Google Cloud's Compute Engine. These applications are deployed across three environments: production, acceptance, and development. The production environment is business-critical and runs 24/7, whereas the acceptance and development environments are essential only during office hours (9 AM to 5 PM). Given that the acceptance and development environments are idle outside of office hours, your CFO has asked you to identify ways to optimize costs during non-critical times. How should you proceed to achieve these cost savings?
A
Create a shell script that uses the gcloud command to change the machine type of the development and acceptance instances to a smaller machine type outside of office hours. Schedule the shell script on one of the production instances to automate the task.
B
Use Cloud Scheduler to trigger a Cloud Function that will stop the development and acceptance environments after office hours and start them just before office hours.
C
Deploy the development and acceptance applications on a managed instance group and enable autoscaling.
D
Use regular Compute Engine instances for the production environment, and use preemptible VMs for the acceptance and development environments.
Explanation:
The correct answer is B. Using Cloud Scheduler to trigger a Cloud Function for stopping and starting instances during non-critical hours is an effective way to achieve cost savings. Cloud Scheduler, along with Cloud Pub/Sub, can automate the process by stopping the non-critical development and acceptance environments after office hours and starting them just before office hours. This approach ensures the environments are available when needed without incurring unnecessary costs during idle times. This method leverages Google Cloud's fully-managed services for scheduling and automation, making it a more efficient and reliable solution compared to other options.