Understanding Capacity Reservations in Azure
@20aman Mar 12, 2022Capacity Reservations ensure that you get the capacity (in terms of CPU and memory) to start your VMs when you need those. This is a most common requirement when you are performing a failover in a disaster scenario. At that time, chances are that everyone else will also try to perform a failover and there can be a capacity crunch. This often results in "Capacity Allocation" errors and your VMs will not come up. The solution is to either select an alternate SKU (if that is available) or reserve capacity beforehand.
Differences
Capacity Reservation is different from Reserved Instances. Here are the key differences:
- Time considerations (Term) - Reserved Instance is a commitment to use a resource for a period of time. You get a discount for this commitment. E.g. 1-year or 3-year commitment on a VM. Capacity Reservation doesn't have a time/term commitment. It can be for any duration of time. The capacity is reserved and available immediately until the reservation is deleted.
- Linking - Reserved Instance is linked only to the VM size. The Capacity Reservation is defined with the combination of VM size, location, and quantity of instances to be reserved.
- Capacity Guarantee (SLA) - Reserver Instances don't guarantee the capacity. If the VM SKU is out of capacity you will get a Capacity Allocation error. Capacity Reservation guarantees capacity availability.
- Region vs Availability Zones - Capacity Reservations can be done for a region or an Availability Zone. Reserver Instances are available at the region level e.g. East US or Central US etc.
- Billing - Reserved Instances provide you a discount by committing to a term. Capacity Reservations cost you with pay-as-you-go rates for the underlying VM. More on this in the next section.
Pricing
Capacity Reservations are priced at the same rate as the underlying VM size (with pay-as-you-go rates). E.g. You have 4 D4s_v3 VMs for which you reserve the capacity. Then you will be charged for 8 VMs. 4 running VMs (as per their usage) and 4 capacity reservations (regardless of whether you use these or not).
But if you have the Reserved Instances, then Reserved Capacity is provided free of cost.
Also, when you are using the capacity that you reserved via Capacity Reservations then there is no additional charge for the reservation (other than the VM cost for the up and running VM).
Caveats
- While creating the Capacity Reservation, the capacity should be available in the target region or Availability Zone, otherwise, the reservation will fail (just like VM creation).
- Spot VMs and Azure Dedicated Host Nodes are not supported
- Availability Sets are not supported
- Deployment constraints like Proximity Placement Group, Update domains, and UltraSSD storage are also not supported
- Only Av2, B, D, E, & F VM series are supported right now. The SKUs will expand in near future.
- Only the subscription that created the reservation can use it.
- Reservations are only available to paid Azure customers
References: