Single Instance Managed Instance Group Configuration on GCP

Planning and implementing compute resources. Managing compute resources.

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?

  1. Set autoscaling to On, set the minimum number of instances to 1, and then set the maximum number of instances to 1. Correct Answer
  2. Set autoscaling to Off, set the minimum number of instances to 1, and then set the maximum number of instances to 1.
  3. Set autoscaling to On, set the minimum number of instances to 1, and then set the maximum number of instances to 2.
  4. Set autoscaling to Off, set the minimum number of instances to 1, and then set the maximum number of instances to 2.
Answer Correct 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.

Community Insight

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.

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.

Community Discussion (129 comments)

RohPinky 👍 1 Selected: B
A MIG's basic job, independent of autoscaling, is to maintain the target size you set. If an instance crashes, is deleted, or fails a health check, the MIG automatically recreates it to bring the group back to the target size (this is sometimes called "auto-healing" — a separate feature from autoscaling). Autoscaling only controls whether GCP automatically changes the target size up or down based on load metrics (CPU, load balancer capacity, etc.). Turning it Off just means the target size stays fixed at whatever you set (1, in this case) — it doesn't mean the MIG stops maintaining that count.
0d2fdfa 👍 1 Selected: A
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
guaose 👍 1 Selected: A
Por qué usar autoscaling ON con min=1 y max=1: Si el autoscaling está activado, el grupo puede recrear automáticamente la instancia si falla (por ejemplo, si el VM se detiene o se elimina). Con min=1 y max=1, garantizas que solo exista una instancia en todo momento. Esto es la práctica recomendada para asegurar disponibilidad sin permitir escalado horizontal.
kamee15 👍 2 Selected: A
Autoscaling ensures availability: By enabling autoscaling with a minimum and maximum instance count of 1, the instance group will automatically recreate the VM if it fails, ensuring the application remains running at all times. Single instance per project: Setting the maximum number of instances to 1 enforces the requirement to run only a single instance of the VM in the project.
panchsonal 👍 2 Selected: A
The correct answer is: A. Set autoscaling to On, set the minimum number of instances to 1, and then set the maximum number of instances to 1. Explanation: Autoscaling to On: Enables the managed instance group (MIG) to ensure high availability by automatically recreating the VM if it becomes unhealthy or is deleted. Even though only one instance is needed, autoscaling ensures that the application remains available by maintaining the specified number of instances. Minimum number of instances = 1: Guarantees that at least one instance is running at all times. Maximum number of instances = 1: Ensures that only one instance of the VM is running within the project.
ritvikk49 👍 2 Selected: A
A is the correct answer. Group will recover if a node goes down only if Autoscaling is On
modaknarayan 👍 1 Selected: B
To meet the requirement that only a single instance of the VM should run at all times, you need to configure the managed instance group in such a way that: Autoscaling is turned off: You don’t want the instance group to scale up automatically based on load, as the goal is to keep only one instance running at all times. Minimum number of instances set to 1: This ensures that there is always at least one instance running. Maximum number of instances set to 1: This ensures that only one instance is allowed to run at any given time. Even if there is an issue with the instance, no new instances will be added, which ensures that only one instance runs. Thus, this configuration ensures that the application is always running with a single instance in the managed instance group.
modaknarayan 👍 1 Selected: B
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.
user263263 👍 1 Selected: B
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."
Mitra_1 👍 1 Selected: B
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.
denno22 👍 1 Selected: A
A is correct.
RJ78 👍 1 Selected: B
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.
stanleyjade 👍 1 Selected: A
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.
happy_cucumber 👍 1
autoscaling doesn´t ensure you to maintain and recover always one instance in that case. That task is what MIG does, not autoscaling, so you can switch off the autoscaling because MIG set to 1 always gonna be sure that always will be a healthy instance running.
DWT33004 👍 3 Selected: B
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.
Jemilan 👍 1
But it won't satisfy the first requirement which states that atleast one instance should be running all the times.
DWT33004 👍 2
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.
SumitDubey 👍 2 Selected: B
B is the answer.
PiperMe 👍 1 Selected: A
A is the best answer. No Autoscaling = Risk. Turning off autoscaling removes the automatic health checks and recovery mechanisms, making your single instance vulnerable.
shmoeee 👍 3
B is correct. This is a trick question. Don't confuse "autoSCALING" with "autoHEALING"
edoo 👍 2 Selected: A
Another instance will be created after a crash of the running instance
BARUNS 👍 3 Selected: A
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.
jrb_321 👍 2
A - Correct
Dinya_jui 👍 1
A is the correct answer
Bagibo 👍 2 Selected: B
B - Autoscaling has no effect so A is wrong.
ukedu 👍 1
Correct ans is B as autoscaling will create more instance and requirement is to run only single instance.
junkyaard 👍 1
A. Because we want app to be fail/crash safe.
JB28 👍 1
Option A, min 1 n max 1 with autoscaling
panihe 👍 1 Selected: A
Autoscaling only create new VM in place of unhealthy VM when its in MIG.
msalasy 👍 1 Selected: B
La respuesta es B, para el autoescalado se necesita establecer un criterio
gsmasad 👍 1 Selected: A
Set autoscaling to On because we want at least one VM to be up always
Acielana 👍 2 Selected: A
It correctly solves the problem with only a single instance at one time
HemrajLodhi 👍 1
A is correct because if you set autoscaling off then the purpose of running the application continously is defeated ie.e no downtime.
Jay2215 👍 1 Selected: A
If autoscaling remains off, it wont create another instance if existing gets deleted
Jorgeg95 👍 1
b is correct
AdelElagawany 👍 1
In my opinion B is the correct answer since no need for scaling if the required number of machines is 1 whatever the load is. In case of failure the autohealing will take care of creating a new instance to keep the max and the minimum number of machines equal to 1. I also tested the question using ChatGPT and give me the correct answer is (B).
joao_01 👍 1 Selected: B
I'll go with B. Since we have to scale related to some metric (e.g CPU), and the question only states to have 1 VM all the time, even if we set scaling ON and it crashed, the scaling will not do anything cause there were no CPU increase, for example. So, the scaling option here doesn't matter, what matters is the min and max options that are related to auto healing options. So the option B sets the scaling to OFF and min and max to 1. Seems legit to me.
joao_01 👍 1 Selected: B
It must be B. In the option A when we enable autoscaling, we must have different values for max and min, otherwise we will get a error.
norbi2790 👍 1
Maybe it changed over time, but im able to enable autoscaling with min-1 and max-1.
Yad_datatonic 👍 1 Selected: B
To ensure that only a single instance of the VM runs per GCP project while keeping the application running at all times, you should configure the instance group as follows: Option B: Set autoscaling to Off, set the minimum number of instances to 1, and then set the maximum number of instances to 1. Here's why this option is the correct choice: Setting autoscaling to Off ensures that the group does not automatically add or remove instances based on load or other conditions. This means the group will always have one instance running unless manually changed. By setting both the minimum and maximum number of instances to 1, you ensure that there can only be one instance of the VM running at any given time. Even if the instance fails or gets terminated for some reason, the group will automatically restart it to maintain a single instance. This configuration aligns with your requirement to have a single instance of the VM running continuously in the GCP project.
respawn 👍 1 Selected: B
B is the answer, we do not need autoscaling to maintain the instance count in a mig because autohealing will take care of it.
Sk2498 👍 1
So the autoscaling need not be enabled if the max and min instances are same ?
ExamsFR 👍 1 Selected: A
A is the correct answer
shadow1812 👍 1
The correct configuration for the instance group in this scenario would be option B: Set autoscaling to Off, set the minimum number of instances to 1, and then set the maximum number of instances to 1. By setting autoscaling to Off, you ensure that the instance group won't automatically create or remove instances based on scaling policies. This means that the group will always have a fixed number of instances. Setting both the minimum and maximum number of instances to 1 ensures that only a single instance will be running at all times. The minimum number of instances prevents the group from scaling down to zero instances, while the maximum number of instances prevents the group from scaling up beyond one instance. This configuration guarantees that the application will always be running, while also ensuring that only a single instance of the VM is active within the Google Cloud Platform (GCP) project.
MrZed 👍 1 Selected: B
To ensure that only a single instance of the VM runs per GCP project in a managed instance group, you should configure the instance group as follows: B. Set autoscaling to Off, set the minimum number of instances to 1, and then set the maximum number of instances to 1. Explanation: By setting autoscaling to Off, you disable the automatic scaling of the managed instance group. Setting the minimum number of instances to 1 ensures that at least one instance is always running. Setting the maximum number of instances to 1 ensures that only one instance can be running at any given time. Therefore, option B (Set autoscaling to Off, set the minimum number of instances to 1, and then set the maximum number of instances to 1) is the correct configuration to ensure that only a single instance of the VM runs per GCP project in the managed instance group.
KerolesKhalil 👍 1 Selected: B
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 .
Jelly_Wang 👍 2 Selected: A
A is correct. Set autoscaling of max and min number of instance of 1 to lock the instance number at 1. And take advantage of autoscaling to create a new instance if the old one crash. For those who vote for B, come on, you can't set max or min number of instance at all. Those are part of autoscaling. https://cloud.google.com/sdk/gcloud/reference/compute/instance-groups/managed/set-autoscaling
vivekvj 👍 1 Selected: A
• A. Set autoscaling to On, set the minimum number of instances to 1, and then set the maximum number of instances to 1. This works. With autohealing disabled, when we kill the single instance, the MIG recreates it.
xaqanik 👍 1 Selected: B
i vote for B
xaqanik 👍 1
because we dont need autoscaling turn on if we have only instance running. if VM crashes, autohealing will recreate a new one . in this case autoscale nothing to do. if we have more 1 vm, then we can turn on autoscale.
Buruguduystunstugudunstuy 👍 3 Selected: B
Answer 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.
GokulVelusaamy 👍 1 Selected: A
The Question clearly says - "The application must be running at all times, but only a single instance of the VM should run per GCP project", so it will be Option A
leogor 👍 1
A. Set autoscaling to On, set the minimum number of instances to 1, and then set the maximum number of instances to 1.
SaiSaiA 👍 2 Selected: A
I think the answer should be A. People who mentioned about autohealing but it is not indicated in the provided choices. As per GCP https://cloud.google.com/compute/docs/autoscaler#specifications 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. You can configure a MIG without Autohealing and if we stick to the choices that are provided, then it should be A.
AzureDP900 👍 1
A is right
AzureDP900 👍 1
A is right answer.
haroldbenites 👍 1
Go for A
Teraflow 👍 1 Selected: A
its obvioussss
zjitz 👍 1
Autoscaling setting is required to make sure MIG is able to create a new instance. With Autoscaling off it doesnt create/delete instances. so Answer is A
sai1621 👍 2
Answer is B B worked for me. I was able to recreate the scenario. ASG - ON is required only if we want to scale up / down based on any instance metric. Hence the decision.
arapin 👍 1 Selected: A
If I assume that there is a mistake in the answers, and it is supposed to be AUTOHEALING instead of AUTOSCALING, than the answer under A makes sense. Otherwise autoscaling makes no difference when there must be only a single instance at all times. So... I'll pick A as an answer with the assumption from above.
shawnkkk 👍 1
A. Set autoscaling to On, set the minimum number of instances to 1, and then set the maximum number of instances to 1.
vishnukumartr 👍 1
A. Set autoscaling to On, set the minimum number of instances to 1, and then set the maximum number of instances to 1.
Jaira1256 👍 1
Correct Answer is A
BobLoblawsLawBlog 👍 1
Going with B here after reviewing this for a long time. I've seen questions regarding B such as 'What happens if the instance stops for some reason?". First: "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." - see https://cloud.google.com/compute/docs/autoscaler Second: "If you configure an application-based health check and the autohealer determines that your application isn't responding, the MIG automatically recreates that VM. For a preemptible VM, the group recreates the VM when the necessary resources become available again." - see https://cloud.google.com/compute/docs/instance-groups/autohealing-instances-in-migs
BinaryBatman 👍 1
Answer should be B, high availability is feature of MIGs that says "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".
vikram___ 👍 2
A ( is correct ) B is not because if we delete with autoscaling off the instance is not recreated
lomari 👍 1
A is correct, autoscaling must be on. then observe the clause that ONLY one instance must be running.
vmart 👍 1
A is correct
djgodzilla 👍 5
B 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.
mcaromit 👍 1
A is correct
yuvi69 👍 2
yes answer is A
roaming_panda 👍 1
nice explanation
Fidget_ 👍 2
I believe it's B for a couple of reasons: - Autoscaling uses CPU, HTTP traffic, or Monitoring metrics to scale the MIG up and down. - I tested this - Created a MIG with autoscaling off, set min and max instances to 1. Deleted the instance via gcloud. After some loading, the instance was deleted and re-created (The instance count read "0 --> 1" during this time). I checked the creation timestamp and it was later than the previous instance. This also worked with a min and max of 2 instances I tried out of curiosity.
Fidget_ 👍 2
Okay I did this again and it didn't work with Autoscaling Off. It looks like you still need Autoscaling ON in order for instances to be re-created. Testing was done without health checks too.
EABDAJA 👍 1
A. Set autoscaling to On, set the minimum number of instances to 1, and then set the maximum number of instances to 1
nitinz 👍 2
Correct Answer is B. When you enable Autosclaing you need to give some conditions for it to auto scale. AutoScale is based on CPU, HTTP load or Stack Driver monitoring. What you are thinking about is autohealing here not autoscaling.
nitinz 👍 1
A is trap, correct answer is B. Just try it for yourself. B just works.
victory108 👍 1
A - Set autoscaling to On, set the minimum number of instances to 1, and then set the maximum number of instances to 1.
Gohs 👍 1
If you remove autoscaling, you must enable autohealing. This will ensure that your instance remains functional at all times. Now the point here is the length of downtime. If ONLY autohealing is on and your VM crashes, it'll will recreate the VM and this takes like a minute — more downtime. Assuming a maximum of one VM. If you enable autohealing and your VM crashes, it will scale to 1 VM in seconds — less downtime.
DucSiu 👍 1
A. Set autoscaling to On, set the minimum number of instances to 1, and then set the maximum number of instances to 1.
tsoetan 👍 1
A is correct, because must run at all times. Hence, Autoscaling need to be turned on.
rvrd 👍 2
B is correct. In GCP console I've :"The minimum number of instances is equal to the maximum number of instances. This means the autoscaler cannot add or remove instances from the instance group. Make sure that this is the correct setting."
INASR 👍 1
it is A. you need to set autoscaling to ON even if you have 1 VM. the questions says managed group which means all instances will serve traffic and if you don`t set autoscaling to one , all instances will keep serving.
gismo 👍 1
I suppose its A, because in case of failure of first working VM, the next will come to handle the workload. Therefore A is right answer (previously I marked as B).
nherrerab 👍 1
A is correct.
SoniaJacob521 👍 1
so it is A?
Ozymandiax 👍 2
After thinking a lot about it... the question does not say ANYTHING about autohealing; it's just an assumption we are making, it does talk just about autoscaling, and the experiment conducted states that answer is A
GCP_Student1 👍 2
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.
Ozymandiax 👍 5
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."
alpharomeo9 👍 1
I mean why don't you elaborate on Autoscaling part. If it is set to off will the MIG keep instance health?
Bhagirathi 👍 1
finally - A ?
Dineshvon 👍 1
correct answer is A
swatititame 👍 1
B. Set autoscaling to Off, set the minimum number of instances to 1, and then set the maximum number of instances to 1.
here2help 👍 8
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.
alpharomeo9 👍 2
Why are you talking about MIG when the options are about AutoScaling on or off?
sahedge 👍 2
incorrect Answer is A, did the same, MIG(stateless) - Autoscaling: No configuration, Autohealing: Autohealing is not configured.is not configured Deleted the instance, after few minutes updated instances on MIG from 1 to 0, and now its been around 10 min, still showing 0 instances. gcper please make sure you used MIG(stateless, autohealing:off)
Ravihonnagiri 👍 3
Trick here is that you can set minimum or maximum number of instances only when autoscaling is enabled. So answer should be A
gcper 👍 3
I 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).
gcper 👍 4
B 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
glam 👍 6
A. Set autoscaling to On, set the minimum number of instances to 1, and then set the maximum number of instances to 1.
Abishaik 👍 1
A. If auto-scaling is off, there's no guarantee that the application would be running at all times.
prashuG 👍 4
Requirements 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
XRiddlerX 👍 209
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
KerolesKhalil 👍 9
Thank 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
xaqanik 👍 7
why 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.
minnnnn 👍 2
Thanks so much
soukumar369 👍 1
Thank you very much for this detail testing and explaination.
Eshkrkrkr 👍 4
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.
prasanu 👍 2
thanks for confirming
ESP_SAP 👍 13
thanks so much for your time to test every option. This kind of collaboration really clarify the doubts!
Verve 👍 3
Thanks for confirming this for us.
spudleymcdudley 👍 4
Another 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
yasuke 👍 1
In the Google Cloud Console, the gcloud tool, or the Compute Engine API, set an autoscaler's mode to: OFF: Temporarily disables autoscaling. Use this mode to prevent automatic changes of the MIG's size. The autoscaling configuration remains intact so you can re-enable autoscaling later
cloudenthu01 👍 9
Correct 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 .
voler 👍 3
B should work fine. Automatic restart option will ensure that instance comes up after a crash. Does not need auto scale for it.
Dips_ 👍 2
won't auto healing take time to recreate that VM? and there should be one VM running all time
khaliqn 👍 31
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
👍 7
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.
Ozymandiax 👍 1
As said in other coment, you can fix this with Autohealing, autoscaling means more machines, autohealing means re creating of VM's
Gurnoor 👍 6
A is wrong - What you are talking about is Autohealing. Autoscale will not rebuild the VM on the crash.
hans_peter 👍 3
Just tested it. B is correct. No auto-scaling required.
sumanshu 👍 1
what if instance died?
mlantonis 👍 3
There is no reason to enable autoscaling. So B is the correct.
Ayanfe 👍 3
Autoscaling 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.
chr91 👍 3
Why should I enable the scaling if I just want a single instance? Why not answer B?
Dips_ 👍 9
what if your instance stops due to any reason?
Sinz 👍 4
The 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
Harshu5641 👍 6
What if that single instance fails? Autoscaling ON makes sure it creates one.

Comments & Corrections

No comments yet — spotted an error or have a note? Share it below.

Log in to comment, report an error, or add a note about this question.

Submitted for moderation before publishing. Keep it helpful and respectful.

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.

Official Reference

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?

With autoscaling off, the MIG's target size is fixed but not actively enforced. A community member tested this in the GCP console and confirmed that deleting an instance did NOT trigger recreation when autoscaling was disabled.

How does autohealing differ from autoscaling for a single-instance MIG?

Autohealing detects unhealthy instances via health checks and replaces them, while autoscaling enforces the minimum and maximum instance counts. The question doesn't mention autohealing, so autoscaling is the intended mechanism for guaranteed availability.

More ACE FAQ →

Related Analysis

Practice All ACE Questions

Access 84 questions with complete answers and detailed explanations.

View Full ACE Practice Test →

← Back to ACE Study Guide