Question

Difficulty: HardManaging Compute Engine Resources

A Cloud Engineer needs to safely deploy an OS image update to a production Managed Instance Group (MIG) serving critical web application traffic. To minimize operational risk, the engineer must execute a canary rollout using the gcloud command-line interface, testing the updated configuration on a subset of 10% of the instances before initiating a full deployment. In which sequential order should the engineer execute these steps?

  1. 1Create a new Compute Engine instance template incorporating the updated disk image and configuration settings.
  2. 2Update the Managed Instance Group configuration to add the new instance template as a canary version with a target size of 10%.
  3. 3Initiate a rolling update action on the Managed Instance Group to provision and replace instances matching the canary target size.
  4. 4Monitor Cloud Logging and Cloud Monitoring metrics to validate application stability and performance on the canary instances.
  5. 5Update the Managed Instance Group configuration to promote the new instance template to 100% and finish the rolling update across all instances.

Answer

The correct sequence for conducting a canary rollout on a Managed Instance Group is: 1) Create a new instance template with the updated disk image, 2) Configure the MIG to target 10% size for the new template version, 3) Start the rolling update action to replace canary instances, 4) Monitor application logs and metrics on the canary subset, and 5) Promote the new instance template to 100% target size to complete the full update.
The correct operational sequence adheres to Google Cloud best practices for risk-mitigated deployments. A new instance template must be created first before it can be referenced. The group configuration is then updated to assign a 10% target size to the new template. Executing the rolling action replaces only the instances necessary to meet the 10% canary threshold. Monitoring telemetry validates that the new image performs reliably. Finally, assigning 100% target size to the new template rolls out the update to all remaining instances.

Step-by-Step Solution

1
Define the target configuration by creating a new Compute Engine instance template.
A new versioned template resource becomes available in the project for instance creation.
Managed Instance Groups instantiate virtual machines based on instance templates; changes cannot be applied directly to running instances without a template update.
2
Set the MIG update policy to include the new template as a canary version targeting 10% of total instances.
The MIG metadata is updated to maintain two versions (original version at 90%, canary version at 10%).
Canary deployments require specifying a target size or percentage so that GCP knows how many instances to transition initially.
3
Execute the gcloud rolling action update command.
Compute Engine automatically terminates old instances and provisions new instances using the canary template until 10% capacity is reached.
The rolling update action triggers the actual infrastructure replacement process in accordance with the specified update policy.
4
Inspect Cloud Monitoring metrics and application log streams for canary instances.
Verification data confirms whether the updated OS image operates cleanly under live conditions without unhandled exceptions or performance degradation.
Testing in production with limited exposure ensures bugs are detected prior to impacting all users.
5
Update the MIG version configuration to assign 100% target size to the new template.
The MIG replaces all remaining instances with the new template, completing the update cycle.
Once the canary passes validation, promoting the template brings the entire instance group to the latest configuration.

Key Concept

Managed Instance Group Canary Updates
Rate this question