Question

Difficulty: MediumManaging Compute Engine Resources

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?

  1. Execute `gcloud compute instance-groups managed rolling-action start-update` targeting the instance group and specify `--version=template=web-template-v2`.Answer
  2. B
    Submit an urgent GCP Quota Increase request for regional Compute Engine CPU cores so a secondary, parallel MIG can be deployed alongside the existing group.
  3. C
    Assign the `roles/owner` primitive role to the Compute Engine default service account to enable automatic background instance template synchronization.
  4. D
    Reconfigure 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

1
Identify the managed instance group update requirement
Recognize that updating an existing MIG with a new instance template without downtime requires a rolling update strategy.
Directly replacing VMs all at once would cause service interruption, whereas a rolling update replaces instances incrementally.
2
Execute the rolling update command using gcloud CLI
Run `gcloud compute instance-groups managed rolling-action start-update <group-name> --version=template=web-template-v2 --region=<region>`.
This command signals Compute Engine to update the MIG configuration and perform an online, controlled replacement of existing VM instances according to the configured update policy.

Key Concept

Managed Instance Group Rolling Updates
Rate this question