Single Instance Managed Instance Group Configuration on GCP
Short answer
A Enable autoscaling with minimum and maximum both set to 1, so the MIG continuously enforces exactly one instance and automatically replaces it if it fails.
Question
the VM should run per GCP project. How should you configure the instance group?
Key Takeaways
The core test is whether autoscaling must be enabled to guarantee continuous availability of a single-instance MIG; the trap is assuming autoscaling off still auto-replaces deleted or crashed instances.
This question tests how to configure a Compute Engine managed instance group so a single-instance application remains available at all times. The correct approach uses autoscaling enabled with both minimum and maximum set to one, ensuring the group always maintains exactly one instance.
Common mistake: The most common wrong answer is B (autoscaling Off, min=1, max=1). Learners assume the MIG's fixed target size alone ensures a replacement is always created, but community testing in the GCP console showed that with autoscaling off, a deleted instance was NOT recreated.
Expert Analysis
Why the Answer Is Correct
With autoscaling set to On and both minimum and maximum set to 1, the autoscaler continuously enforces a target of exactly one instance at all times. If the sole VM crashes, is terminated, or fails due to a host event, the autoscaler detects the group has dropped below the minimum and provisions a replacement, satisfying the "running at all times" requirement. Because min equals max, the autoscaler will never scale beyond a single instance, which satisfies the "only a single instance per project" constraint. This configuration leverages the autoscaler as the active enforcement mechanism for the desired state, making it the most reliable way to guarantee continuous single-instance operation.
Why the Other Options Are Wrong
Option B (autoscaling Off) does not actively enforce the target size. As XRiddlerX empirically tested in the GCP console and documented with 209 upvotes, deleting an instance in an autoscaling-off MIG did NOT trigger automatic recreation of another instance. Without autoscaling on, the MIG does not proactively restore the instance count when an instance goes away, so the application would remain down until manual intervention — violating the "running at all times" requirement.
Options C and D both allow a maximum of two instances, which directly violates the requirement that "only a single instance of the VM should run per GCP project." Regardless of whether autoscaling is on or off, permitting a second instance is architecturally incompatible with the stated constraint.
As khaliqn noted, "If the VM crashes due to any underlying hardware failure, we want another instance to be added so we need autoscaling ON." While commenters like KerolesKhalil and xaqanik argued that autohealing (a separate feature from autoscaling) could handle VM failure, the question does not mention configuring autohealing, and XRiddlerX's hands-on testing confirmed that autoscaling-off MIGs did not recreate deleted instances. The correct answer within the context of this question is A.
Community Comment Notes
The most compelling evidence comes from XRiddlerX, who performed controlled console tests across all four configurations and found that only options with autoscaling On (A and C) triggered recreation of a deleted instance. KerolesKhalil argued for B on the grounds that "autohealing will start a new instance once the running VM become irresponsive," but this conflates autohealing with autoscaling — autohealing is a separate optional feature that was not mentioned in the question. Here2help pointed out that "you can fall under your min instance number with auto-healing and not with auto-scaling," reinforcing that autoscaling is the mechanism that enforces the minimum size. Anonymous noted the console warning when min equals max, but that warning only means the autoscaler won't scale beyond one instance — it doesn't mean autoscaling is unnecessary. The empirical evidence and consensus from the highest-voted comment converge on answer A.
Exam Strategy
When a question specifies both "must be running at all times" and a strict instance count limit, enable autoscaling with min equal to max to enforce the desired size continuously. Eliminate any option where max exceeds the stated instance limit, since that violates a hard constraint regardless of availability requirements.
Frequently Asked Questions
Why does autoscaling Off fail to recreate a deleted instance in a MIG?
How does autohealing differ from autoscaling for a single-instance MIG?
Discussion 121 contributions
Compiled from public community threads and reader submissions, lightly edited for clarity. Handles and vote tallies are shown as recorded, and comments reflect the views of individual contributors.
From public community threads 30 of 121
-
XRiddlerX 👍 209In 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
-
khaliqn 👍 31We 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
-
ESP_SAP 👍 13thanks so much for your time to test every option. This kind of collaboration really clarify the doubts!
-
KerolesKhalil 👍 9Thank you for taking time to test all options But B is the correct answer Min and Max instances arguments are separated from autoscaling . if VM crashed , autohealing will start a new instance once the running VM become irresponsive . in your test, you deleted the instance that's why autohealing didn't initiate a creation of another instance =================================== Actions not initiated by the MIG, such as the following: Preemption of a Spot VM. Infrastructure maintenance events when the VM instance is not set to live migrate. Deleting a VM in the group using the instances.delete method or the gcloud compute instances delete command. https://cloud.google.com/compute/docs/instance-groups/about-repair
-
cloudenthu01 👍 9Correct Answer A If for any reason VM crashes autoscaling set as OFF wont spin another instance in its place which would defeat the purpose of always running VM(tough there will be some disruption) as --Max-num-Instance is set to 1. There is no mention of auto-healing is set or not which is disable by default .
Show 25 more comments
-
Dips_ 👍 9what if your instance stops due to any reason?
-
here2help 👍 8Good 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.
-
Anonymous learner 👍 7Read 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.
-
xaqanik 👍 7why we need recreation VM with autoscale if we have only instance ? in this case autohealing recreates vm if vm crashes. if we set max and min 1 instance to run, we dont need autoscale. we only need autohealing in case of crashing.
-
Gurnoor 👍 6A is wrong - What you are talking about is Autohealing. Autoscale will not rebuild the VM on the crash.
-
Harshu5641 👍 6What if that single instance fails? Autoscaling ON makes sure it creates one.
-
Ozymandiax 👍 5Because 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."
-
djgodzilla 👍 5B is correct . I just tried it with Autoscalling OFF and checked the activity logs here's the proof : Instance Group Manager 'projects/388783089867/zones/us-east1-b/instanceGroupManagers/instance-group-1' initiated recreateInstance on instance 'projects/388783089867/zones/us-east1-b/instances/instance-group-1-3lrj'. ==>>>Reason: expected instance status RUNNING but STOPPING found.
-
gcper 👍 4B This question is considering "Managed Instance Groups" and to quote the documentation "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." This is independent of autoscaling! source: https://cloud.google.com/compute/docs/instance-groups Autoscaling is about reacting to load or traffic and being able to horizontally scale. We only have 1 VM so there is no horizontal scaling. source: https://cloud.google.com/compute/docs/autoscaler
-
Eshkrkrkr 👍 4Wrong! 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.
-
prashuG 👍 4Requirements 1. Since we need the application running at all times, we need a minimum 1 instance. 2. Only a single instance of the VM should run, we need a maximum 1 instance. 3. 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 to MIG so that application can continue to serve requests. We can achieve this by enabling autoscaling. So answer is A
-
spudleymcdudley 👍 4Another ambiguous question eyeroll but I think it has to be A as although B also works, there is no mention of setting up an autohealing health check. In this scenario, following the steps in the answers, only A will achieve the result. B would require extra steps not listed in the answer
-
Sinz 👍 4The only option that satisfies these three is Set autoscaling to Off, set the minimum number of instances to 1, and then set the maximum number of instances to 1. The answer should be : B Ref: https://cloud.google.com/compute/docs/autoscaler
-
DWT33004 👍 3 Answered BOption 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.
-
Buruguduystunstugudunstuy 👍 3 Answered BAnswer B. Set autoscaling to Off, set the minimum number of instances to 1, and then set the maximum number of instances to 1. Answer B is the correct answer because it sets the minimum and maximum number of instances to 1, ensuring that only one instance is running at any given time. With autoscaling turned off, no additional instances will be launched, even in the event of a failure or disruption. Answers A and C both allow for multiple instances of the VM to be running at the same time, which is not what the question is asking for. Answer D also allows for up to two instances to be running, which again is not what the question is asking for.
-
BARUNS 👍 3 Answered AA 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.
-
gcper 👍 3I don't think this is correct. I just created a managed stateless instance group without autoscaling and I have maximum and minimum as 1. No errors were given and the group (1 instance) was created. Then I deleted the instance with gcloud compute instances delete and the same instance came back up (same name).
-
Ayanfe 👍 3Autoscaling is what will help ensure you have at least one instance running. Else you're at risk of losing the only instance in case of any problem. When that single instance fails, Autoscaling helps bring up another.
-
voler 👍 3B should work fine. Automatic restart option will ensure that instance comes up after a crash. Does not need auto scale for it.
-
Ravihonnagiri 👍 3Trick here is that you can set minimum or maximum number of instances only when autoscaling is enabled. So answer should be A
-
shmoeee 👍 3B is correct. This is a trick question. Don't confuse "autoSCALING" with "autoHEALING"
-
chr91 👍 3Why should I enable the scaling if I just want a single instance? Why not answer B?
-
mlantonis 👍 3There is no reason to enable autoscaling. So B is the correct.
-
hans_peter 👍 3Just tested it. B is correct. No auto-scaling required.
-
Verve 👍 3Thanks for confirming this for us.
Reader comments & corrections
No reader corrections yet — spotted an error or have a note? Share it below.
Related Analysis
Practice All ACE Questions
Access 84 questions with complete answers and detailed explanations.
View Full ACE Practice Test →