GCP Associate Cloud Engineer Practice Question 88: MIG Canary Instance Templates

Google Cloud Associate Cloud Engineer · Test 9 · question 8 of 10

Compute Engine Deploymenthard

A managed instance group of 40 instances runs on instance template web-v1. The team built a new instance template web-v2 and wants to validate it on a small slice of production traffic before committing the whole group: exactly 10 percent of the instances should be updated to web-v2 while the remaining 90 percent stay on web-v1, and both versions must be able to run side by side until the canary is confirmed healthy. Which approach satisfies this?

Select one answer
Show answer and explanation

Answer:

  • D. Start a rolling update on the MIG specifying web-v1 as the primary version and web-v2 as --canary-version with a target size of 10 percent.

A MIG's rolling update supports up to two instance template versions at once. Starting an update with the primary version set to web-v1 and --canary-version=template=web-v2,target-size=10% tells the MIG to keep 90 percent of instances on the original template and update exactly 10 percent to the canary template, all managed by a single group with its existing autohealing, autoscaling, and load balancer backend.

Option A changing the group's template and relying on surge only controls how many extra instances get created during the update; it does not pin a fixed 10 percent long-term split between two named versions, and a completed rolling update would eventually move every instance to web-v2. Option B manually manipulates instances outside of the MIG's control, so the group's autoscaler and autohealer would fight the manual changes and could delete or reformat the manually created instances. Option C works operationally but requires standing up and managing a second MIG and wiring it into the backend service by hand, more moving parts than the canary update feature built for exactly this purpose.

Reference: Automatically apply VM configuration updates in a MIG

Practice Test 9 ›

Study guides for Google Cloud Associate Cloud Engineer