Question

Difficulty: MediumManaging Compute Engine Resources

An infrastructure engineer needs to update a production web application hosted on a Compute Engine Managed Instance Group (MIG). A new instance template with the updated application image has already been created. The deployment must update the running VM instances gradually without interrupting ongoing user traffic. Which Google-recommended approach should the engineer use to perform this update?

  1. Update the Managed Instance Group target instance template and initiate a rolling update using the gcloud compute instance-groups managed rolling-action start-update command.Answer
  2. B
    Modify the instance group configuration to convert all running instances into Spot VMs to apply the update lower-cost during the deployment window.
  3. C
    Assign the Owner primitive IAM role to the Compute Engine default service account to allow direct inline editing of active VM instance boot disks.
  4. D
    Request an emergency vCPU quota increase and create a second project to host a parallel instance group before deleting the original instance group.

Answer

Update the Managed Instance Group target instance template and execute a rolling update via gcloud compute instance-groups managed rolling-action start-update.
The standard and Google-recommended method to update instances in a Managed Instance Group without downtime is to point the MIG to the new Instance Template and execute a rolling update command (`gcloud compute instance-groups managed rolling-action start-update`). This automatically handles replacing instances while maintaining minimum available capacity.

Step-by-Step Solution

1
Identify the requirement for zero-downtime rolling updates in Compute Engine Managed Instance Groups.
Determined that instance updates must be performed incrementally using instance templates.
Managed Instance Groups maintain instance consistency through instance templates rather than manual per-VM edits.
2
Apply the newly created instance template to the Managed Instance Group.
The MIG configuration points to the updated instance template.
The MIG requires an updated template definition before starting the automated update process.
3
Trigger the rolling update action via the gcloud CLI command `gcloud compute instance-groups managed rolling-action start-update`.
Compute Engine replaces old VM instances with new instances in a controlled, rolling manner.
Rolling updates replace instances gradually to preserve service capacity and prevent downtime.

Key Concept

Managed Instance Group (MIG) Rolling Updates
Rate this question