Saving Money in Azure – Reservations - Cobweb

Saving Money in Azure – Reservations

Home » Content Hub » Saving Money in Azure – Reservations

Last time I wrote about Azure’s consumption-based, pay-as-you-go (PAYG) pricing model and the importance of choosing the right sizes and tiers of Azure resources to meet your current needs, rather than future needs, in order to save money.  I also explained that Azure resources can be resized fairly easily to meet variations in demand or turned off altogether when not needed, to further reduce costs.

Some workloads are fairly constant and can’t be turned off when not needed and this limits the cost savings that can be made by exploiting the elasticity of Azure.  For this type of workload, Azure offers solutions, the general name for which is “Reservations”.

Not all Reservations work the same way, but the general principle is that you commit to your resource being deployed and running for a period of time and in exchange Azure offers a discounted cost for it.  I like to think of it like a coffee through-the-mail subscription – I can buy ad-hoc packs of coffee at full price as and when I need to, but if I commit to a set number of packs each month, I get them at a discounted price.  Reservations are available for many Azure resources and more keep getting added, but the most commonly purchased type that I see are Virtual Machine (VM) Reserved Instances.

When a VM needs to be turned on 24/7, a Reserved Instance (RI) can be purchased to trade the flexibility of the PAYG pricing on the VM’s compute component, for a reduced, fixed equivalent monthly cost.  RIs come with a choice of a 1-year commitment term, reducing the monthly PAYG price by about 40%, or a 3-year commitment term reducing it by about 60%.  RIs can be paid for either up-front at the start of the term or monthly and there is no cost penalty for choosing the monthly option.

Azure manages the assignment of RIs to applicable VMs automatically and in the most utilisation-efficient way.  As soon as the RI is assigned to a VM, the meter for the PAYG compute component stops ticking up.  If the VM is powered off and another applicable VM is running, the RI is moved to cover that VM instead.

Due to the discounts being offered over PAYG prices, VMs don’t even need to be running 24/7 for savings to be seen when using RIs.  A commonly seen VM size is a D4as_v4 which has a cost of $0.222 per hour or $162.02 per month.  A 1-year RI has a cost of $95.25 per month and a 3-year RI has a cost of $60.95 per month.  Putting these numbers into Excel gives us the following graph:

Azure Reservations

This shows that if this VM is running for about 415 hours or more each month, it’s cheaper to purchase a 1-year RI rather than pay for it using PAYG, and if this VM is running for about 275 hours or more each month, it’s cheaper to buy a 3-year RI.

Even if this VM were only being turned on each workday from 6am until 8pm (that is 14 hours per day, 5 days per week) then in an average month it would be running for about 300 hours and a 3-year RI would be cheaper.  Factor in the extra costs of having the VM running for out-of-hours maintenance, any automation to turn it on and off and the administrators’ time for configuring and monitoring and it may be possible to justify an RI for this VM even if it’s powered on for fewer than 275 hours.

So, I’ve covered what can be good about RIs, but what are the downsides?  Firstly, PAYG is very flexible, but RIs are not.  RIs are purchased for a specific VM family so it is not possible to use a RI from one family against a VM in a different family.  You can however change the VM’s size within the same family.  Increase the size and the existing RI will cover part of the cost and PAYG will cover the other part, or two smaller RIs can be combined to cover one bigger VM.

RIs are also purchased for a specific Azure region, so one for the UK South region cannot be used against a VM located in the UK West region.  It is possible to cancel a RI part way through the term and purchase a different one, but you may need to pay an early termination fee for doing so.

RIs are a commitment for whole months only, you cannot get an RI that only commits to a certain number of hours each month.  In effect, this means you’re paying for the VM to be running during the night and at the weekend.  You can still turn the VM off if you need to, but it won’t extend the duration of the RI or make it any cheaper.  That being said, if you have two VMs in the same family that are never turned on at the same time, a single RI can cover both of them.  If both VMs are ever powered on together, one will be covered by the RI and the other will be covered by PAYG.

Lastly, it’s important to note that RIs only cover the VM’s compute cost – the licensing components and disks continue to be charged for as per PAYG.  Next time I will be writing about how the licensing costs can be reduced through the use of Azure Hybrid Benefit.

In short, Reservations can be used to achieve some big cost savings in Azure, but be aware of the caveats when deciding to purchase them.

And don’t forget that Reservations are available for many more Azure resources than just RIs for VMs.  If you’re wanting to know more about Reservations or RIs and if they can help you reduce your Azure costs, get in touch with us.