Get Your CertGoogle Cloud Associate Cloud EngineerPlayCompete
‹ All Google Cloud Associate Cloud Engineer questions

GCP Associate Cloud Engineer Practice Question 4: MIG Rolling Update

Google Cloud Associate Cloud Engineer · Test 1 · question 4 of 10

Compute Engine Deploymentmedium

A regional managed instance group named web-mig runs 10 instances behind a load balancer from instance template web-v1. You have built a new template, web-v2, containing a patched image. All 10 existing instances must be moved to web-v2 automatically, and at no point may fewer than 10 instances be able to serve traffic.

Which command accomplishes this?

Select one answer
Show answer and explanation

Answer:

  • D. gcloud compute instance-groups managed rolling-action start-update web-mig --version=template=web-v2 --type=proactive --max-unavailable=0 --max-surge=3

A proactive rolling update tells the MIG to replace existing VMs with the new template on its own, without waiting for anything else to touch them. --max-unavailable=0 guarantees the group never drops below its target size of 10 serving instances, and --max-surge=3 lets the MIG temporarily create up to three extra VMs so it has somewhere to move capacity while old VMs are retired. Those two flags together are exactly the "no capacity loss" contract the stem asks for.

Option A only changes the template the group uses for *future* instances. Existing VMs keep running web-v1 until something recreates them, so the fleet is never actually updated.

Option B starts the right kind of update but with the wrong type. An opportunistic update is applied only when instances are recreated for some other reason (a manual recreate, an autoscaler scale-out, an auto-healing event), so the 10 running instances may stay on web-v1 indefinitely.

Option C does replace the instances, but only after you separately set the new template, and it deletes and recreates them without any surge or availability control. Recreating all 10 at once takes the service down, which the stem forbids.

Reference: Update instances in a MIG

Practice Test 1 ›

Study guides for Google Cloud Associate Cloud Engineer