One VM in a managed instance group (MIG) is unresponsive and you need to replace it immediately. What should you do?
Choose an answer
Tap an option to check your answer.
Correct answer: Run gcloud compute instance-groups managed recreate-instances to recreate the VM..
Why this is the answer
The gcloud compute instance-groups managed recreate-instances command is the most direct and efficient way to replace a specific unresponsive VM within a managed instance group. This command terminates the specified instance and immediately creates a new one based on the MIG's current instance template, ensuring a quick replacement. Using gcloud compute instances update with a REFRESH action is not applicable here; gcloud compute instances commands operate on individual instances, not within the context of a MIG's managed lifecycle. While the Console offers a "Replace VMs" option, the question asks for a command-line solution. Updating and applying a new instance template would trigger an update across the entire MIG, which is overkill and potentially disruptive if only one VM needs replacement.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed