Soru

Zorluk: ZorManaging Compute Engine Resources

You need to update an existing regional Managed Instance Group named `frontend-mig` to use a new instance template named `frontend-v2` without incurring application downtime. Which sequence represents the correct chronological order of `gcloud` operations to execute this update and verify system stability?

  1. 1Create the new instance template `frontend-v2` with updated VM configuration parameters using `gcloud compute instance-templates create`.
  2. 2Set the target instance template of `frontend-mig` to `frontend-v2` using `gcloud compute instance-groups managed set-instance-template`.
  3. 3Trigger the incremental instance replacement process using `gcloud compute instance-groups managed rolling-action start-update`.
  4. 4Verify that all instances have completed update tasks and the group status displays `isStable: true` using `gcloud compute instance-groups managed describe`.

Cevap

The correct operational sequence is: 1) Create the new instance template (`frontend-v2`), 2) Associate the template with the Managed Instance Group (`frontend-mig`), 3) Initiate the rolling update action, and 4) Confirm the instance group has returned to a stable state (`isStable: true`).
The standard operational lifecycle for updating a GCP Managed Instance Group requires creating a new instance template first, as instance templates are immutable. Next, the target Managed Instance Group must be updated to reference this new template. After updating the group's template assignment, the engineer starts a rolling update to replace running VM instances gradually. Finally, running a describe command allows the engineer to confirm that the group has reached a stable status (`isStable: true`) and all instances pass health checks.

Adım Adım Çözüm

1
Create a new instance template containing the updated machine specs and boot image.
A new instance template resource named `frontend-v2` is registered in the project.
Compute Engine instance templates are immutable; modifying configuration requires creating a new template.
2
Update the Managed Instance Group configuration to point to the new instance template.
The target instance template for `frontend-mig` becomes `frontend-v2`.
The group controller needs the new template binding so it knows what specification to apply during rolling updates.
3
Execute the rolling update action on the group.
The group manager begins replacing instances in batches according to surge/unavailable settings.
This command actively initiates the replacement rollout without interrupting overall service availability.
4
Inspect the state of the Managed Instance Group.
The output confirms `isStable: true` once all VM instances are fully provisioned and healthy.
Verifying group stability ensures the deployment completed successfully and all instances passed autohealing checks.

Anahtar Kavram

Sequence of operations for updating Managed Instance Group (MIG) templates and performing rolling updates.
Bu soruyu puanla