Resizing a VM in an Availability Set After Allocation Failure
Short answer
C Deallocate all three VMs in the availability set, resize the target VM, then start every VM again.
Question
You try to resize one of the VMs, which returns an allocation failure message.
It is imperative that the VM is resized.
Which of the following actions should you take?
Key Takeaways
The question tests whether you recognize that an allocation failure means the availability set's cluster lacks capacity for the new size, and the trap is picking 'stop one VM,' which only works for same-size-family resizes without a capacity error.
When a resize of a virtual machine inside an availability set returns an allocation failure, Azure cannot place the VM on the cluster hardware the set requires, so every VM in the set must be deallocated first. This page establishes that stopping all three VMs, resizing the target VM, then restarting the set is the required AZ-104 fix (option C).
Common mistake: Most learners pick A (stop only the VM being resized). That works when the resize stays inside the same VM size family and the cluster has spare capacity, but the question explicitly states an allocation failure occurred, so deallocating a single member is not sufficient.
Expert Analysis
Why the Answer Is Correct
All members of an availability set must run on hardware that supports the set's fault and update domain model, so they effectively share a cluster and a VM size family. An allocation failure means that cluster cannot host the target size, and the only supported remedy is to deallocate the entire set, let Azure reallocate it, resize, and then restart. Microsoft's troubleshooting guide for "Error when resizing an existing VM" states that if the VM is part of an availability set, all VMs in that set must be stopped before any of them can change size. Deallocating all three releases the underlying hardware so the resize can be satisfied. That makes C the correct choice.
Why the Other Options Are Wrong
Option A describes the normal, seamless case, but the scenario has already reported an allocation failure, so stopping one member does not free enough of the set's hardware for the new size. Option B is an invented threshold: Azure has no rule that stopping exactly two VMs of three is enough, and it leaves one member consuming cluster capacity. Option D abandons the availability set entirely, sacrificing update-domain and fault-domain protection, and it does not by itself solve the underlying capacity problem the allocation error reports. Neither B nor D is a documented remediation step for this error.
Community Comment Notes
Several learners confirmed option C, with Sama5100 citing the official guide: "In the event of an allocation failure, we should stop all three VMs" and linking Microsoft's troubleshooting article. drainuzzo reinforced the wording, noting that since the question reported "You try to resize one of VMs, which returns an allocation failure message," "so you can only stop all the 3 vms." Others tested lab scenarios: MrJR reported being able to resize without stopping anything, and FritsB succeeded after stopping only VM1, but CommanderBigMac and wondinv both pointed out that this only works when the new size is on the same hardware, which the allocation error rules out. The vote-leaning comments therefore agree on C once the allocation failure condition is taken seriously.
Official Reference
This link opens the official vendor documentation in a new tab.
Exam Strategy
Key off the error text: whenever a question mentions an allocation failure or a change of VM size family for a VM in an availability set, the answer is to stop every VM in that set. Only assume an in-place, single-VM resize when the question gives no capacity or hardware-change indication.
Frequently Asked Questions
Why can't I resize just one VM in an availability set after an allocation failure?
Does resizing an availability set VM always require stopping all the other VMs?
Discussion 80 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 80
-
CLagnuts 👍 70C. Looks Correct Stop all the VMs in the availability set. Click Resource groups > your resource group > Resources > your availability set > Virtual Machines > your virtual machine > Stop. After all the VMs stop, resize the desired VM to a larger size. Select the resized VM and click Start, and then start each of the stopped VMs.
-
MrJR 👍 41This question is deprecated. I tested and I was able to change the size of a VM, which is in an availability set with two other VMs, without stopping any other VM. With the three VMs up you can resize any of them.
-
CommanderBigMac 👍 37All this means is that the change in hardware was supported by whatever the availability set was running on, not that the question is depricated. If your VM(s) are deployed using the Resource Manager (ARM) deployment model and you need to change to a size which requires different hardware then you can resize VMs by first stopping your VM, selecting a new VM size and then restarting the VM. If the VM you wish to resize is part of an availability set, then you must stop all VMs in the availability set before changing the size of any VM in the availability set. The reason all VMs in the availability set must be stopped before performing the resize operation to a size that requires different hardware is that all running VMs in the availability set must be using the same physical hardware cluster. Therefore, if a change of physical hardware cluster is required to change the VM size then all VMs must be first stopped and then restarted one-by-one to a different physical hardware clusters.
-
drainuzzo 👍 29But the question reported: "You try to resize one of the VMs, which returns an allocation failure message." so you can only stop all the 3 vms
-
wondinv 👍 10After testing in lab, it's possible to change the size of a VM which is included in a Availability Set without turning it off. The restriction comes when the physical cluster does not have anymore resources left. On this situation an error message will be showed as stated on the question. In this case, you need to turn all the VMs down and resize the desired on. (In the background AWS will replace the VMs to a different hardware cluster if needed).
Show 25 more comments
-
Vkom 👍 5C is the correct answer Only one VM in same availability set can be resized if upgrading to same VM family. In the question you see "allocation error" which happens if you are upgrading one VM which is not part of same VM family, or the VM is not available. The resolution is to stop all the VMs and resize each VM. Please check troubleshooting guide for better explanation:
-
thalasi 👍 5 Answered CAll VMs in an availability set must use the same hardware type / size family to maintain fault domain and update domain consistency. When you try to resize one VM, you may get an allocation failure because: Azure cannot find enough available capacity in the cluster hosting the availability set All VMs in the availability set must be resized together
-
NaoVaz 👍 5 Answered C"If the VM you wish to resize is part of an availability set, then you must stop all VMs in the availability set before changing the size of any VM in the availability set. " C) "You should stop all three VMs." seems to be the correct option.
-
FritsB 👍 5 Answered AJust tested it in my lab. I created an availability set, added 3 VM's. Stopped VM1 and resized it and started it again. No issues.
-
locke7 👍 4When VMs are included in an availability set, Azure distributes them across multiple fault domains and update domains to ensure that if there is a hardware or software failure, only a subset of the VMs are impacted, providing higher availability. When you try to resize a VM, the Azure platform needs to allocate the necessary resources in a specific fault domain and update domain. If the platform cannot find available resources in the same fault domain and update domain, the allocation fails. To resolve this issue, you can stop all three VMs in the availability set, resize the VM that you need, and then start all three VMs again. By stopping all three VMs, you ensure that all of them are running on different fault domains and update domains. This way, when you start them again, Azure can allocate resources for each VM in a separate domain, making it more likely that the allocation will succeed
-
Yuraq 👍 4“If your VM(s) are deployed using the Resource Manager (ARM) deployment model and you need to change to a size which requires different hardware then you can resize VMs by first stopping your VM, selecting a new VM size and then restarting the VM. If the VM you wish to resize is part of an availability set, then you must stop all VMs in the availability set before changing the size of any VM in the availability set. The reason all VMs in the availability set must be stopped before performing the resize operation to a size that requires different hardware is that all running VMs in the availability set must be using the same physical hardware cluster. Therefore, if a change of physical hardware cluster is required to change the VM size then all VMs must be first stopped and then restarted one-by-one to a different physical hardware clusters.”
-
EmnCours 👍 4 Answered CCorrect Answer: C 🗳️ If the VM you wish to resize is part of an availability set, then you must stop all VMs in the availability set before changing the size of any VM in the availability set. The reason all VMs in the availability set must be stopped before performing the resize operation to a size that requires different hardware is that all running VMs in the availability set must be using the same physical hardware cluster. Therefore, if a change of physical hardware cluster is required to change the VM size then all VMs must be first stopped and then restarted one-by-one to a different physical hardware clusters.
-
Ayb_FNZ 👍 4Answer is C. We have to understand the allocation failure error. When we create an availability set, all the mVMs are created within the same data center in specific racks (depends on the fault and update domains). When we resize, ARM looks for enough capacity to allocate 3 times the new size. If there is no enough compute capacity, it send s back an error. We have to stop all the VMs (aka deallocate) so they can be allocated on another rack where capacity is available for the 3 VMs (aka 3 times the new desired size)
-
Marciojsilva 👍 4"Resize Resource Manager (ARM) virtual machine to size not available in current hardware cluster If your VM(s) are deployed using the Resource Manager (ARM) deployment model and you need to change to a size which requires different hardware then you can resize VMs by first stopping your VM, selecting a new VM size and then restarting the VM. If the VM you wish to resize is part of an availability set, then you must stop all VMs in the availability set before changing the size of any VM in the availability set"
-
jellybiscuit 👍 4Perhaps it depends on the age of the question. Currently, M$ is currently encouraging people to initiate a resize without first deallocating. - if a resize is not possible in this way, the requested size isn't available in the current cluster - if the size isn't available in the current cluster, all the servers in the AS will need to be deallocated.
-
oopspruu 👍 4People here who are saying "we tested in lab" are missing the biggest clue in the question. "which returns an allocation failure message" - This clearly means an attempt was made to resize and it failed. Which means all 3 VMs need to be stopped before resizing the desired one.
-
Sama5100 👍 4 Answered CIn the event of an allocation failure, we should stop all three VMs in the availability set https://learn.microsoft.com/en-us/troubleshoot/azure/virtual-machines/windows/restart-resize-error-troubleshooting#issue-error-when-resizing-an-existing-vm
-
JunetGoyal 👍 4As Question specify "the error explicitly" in that case we have to stop all VM. Otherwise You can resize VM with out stopping, but sometimes it gave error in that case you have to stop all vm.
-
verifedtomic 👍 4 Answered CSince the VM is in an availability SET, all three VMs have to be identical. You can't resize one, but all three. To resize a VM(s), VM(s) have to be shutdown - deallocated
-
SHAHIN_STA 👍 3 Answered DAnswer: D. You should remove the necessary VM from the availability set. Explanation: When a VM is part of an availability set, resizing the VM can sometimes fail if there aren't sufficient resources available in the underlying hardware for the requested VM size. In this case, the correct action would be to remove the VM from the availability set, which allows resizing without being constrained by the availability set's resource allocation. After resizing, you can add the VM back into the availability set. Simply stopping the VMs (Options A, B, and C) doesn't resolve the allocation failure, as the issue lies with the available resources in the set, not with whether the VMs are running or stopped.
-
ElDakhli 👍 3 Answered CI'm working at a well-known cloud provider. The point is, the cloud physical hosts are assigned to Points Of Delivery (PODs) which consist of aggregates, each aggregate represents one flavor type. PODs are not identical and maybe it doesn't have the requested flavor. This took place initially cause the cluster (POD) has no sufficient resources of the requested flavor or even it hasn't the flavor in the physical cluster. The solution will be stopping all VMs and resize, so the VMs will be reassigned to a POD that has the flavor and sufficient resources. Below is Azure reference link. Please refer to the "Issue: Error when resizing an existing VM" topic.
-
jairoaquinterov 👍 3"A request to resize a VM or add a VM to an existing availability set must be tried at the original cluster that hosts the existing availability set. The requested VM size is supported by the cluster, but the cluster may not currently have sufficient capacity." "If the VM can be part of a different availability set, create a VM in a different availability set (in the same region). This new VM can then be added to the same virtual network. Stop (deallocate) all VMs in the same availability set, then start all applicable VMs in batch."
-
vombat186 👍 3This has nothing to do deprecation. Its an issue with the underlying cluster that hosts the VMs, it may not have capacity or doesn't support the VM size you want to change to. So just because it worked in your case, does not mean it will always work in the future.
-
marcusaurelius124 👍 3I believe the answer, C, is correct. "When you try to start a stopped Azure Virtual Machine (VM), or resize an existing Azure VM, the common error you encounter is an allocation failure." "After all the VMs stop, resize the desired VM to a larger size."
-
nilesh_1 👍 3I tested this in Feb-2023, and shutdown is not required. I could resize VM without shutting down. Once Size selected VM restarted automatically and resize operation successful.
-
abhikeshu 👍 2 Answered DOption 3 suggests stopping all three VMs. While stopping all VMs might temporarily free up resources within the availability set, it is not the most targeted or efficient solution to address the allocation failure during VM resizing. Additionally, stopping all VMs would disrupt the availability of services running on those VMs, which may not be acceptable in a production environment. Removing only the necessary VM from the availability set, as suggested in option D, allows for a more surgical approach. It addresses the allocation failure specifically for the VM that needs resizing while minimizing disruption to other VMs in the availability set. Once the necessary VM is resized, it can be added back to the availability set to restore its high availability and redundancy features. This approach is more targeted and focused on resolving the specific issue at hand without unnecessary disruption to other resources.
-
korben_dallas 👍 2I believe the answer is A under the assumption that the size check was already performed on the VM If the new size for a VM in an availability set is not available on the hardware cluster currently hosting the VM, then all VMs in the availability set will need to be deallocated to resize the VM. You can check which sizes are available on the hardware cluster where the VM is hosted prior to resizing. If the desired size is listed , then you don't have to deallocate all three. If the size you want is not listed, you have to deallocate all VMs in the availability set, resize VMs, and restart them.
-
emakid 👍 2 Answered CRetry the request using a smaller VM size. If the size of the requested VM cannot be changed: Stop all the VMs in the availability set. Click Resource groups > your resource group > Resources > your availability set > Virtual Machines > your virtual machine > Stop. After all the VMs stop, resize the desired VM to a larger size. Select the resized VM and click Start, and then start each of the stopped VMs. Source: https://learn.microsoft.com/en-us/troubleshoot/azure/virtual-machines/windows/restart-resize-error-troubleshooting#issue-error-when-resizing-an-existing-vm
-
Joshing 👍 2I haven't actually tested this. But I believe the question hints towards trying to resize one of the VMs to a size that is not available in the same hardware cluster. When at least one of the VMs is still running you will have reduced options to which sizes you can change to. So I think this question hints towards the error showing due to trying to change to a valid VM size but due to the Availability Set it's not available until all VMs are shut down. Correct me if I am wrong though as I haven't tested it and just done a little reading on the matter.
-
Muntazirsyed 👍 2I Performed this in LAB. We can resize any VM in Availability set without stopping other VMs.
Reader comments & corrections
No reader corrections yet — spotted an error or have a note? Share it below.
Related Analysis
Practice All AZ-104 Questions
Access 100 questions with complete answers and detailed explanations.
View Full AZ-104 Practice Test →