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.
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
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.
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."
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.
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
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.
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.
B. Set autoscaling to Off, set the minimum number of instances to 1, and then set the maximum number of instances to 1.
Explanation: To ensure that only a single instance of the VM runs at all times within your managed instance group, you should disable autoscaling and configure the instance group to have exactly one instance by setting both the minimum and maximum number of instances to 1.
Here's why the other options are incorrect:
A. Setting autoscaling to On contradicts the requirement to only have a single instance running at all times. Autoscaling would potentially increase the number of instances beyond one.
C. This allows for the possibility of having 2 instances, which is not in line with your requirement of having only one instance.
D. While autoscaling is off, the maximum instance count of 2 would still allow for more than one instance, which doesn't meet the goal.
There is nothing to scale, so autoscaling can be set to off and min instances = max instances = 1. Additionally you have to define a health check and switch autohealing on, but that isn't mentioned in the answers. From the documentation: "Autoscaling works independently from autohealing. If you configure autohealing for your group and an instance fails the health check, the MIG attempts to recreate the instance."
Correct Ans is B
Explanation:
Autoscaling Off: Since you want only a single instance of the application running at any given time, autoscaling should be turned off. Autoscaling typically adjusts the number of instances based on load, but since your requirement is to have exactly one VM instance running, autoscaling should be disabled.
Minimum and Maximum Instances set to 1: This ensures that the instance group will maintain exactly one VM running at all times. By setting both the minimum and maximum number of instances to 1, you guarantee that only one instance will ever be created and maintained.
As for option A. Set autoscaling to On, set the minimum number of instances to 1, and then set the maximum number of instances to 1: While this could theoretically work, enabling autoscaling when it is not needed complicates the setup. Autoscaling is unnecessary if you only want one VM running consistently.
Autoscaling Off: By setting autoscaling to Off, you ensure that the instance group will not automatically scale up or down based on demand. This is important because you only want a single instance of the VM running.
Minimum instances 1: Setting the minimum number of instances to 1 guarantees that at least one instance of the VM will always be running. This ensures that your application is always available.
Maximum instances 1: Setting the maximum number of instances to 1 prevents additional instances from being created, ensuring that only a single instance of the VM is running at any given time.
The correct answer is A
By setting autoscaling to "On" and configuring both the minimum and maximum number of instances to 1, you ensure that the managed instance group will always maintain exactly one running instance. If the instance fails or is terminated, the autoscaler will automatically recreate it, ensuring that the application remains available at all times.
Option A, setting autoscaling to On and configuring both the minimum and maximum number of instances to 1, may seem initially plausible, but it doesn't align with the requirement of having only a single instance of the VM running per GCP project.
With autoscaling set to On and both minimum and maximum instances set to 1, the managed instance group would indeed maintain a single instance of the VM. However, if for any reason that instance were to terminate unexpectedly (e.g., due to maintenance events, instance failure, etc.), the autoscaling mechanism would immediately attempt to launch another instance to maintain the desired minimum of 1 instance.
This behavior would potentially lead to multiple instances being spawned over time, violating the requirement of having only one instance running per GCP project.
Therefore, option B, with autoscaling set to Off and both minimum and maximum instances set to 1, ensures strict enforcement of having only one instance running at all times, aligning better with the specified requirement.
A is the best answer. No Autoscaling = Risk. Turning off autoscaling removes the automatic health checks and recovery mechanisms, making your single instance vulnerable.
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.
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
XRiddlerX
Highly Voted 4 years, 5 months agoprasanu
4 years, 2 months agoVerve
4 years, 4 months agosoukumar369
4 years, 1 month agoEshkrkrkr
4 years, 1 month agoalpharomeo9
4 years agoOzymandiax
4 years agoalpharomeo9
4 years agohere2help
3 years, 7 months agokhaliqn
Highly Voted 4 years, 6 months agoOzymandiax
4 years agoGCP_Student1
3 years, 10 months agoGurnoor
4 years, 6 months agoDips_
4 years ago[Removed]
3 years, 9 months agoroaming_panda
1 year, 11 months agomodaknarayan
Most Recent 2 days agouser263263
3 weeks, 3 days agoMitra_1
1 month, 2 weeks agodenno22
2 months, 1 week agoRJ78
3 months, 1 week agostanleyjade
4 months agoDWT33004
8 months, 3 weeks agoJemilan
1 month agoDWT33004
8 months, 3 weeks agoSumitDubey
9 months, 1 week agoPiperMe
9 months, 3 weeks agoshmoeee
10 months, 1 week agoedoo
10 months, 3 weeks agoBARUNS
11 months agojrb_321
11 months, 1 week agoDinya_jui
11 months, 2 weeks agoBagibo
11 months, 3 weeks ago