QuestionQ141

VerifiedPlanning and implementing a cloud solution

You are deploying an application to a Compute Engine VM that belongs to a managed instance group. The application must always be running, but only one instance of the VM should run per Google Cloud project. How should you configure the instance group?

Explanation

A managed instance group automatically recreates a VM that stops, crashes, or is deleted by something other than the MIG, so the application keeps running. The minimum and maximum numbers of instances are settings of the autoscaling policy: they bound how many instances the autoscaler creates in the group, and only an active autoscaler applies them. With autoscaling On, a minimum of 1 keeps at least one VM in the group and a maximum of 1 means the autoscaler never adds a second VM, so exactly one instance runs. With autoscaling Off (B, D), Off mode prevents automatic changes of the MIG's size, and the minNumReplicas and maxNumReplicas values of the autoscaling policy don't affect the target size you set manually, so neither limit is enforced and the group size depends on that manual setting. C allows the autoscaler to run two instances.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!