Question

Difficulty: Very hardManaging Compute Engine Resources

Your organization operates a high-availability production application running on a Compute Engine Regional Managed Instance Group (MIG). You need to perform a seamless software update by deploying a new instance template named `template-v2`. The deployment process must guarantee zero application downtime and ensure that replacement instances are fully booted, initialized, and verified healthy before any existing instances are taken offline. Which two actions should you take to achieve this?

  1. Perform a rolling update on the MIG referencing `template-v2` with the `maxUnavailable` parameter set to 0.Answer
  2. Configure a positive `minReadySec` value in the MIG update policy to enforce a delay after instance startup before marking the update of that instance as complete.Answer
  3. C
    Modify the MIG autoscaling policy target CPU utilization to 100% during the update window to prevent instances from scaling down.
  4. D
    Change the MIG target provisioning model to Spot VMs prior to starting the update to reduce instance replacement costs.
  5. E
    Assign the primitive `Viewer` role to the Compute Engine default service account to grant permissions required for instance replacement.

Answer

To perform a zero-downtime update that validates instance readiness, initiate a rolling update referencing the new template with `maxUnavailable` set to 0 and configure `minReadySec` in the update policy.
Performing a rolling update with `maxUnavailable` set to 0 ensures that Compute Engine creates new instances before taking old ones down, preserving total capacity. Additionally, configuring `minReadySec` enforces a mandatory wait time after an instance starts up and passes health checks, guaranteeing that the new instance is serving traffic cleanly before the system moves on to replace the next instance.

Step-by-Step Solution

1
Configure the rolling update policy with `maxUnavailable = 0`
Guarantees that full instance capacity is maintained throughout the rollout because no active instance is destroyed before a new replacement instance is online.
Setting `maxUnavailable` to 0 forces Compute Engine to create surplus (surge) instances first before terminating older instances.
2
Set `minReadySec` to an appropriate duration matching application initialization time
Prevents premature termination of healthy instances by waiting for new instances to pass health checks and run for the specified duration.
Ensures the application software inside the VM is fully booted and operational before the rolling update algorithm considers the instance update successful.

Key Concept

Compute Engine MIG Rolling Update Policy Configuration
Estimated Time:3m 0s
Rate this question