Reserve Capacity for your Azure VMs On-demand!
By Anshul
- 5 minutes read - 875 wordsHello Everyone! It’s been a while since my last post. Today’s topic will make some Azure customers (a substantial percentage as per Microsoft) save costs for their mission-critical workloads.
Microsoft has recently introduced a new service called ‘On-Demand Capacity Reservation’. Through this service, they are allowing their customers to purchase and get guaranteed capacity for their VMs throughout the interval that reservation is deployed in the subscription.
This feature is still in preview, which means the SLA that they offer is not yet available. And it will be available only after the general-availability of the feature. This feature could be useful for few scenarios like –
- Business-critical applications—use on-demand capacity reservations to protect your capacity, for example when taking these VMs offline to perform updates.
- Disaster recovery—you now have the option to set aside compute capacity to ensure a seamless recovery in the event of a natural disaster. The compute capacity can be repurposed to run other workloads whenever DR is not in effect. The VM maintenance can be handled by keeping core images up to date without the need to deploy or maintain VMs outside of DR testing.
- Special events—claiming capacity ahead of time provides assurance that your business can handle the extra demand.
How to get started?
First of all, you need to enable this feature for your Azure subscription. You can do this via Powershell or CLI. The commands to enable the feature using PowerShell will look like this-
Register-AzProviderFeature -FeatureName CapacityReservationPreview -ProviderNamespace Microsoft.Compute
#Check the status of Registration
Get-AzProviderFeature -FeatureName CapacityReservationPreview -ProviderNamespace Microsoft.Compute
#Re-register the Compute Resource provider to reflect the changes
Register-AzResourceProvider -ProviderNamespace Microsoft.Compute
You can give it a spin by creating a Capacity Reservation group in the Azure portal. While creating it, you need to provide VM size, location, and quantity as the mandatory fields. So now, you can have the capacity reservations deployed as a resource and can manage it directly from the portal. In order to use these reservations. you need to define the capacity parameter for the VM while creating it or you can attach it to any of the existing VMs with the same configuration.
Limitations
Since the feature is still in preview, the usage is limited for very basic scenarios.
- Creating capacity reservations requires quota in the same manner as creating virtual machines.
- Spot VMs and Azure Dedicated Host Nodes aren’t supported with Capacity Reservation.
- Some deployment constraints aren’t supported:Proximity Placement Group
- Update domains
- UltraSSD storage
- Only Av2, B, D, E, & F VM series are supported during public preview.
- For the supported VM series during public preview, up to 3 Fault Domains (FDs) will be supported. A deployment with more than 3 FDs will fail to deploy against capacity reservation.
- Availability Sets aren’t supported with capacity reservation.
- During this preview, only the subscription that created the reservation can use it.
- Reservations are only available to paid Azure customers. Sponsored accounts such as Free Trial and Azure for Students aren’t eligible to use this feature.
How are these Capacity Reservations billed?
These reservations are billed similar to the way you are billed for your VMs. And on top of that, these capacity reservations do not entail discounts meaning, you will be charged the PAYG prices for these reservations. For example, if you decide to buy 5 quantities of Capacity reservations for a VM of size D2s_v3, you will be charged for 5 D2s_v3 VMs even if the reservation is not being used.
If you then deploy a D2s_v3 VM and specify reservation as its property, the capacity reservation gets used. Once in use, you’ll only pay for the VM (disks, network, and other resources) and nothing extra for the capacity reservation. Let’s say you deploy 3 D2s_v3 VMs against the previously mentioned capacity reservation. You will see a bill for 3 D2s_v3 VMs and 2 unused capacity reservations, both charged at the same rate as a D2s_v3 VM.
On top of that, you can apply 1-year/3-year term-committed Reserved Instance on any of those VMs to get further discounts. So here the clear advantage is two-fold. You are getting guaranteed capacity for the time interval you want as well as saving costs for running those capacities.
Note:
You may get charged twice ( once for Reservation and the same for VM) for a single VM if you don’t attach the capacity reservation to the VM for the billing period.
Basic difference between Reserved Virtual Machine Instance (RI) and on-demand capacity reservation
Both RIs and on-demand capacity reservations are applicable to Azure VMs. However, RIs provide discounted reservation rates for your VMs compared to pay-as-you-go rates as a result of a term commitment, 1-year or 3-year terms. Conversely, on-demand capacity reservations do not require a commitment. You can create or cancel a capacity reservation at any time. However, no discounts are applied, and you will incur charges at pay-as-you-go rates after your capacity reservation has been successfully provisioned. Unlike RIs, which prioritize capacity but do not guarantee it, when you purchase an on-demand capacity reservation, Azure sets aside compute capacity for your VM and provides an SLA guarantee.
For more information, you can watch this introductory video on youtube. Also, you can look into the documentation here.
So that was it. Hope you found it useful!