I could be dead wrong, but I imagine that many customers begin their AWS journey using on-demand instances in order to “test the water” to avoid making rash long-term commitment. Now let’s assume the initial testing of an organizations application(s) in AWS is successful and the organization is ready to go “all in” the cloud, they’ll more carefully consider cost optimizations. If an organization has deployed EC2 instances and made a commitment to AWS, “converting” on-demand to reserved EC2 instances is an easy way to provide significant cost savings….or is it?
The simple table below provides a few examples showing the cost savings that can be achieved when using reserved instances (RIs). Running a Linux t2.micro EC2 instance as a RI can save an organization approximately 42% per month (assuming the instance runs 24/7) as its monthly cost is $4.92 vs an on-demand instance which would cost $8.50 per month.
How do you convert a on-demand instance to a RI? Do you have to shut an instance down, create an AMI, and then redeploy using the RI “license”? Can you even convert an existing instance or do you have to build all new instances to take advantage of the savings offered by RIs? If you’ve worked with AWS for some length of time, you may be laughing to yourself because you’re familiar with RIs and know the answer, but these are questions I thought of because I didn’t wake up one day knowing everything about AWS.
Now I don’t want to keep you in suspense so I’ll share the answer with you now. What do you do to convert an on-demand instance to a RI? Practically nothing….you don’t need to make any changes to your EC2 instance, you don’t even need to reboot them, you just need to make sure you purchase an appropriate reserved instance. It’s important to understand that an AWS RI is not a “special VM”, but is nothing more than a billing concept; it may be helpful to think of a RI as being a coupon, or maybe a groupon, that is used to apply discounts to on-demand EC2 instances.
If you can save money using RIs, shouldn’t you buy RI groupons for every instance in your AWS environment? I mean, why wouldn’t you want to reduce your monthly costs? RIs seem like a no-brainer right?!?! Organizations can benefit from the lower costs associated with running RIs. AWS benefits as well because RIs have a term associated with them….you can’t buy RIs month-to-month, you purchase them in 12 or 36 month commitments. So before you purchase RIs for all of your EC2 instances, you need to evaluate how long or often your EC2 instances will be active.
Take the Linux t2.micro example from the table above. The cost to run that instance 24/7 for a year is $102 whereas a 12-month RI for a Linux t2.micro VM costs $59. If you’ll run this instance 24/7 for 1 year, then purchasing a RI for this instance IS a no-brainer.
But what if you will only need this instance 24/7 for 4 months OR you will run the instance all year but limit its use to a typical 40 hour work week? Using on-demand pricing, the cost of running the instance 24/7 for 4 months would be $34; the cost of running the instance 40 hours a week would be $24 for the year. In each example, running the instance using on-demand pricing is cheaper than the $59 RI cost (unless you forget to power it off), thus a RI should not be purchased for either of these use cases. Granted, this example is simple but I believe useful for understanding the concept of an AWS RI.
Purchasing a Reserved Instance
- Perform an assessment on your EC2 instances to determine if you should even consider RIs over on-demand pricing for them. Don’t assume RIs are appropriate for all of your EC2 instances but instead do an application analysis to evaluate the instances purpose and ongoing use. Once the use case is determined, do a cost analysis to determine if a RI makes more sense than on-demand pricing.
- From the AWS Services page, click EC2 | Reserved Instances | Purchase Reserved Instances
- On the Purchase Reserved Instances page, enter the following and click Search:
- Payment option: No Upfront, Partial Upfront, or All Upfront.
- Term: One-year or three-year. A year is defined as 31536000 seconds (365 days). Three years is defined as 94608000 seconds (1095 days).
- Offering class: Convertible or Standard.
In addition, a Reserved Instance has a number of attributes that determine how it is applied to a running instance in your account:
- Instance type: In this example, t2.micro
- Tenancy: Whether your instance runs on shared (default) or single-tenant (dedicated) hardware.
- Platform: The operating system; for example, Windows or Linux/Unix
NOTE: Reserved Instances do not renew automatically; when they expire, you can continue using the EC2 instance without interruption, but you are charged On-Demand rates. In the above example, when the Reserved Instances that cover the T2 and C4 instances expire, you go back to paying the On-Demand rates until you terminate the instances or purchase new Reserved Instances that match the instance attributes.
- When the search results are returned, click Add to Cart to the right of the RI you wish to purchase, and then click View Cart.
When purchasing a RI, you can choose between a Standard or Convertible offering class. RIs apply to a single instance family, platform, scope, and tenancy over the length of the term selected. If your compute needs change, you may want to modify or exchange your RI. The choice of a Standard or Convertible RI determines your options in this regard.
Using a Standard RI, some attributes, such as instance size can be modified during the length of the term; however, the instance type cannot be modified. If you purchase a t2.micro RI, you can modify the instance type to support any t2 instance type, say t2.large as an example, but you cannot modify the instance type from a t2 to an m4. If a Standard RI is no longer needed by an organization, it can be sold in the RI Marketplace.
A Convertible RI can be exchange for a new instance family, instance type, platform, scope, or tenancy but it cannot be sold in the RI Marketplace if no longer needed.
- On the Shopping Cart page, click Purchase to complete the purchase of the RI.
- When the purchase has been completed successfully, you’ll see a dialog box telling you that it may take a few the RI to change from a payment-pending to active state. Click Close.
- When the RI State changes to active, congratulations! You have successfully converted an on-demand instance to a RI. If you have a running instance that matches the specifications of the RI, the billing benefit is immediately applied; you don’t have to do anything else.
If purchased correctly, RIs can drastically reduce your AWS costs. If purchased incorrectly, RIs can increase your AWS costs. I can’t stress enough the need to evaluate/assess your EC2 instances in regards to their application and ongoing use cases so as to determine if on-demand or RI pricing is more cost effective….remember, a RI requires a 12 or 36 month term to obtain their cost savings. To kickstart the evalutation process, use AWS Trusted Advisor and review the Amazon EC2 Reserved Instances Optimization recommendations.
5 thoughts on “AWS – Converting EC2 from an On-Demand to Reserved Instance”
This (and other pages I found saying the same thing) is helpful. I looked at my bills and the pricing rules and found I’ve been paying twice as much as I needed to for the last five years.
This an incredibly informative and well written article, thank you!
RIs are on a par with spot instance costs in some AZs – and are obviously not going to get pulled at any time. AWS even alter and reset your ec2 type under the prior agreement , after an announcenment in November 2019. I was looking at an RI on a t2.micro and it was cheaper than “Free Lambda” although obviously not as scalable, however it fitted a complementary use case. (CLI and immediate response). Using fixed RI does have advantages. Scheduling stop start at weekends and evenings can also attract less billing for shorter term sandbox systems. KillAWSBill does that for free. Skeddly, CloudCheckr, Gorillastack too, at a price.
Very simple, straightforward and informative post David, thank you so much for explaining the RI concept in such a brief way and along with proper screenshots for practically doing it.