Google Cloud Associate Cloud Engineer — Question 206
Your application is running on Google Cloud in a managed instance group (MIG). You see errors in Cloud Logging for one VM that one of the processes is not responsive. You want to replace this VM in the MIG quickly. What should you do?
Answer options
- A. Use the gcloud compute instances update command with a REFRESH action for the VM.
- B. Use the gcloud compute instance-groups managed recreate-instances command to recreate the VM.
- C. Select the MIG from the Compute Engine console and, in the menu, select Replace VMs.
- D. Update and apply the instance template of the MIG.
Correct answer: B
Explanation
The correct option is B, as the gcloud compute instance-groups managed recreate-instances command is specifically designed to recreate instances in a managed instance group quickly. Option A is incorrect because the update command does not serve to replace the VM. Option C, while viable, is not as efficient as using the command in option B. Option D would require more steps and doesn't address the immediate need for VM replacement.