Topic: Google Associate Cloud Engineer topic 1 question 33

You are deploying an application to a Compute Engine VM in a managed instance group. The application must be running at all times, but only a single instance of the VM should run per GCP project. How should you configure the instance group?

A.
Set autoscaling to On, set the minimum number of instances to 1, and then set the maximum number of instances to 1.
B.
Set autoscaling to Off, set the minimum number of instances to 1, and then set the maximum number of instances to 1.
C.
Set autoscaling to On, set the minimum number of instances to 1, and then set the maximum number of instances to 2.
D.
Set autoscaling to Off, set the minimum number of instances to 1, and then set the maximum number of instances to 2.

Re: Google Associate Cloud Engineer topic 1 question 33

In my GCP console, I created a managed instance group for each answer.  For each answer I deleted the instance that was created as a simple test to prove or disprove each answer. 

In answer A, another instance was created after I deleted the instance 
In answer B, no other instance was created after I deleted the instance
In answer C, another instance was created after I deleted the instance
In answer D, no other instance was created after I deleted the instance

My observation is A is the correct Answer.

A - Correct - It correctly solves the problem with only a single instance at one time
B - Incorrect - Does not fit the requirement because AFTER the deletion of the instance, no other instance was created
C - Incorrect - It creates another instance after the delete HOWEVER it 2 VM's could be created even if the target is exceeded
D - Incorrect - Does not fit the requirement because AFTER the deletion of the instance, no other instance was created

Re: Google Associate Cloud Engineer topic 1 question 33

Thanks for confirming this for us.

Re: Google Associate Cloud Engineer topic 1 question 33

thanks for confirming

Re: Google Associate Cloud Engineer topic 1 question 33

Thank you very much for this detail testing and explaination.

Re: Google Associate Cloud Engineer topic 1 question 33

Wrong! https://cloud.google.com/compute/docs/instance-groups MIGs offer the following advantages:

    High availability.
        Keeping VM instances running. If a VM in the group stops, crashes, or is deleted by an action other than an instance group management command (for example, an intentional scale in), the MIG automatically recreates that VM in accordance with the original instance's specification (same VM name, same template) so that the VM can resume its work.

Re: Google Associate Cloud Engineer topic 1 question 33

Why are you talking about MIG when the options are about AutoScaling on or off?

Re: Google Associate Cloud Engineer topic 1 question 33

I mean why don't you elaborate on Autoscaling part. If it is set to off will the MIG keep instance health?

Re: Google Associate Cloud Engineer topic 1 question 33

Because the question states MIG: "you are deploying an application to a Compute Engine VM in a managed instance group "

I am wondering if  XRiddlerX  got a MIG with the autohealing configured.
https://cloud.google.com/compute/docs/autoscaler

Autoscaling works independently from autohealing.
"If you configure autohealing for your group and an instance fails the health check,
the autohealer attempts to recreate the instance. Recreating an instance can cause the number of instances in the group to fall
below the autoscaling threshold (minNumReplicas) that you specify."

Re: Google Associate Cloud Engineer topic 1 question 33

Good point but this questions says nothing about auto-healing so we need to treat this question within context. The reason that auto-healing is not the correct way to implement this is because you can fall under your min instance number with auto-healing and not with auto-scaling. See below:
Autoscaling works independently from autohealing. If you configure autohealing for your group and an instance fails the health check, the autohealer attempts to recreate the instance. Recreating an instance can cause the number of instances in the group to fall below the autoscaling threshold (minNumReplicas) that you specify.

If you autoscale a regional MIG, an instance can be added then immediately deleted from one of the zones. This happens when the utilization in the zone triggers a scale out but the overall utilization in the regional MIG does not require the additional instance or the additional instance is required in a different zone.

Source: https://cloud.google.com/compute/docs/autoscaler

In conclusion, the answer is A.

Re: Google Associate Cloud Engineer topic 1 question 33

We want the application running at all times. If the VM crashes due to any underlying hardware failure, we want another instance to be added so we need autoscaling ON
Correct answer is A

Re: Google Associate Cloud Engineer topic 1 question 33

As said in other coment, you can fix this with Autohealing, autoscaling means more machines, autohealing means re creating of VM's

Re: Google Associate Cloud Engineer topic 1 question 33

Even if I agree with your response, it still does not meet the requirements asked in the question, which is "the application should be running all the time", because in your case when the VM instance for whatever reason stops, that mean the application will experience a downtime.

Re: Google Associate Cloud Engineer topic 1 question 33

A is wrong - What you are talking about is Autohealing. Autoscale will not rebuild the VM on the crash.

Re: Google Associate Cloud Engineer topic 1 question 33

won't auto healing take time to recreate that VM? and there should be one VM running all time

Re: Google Associate Cloud Engineer topic 1 question 33

Read this warning message: "The minimum number of instances is equal to maximum number of instances. This means the autoscaler cannot add or remove instances from the instance group. Make sure this is the correct setting."
So when minimum is equal to maximum, it does not matter whether autoscaling is on or off. So now the question is who takes care of running the MINIMUM instances: MIG itself.

Re: Google Associate Cloud Engineer topic 1 question 33

nice explanation

Re: Google Associate Cloud Engineer topic 1 question 33

B is the answer.

Re: Google Associate Cloud Engineer topic 1 question 33

A is the best answer. No Autoscaling = Risk. Turning off autoscaling removes the automatic health checks and recovery mechanisms, making your single instance vulnerable.

Re: Google Associate Cloud Engineer topic 1 question 33

B is correct. This is a trick question. Don't confuse "autoSCALING" with "autoHEALING"

Re: Google Associate Cloud Engineer topic 1 question 33

Another instance will be created after a crash of the running instance

Re: Google Associate Cloud Engineer topic 1 question 33

A is the correct answer.

A. When autoscaling is on, we can set minimum and maximum no of instances.
B. When autoscaling is off, we cannot set minimum or maximum no of instances. Instead we set no of instances.
C. Max no of instances can't be 2 as per question.
D. Max no of instances can't be 2 as per question.

Re: Google Associate Cloud Engineer topic 1 question 33

A - Correct

Re: Google Associate Cloud Engineer topic 1 question 33

A is the correct answer

Re: Google Associate Cloud Engineer topic 1 question 33

B - Autoscaling has no effect so A is wrong.