17

I am running an Elastic Beanstalk load-balanced application for a year now. I'm looking for ways to cut back on costs and have discovered I could potentially use reserved ec2 instances instead of the On-Demand instances we are currently using. Currently, my load balancer uses two instances.

I want to make the switch but am unsure about how the process is actually done. I want everything to be crystal clear before doing anything.

From my understanding, if I reserve two of the same type of instance as used in my App, (t2.large with Linux) for the same availability zones (1 in eu-west1b, another in eu-west1c) I could use these instances for the load balancer. Will the same-type instances I currently have deployed immediately fall under rates of a reserved instance? Will I have to rebuild my environment and and build two new instances that match the reserved ones?

GreenGodot
  • 6,030
  • 10
  • 37
  • 66
  • Possible duplicate of [Can Amazon EC2 reserved instances be used with auto-scaling in AWS Elastic Beanstalk?](http://stackoverflow.com/questions/12785161/can-amazon-ec2-reserved-instances-be-used-with-auto-scaling-in-aws-elastic-beans) – Shawn Jan 27 '17 at 15:00

2 Answers2

29

A Reserved Instance a method of pre-paying for Amazon EC2 capacity.

If you were to buy two Reserved Instances (in your case, 2 x t2.large Linux), then for every hour of the year while the Reserved Instance is valid you will be entitled to run the matching instance types (2xt2.large Linux) at no hourly charged.

There is no need to identify which instance is a Reserved Instance. Rather, the billing system will pick a matching instance that is running each hour and will not bill any hourly charges.

Therefore, if these are the only matching instances you are running, then they will (by default) be identified as Reserved Instances and will not receive hourly charges. If you run other instances, however, there is no way to control which instance(s) receive the pricing benefit.

It is possible to purchase a Reserved Instance with, or without, identifying the Availability Zone. If an AZ is selected, then the pricing benefit of the Reserved Instance only matches an instance running in that AZ, and there is also a capacity reservation to give you priority when running instances that match the Reserved Instance. If no AZ is selected, then the pricing benefit applies across any instances running in that region, but there is no capacity reservation.

Bottom line: Yes, it will apply immediately (for the number of instances for which you have purchased Reserved Instances). There is no need to start/stop/rebuild anything.

John Rotenstein
  • 241,921
  • 22
  • 380
  • 470
  • Excellent, this is what I wanted to hear. I've contacted AWS support about this but have yet to receive an answer. – GreenGodot Jan 29 '17 at 10:32
  • Why did you wish to contact Support? Reserved Instances can be purchased through the Management Console. – John Rotenstein Jan 29 '17 at 22:51
  • 1
    Try this link for more info on how to purchase: https://aws.amazon.com/ec2/pricing/reserved-instances/buyer/ – user857276 Aug 20 '17 at 04:47
  • So just to be clear - if I reserve 2 servers and then 3 weeks from now I get a huge traffic spike which causes my load balancer to spin up an additional server, then that additional server is charged as an on demand server while the 1st two are reserved? – rugbert Sep 26 '18 at 19:40
  • @rugbert Please create a new question rather than asking a new question in a comment. (But the answer is Yes.) – John Rotenstein Sep 26 '18 at 23:42
8

For anyone looking for a bit more certainty than John's (correct) answer, here's the official AWS docs on the subject:

In this scenario, you have a running On-Demand Instance (T2) in your account, for which you're currently paying On-Demand rates. You purchase a Reserved Instance that matches the attributes of your running instance, and the billing benefit is immediately applied. Next, you purchase a Reserved Instance for a C4 instance. You do not have any running instances in your account that match the attributes of this Reserved Instance. In the final step, you launch an instance that matches the attributes of the C4 Reserved Instance, and the billing benefit is immediately applied.

Flowchart of reserved instance purchasing From here: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-reserved-instances.html

Neal
  • 3,102
  • 1
  • 14
  • 16