GCP Associate Cloud Engineer Practice Question 74: Instance Template Immutable Change
Google Cloud Associate Cloud Engineer · Test 8 · question 4 of 10
A managed instance group uses an instance template that specifies machine type e2-medium. You need the group's future instances to use machine type e2-standard-4 instead. What is the correct way to make this change?
Show answer and explanation
Answer:
Instance templates are immutable once created; none of their fields, including machine type, can be edited after creation. The supported way to change a setting is to create a new template with the desired configuration and point the managed instance group at it, then optionally roll out the change to existing instances with a rolling update.
Option A is not possible because the console does not offer an edit action for an existing template's fields. Option B does not exist as a usable operation; there is no gcloud command that mutates the fields of an existing instance template. Option D is backwards: instance templates do not read settings back from running instances, and manually resizing individual instances does not change what new instances in the group will use.
Reference: Create instance templates