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?
- 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
- BModify the instance group configuration to convert all running instances into Spot VMs to apply the update lower-cost during the deployment window.
- CAssign the Owner primitive IAM role to the Compute Engine default service account to allow direct inline editing of active VM instance boot disks.
- DRequest 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
Key Concept
Managed Instance Group (MIG) Rolling Updates