A DevOps engineer manages a high-traffic production web application running on an existing regional Managed Instance Group (MIG) in Google Compute Engine. A new application release has been packaged into a updated instance template named `web-template-v2`. The engineer must update all running instances in the MIG to use this new template while maintaining continuous service availability without causing downtime. Which command or operational workflow should the engineer execute to meet these requirements?
- Execute `gcloud compute instance-groups managed rolling-action start-update` targeting the instance group and specify `--version=template=web-template-v2`.Answer
- BSubmit an urgent GCP Quota Increase request for regional Compute Engine CPU cores so a secondary, parallel MIG can be deployed alongside the existing group.
- CAssign the `roles/owner` primitive role to the Compute Engine default service account to enable automatic background instance template synchronization.
- DReconfigure the existing Managed Instance Group target instance provisioning model to use Spot VMs running `web-template-v2` to force immediate instance replacement.
Answer
The correct action is to execute `gcloud compute instance-groups managed rolling-action start-update` targeting the instance group and specifying `--version=template=web-template-v2`.
The Google-recommended practice for updating instances in a Managed Instance Group without downtime is performing a rolling update. The `gcloud compute instance-groups managed rolling-action start-update` command updates the group target template and gradually replaces existing instances while keeping the service active and available.
Step-by-Step Solution
Key Concept
Managed Instance Group Rolling Updates