GOOGLE-PROFESSIONAL-CLOUD-DEVELOPER practice question 1 of 35
You have an application controlled by a managed instance group. When you deploy a new version of the application, costs should be minimized and the number of instances should not increase. You want to ensure that, when each new instance is created, the deployment only continues if the new instance is healthy. What should you do?
Full set: 265 questionsThe goal is to update a managed instance group (MIG) without increasing the total number of instances while minimizing costs. The maxSurge and maxUnavailable parameters control the rolling update process. Setting maxSurge=0 ensures that no instances are created above the MIG's target size, directly satisfying the requirement that "the number of instances should not increase." Setting maxUnavailable=1 allows the MIG to take one old instance offline to make capacity for a new one. This "rolling replace" strategy meets the constraints by sequentially replacing old instances with new ones. The MIG inherently waits for a new instance to pass its health check before proceeding with the update, fulfilling the final requirement.
A. maxSurge=1 violates the requirement that the number of instances should not increase, as it temporarily creates one instance above the target size.
C. maxHealthy and maxUnhealthy are not valid parameters for configuring a rolling update on a managed instance group. The correct parameters are maxSurge and maxUnavailable.
D. Similar to option C, maxHealthy and maxUnhealthy are not valid parameters for this operation. The update behavior is controlled by maxSurge and maxUnavailable.
1. Google Cloud Documentation, "Applying new configurations to VMs in a MIG": Under the section "Rolling update policy," the documentation states: "If you want to maintain the same number of instances throughout an update, set maxSurge to 0 and maxUnavailable to a fixed number greater than 0." This directly supports option B as the correct strategy for an in-place replacement without increasing the instance count.
2. Google Cloud Documentation, "gcloud compute instance-groups managed rolling-action start-update": The command reference defines the flags:
--max-surge: "The maximum number of instances that can be created over the group's target size." Setting this to 0 is required to not increase the instance count.
--max-unavailable: "The maximum number of instances that can be unavailable during the update." Setting this to 1 allows one instance to be replaced at a time.
3. Google Cloud Documentation, "How autohealing works": In the context of updates, this page clarifies the role of health checks: "During a proactive update, the MIG marks an instance for deletion and waits for the new instance to start up and become healthy before it proceeds to delete the original instance." This confirms the health check behavior described in the question is a standard part of the process.
Keep practicing
Take the free GOOGLE-PROFESSIONAL-CLOUD-DEVELOPER practice test
Ten exam-style questions with answers and explanations, plus the exam facts and study guides.
More questions
Other GOOGLE-PROFESSIONAL-CLOUD-DEVELOPER practice questions
- Question 2Your service adds text to images that it reads from Cloud Storage. During busy times of t…
- Question 3You have been tasked with planning the migration of your company’s application from on-pr…
- Question 4You plan to make a simple HTML application available on the internet. This site keeps inf…
- Question 5HipLocal's APIs are showing occasional failures, but they cannot find a pattern. They wan…
- Question 6Your company has created an application that uploads a report to a Cloud Storage bucket. …
- Question 7Your data is stored in Cloud Storage buckets. Fellow developers have reported that data d…
