AWS Reserved Instances: Exchange To The Rescue
Tags: cloud, aws
Published: 2021-12-29 20:55:09

## Introduction
At [Facets.cloud](facets.cloud) we are planning to have a series of articles that aim to explain some of the complex cloud pricing logic and when you need to use them.
In this first part, we take up cost implications of exchange of RI (Reserved Instances).

AWS RIs are a great way to obtain a discount on your always running workloads (base compute) by committing for certain duration like 1 year or 3 years. Typically, you would look at your base on-demand compute to determine how many RIs to purchase at any time. This is all great in the normal course i.e. your business is growing and you are increasing the cloud spend and possibly buying more RIs time-to-time.

## AWS Cost Logic

For AWS too, it is a good deal as they get assured future business and lock-in. Another important point to note is that for cloud providers, the cost of an instance, storage or any other services reduces year on year. This is mainly due to technological advancements and scaling benefits.

So if AWS is offering you an instance for 10$ today, let’s say that if it costs AWS 9$ today, a year on it would cost them 7$ and two years later maybe 6$. It makes sense for AWS to sell you 3 year reserved instance at 27$ (9*3) today. A win-win situation.

## Exigency Scenario

Looking at discounts , say you have bought some RIs. But now consider an exigency like a large customer churn, or a great re-architecture, or a Covid on-set that leads to a reduction in your on-demand compute base. In these cases, your On-demand RIs will not get fully utilized, thus leading to cost leakage.

## How to Avoid Cost Leakage

Here is a tip to spread your No-upfront, Convertible RI commitments over a longer duration and reduce immediate $/hr spend for temporary relief.
Say, you have 3 RI Line-items purchased sometime in the past, amounting to 26 m5.2xlarge machines, expiring on June 30th, 2022. Assume today to be 15th Oct 2021. Due to an exigency, your current requirement has reduced drastically by 70%.
You can simply reserve one t3.nano (the smallest instance) as of today for 3 years (no upfront, Convertible), thus expiring on 15th Oct 2024. When you select all 4 RIs Line-items and put them for exchange, the number of machines reduces to 6 from 26 with an expiration date as 15th Oct 2024. You now have to worry about utilizing these 6 machines instead of 26.

This video demonstrates the same.
{% youtube JX3BYryW2OA%}

## RI Exchange Scenario

The way RI exchanges work is that AWS takes the SUM $ commitment value of the RIs to be exchanged and spreads it over the Max expiration date of the RIs to be exchanged. What we have essentially done is spread the 8.5 months of leftover commitment over 36 months. (8.5*26 is roughly 36*6).

## Why AWS Allows Exchanges to Extend but not Shortened

Can you do the reverse, i.e., buy 6 machines for 36 months and then later exchange them for 26 machines for 8.5 months? No. For AWS, this is a loss making proposition. Remember, future cloud costs are always reducing for AWS. If you take the first example above, one machine spread over three year (9 + 7 + 6 = 22$) is cheaper for AWS than equivalent three machine for the current year (9*3=27). Hence AWS will always stretch the exchange to maximum expiring item but never do the reverse.

## Conclusion and Summary

Nonetheless, in times of unforeseen bad luck, it still makes a lot of sense for you to use RI exchanges and control costs and leakages.
**Few points to note here**
1. This process is irreversible as explained earlier. So if your usage is back, you have to purchase new RIs.
2. You have a longer commitment with smaller $/hour than earlier. The total commitment remains the same.
3. Applies to No-upfront, convertible RIs only and not for other mechanism like AWS Savings plan.
4. You can of course sell RIs but some restrictions apply like you can’t sell Convertible RIs at the moment. AWS docs here.
Stay tuned for more tips on how to choose wisely between different reservation instruments like Standard, Convertible and Savings Plan.
Initial version of this article was published at [Facets.Cloud blog here.](facets.cloud)