loading...

AWS – Reducing costs by purchasing reserved instances

Reserved instances allow for deep cost savings, and have various models to give you a balance between flexibility and cost savings. Here are a few pointers to get you going down the right path:

  • Reserved instances have no distinguishing technical features compared to regular on-demand instances.
  • Reserved instances are not a specific EC2 resource; rather, they are a billing construct that gives you a discount for continuous usage that matches the subscription.
  • Put simply, purchasing a reserved instance entitles you to a discounted hourly rate on an on-demand instance that matches the properties of the reserved instance.
  • The discounted hourly rate will be of varying size, depending on how much you pay up front. As a general rule, the more you pay up front, the higher the discount.

When you purchase a reserved instance, you’re required to specify the following properties:

  • Platform: Linux/ Windows
  • Scope: Region or  Availability Zone
  • Instance Type: For example,  m5.large
  • Tenancy: Shared or dedicated
  • Offering Class: Standard or convertible
  • Term: 1-12 months or 1-3 years
  • Payment Option: No upfront, partial upfront, all upfront

We’ll explore the ins and outs a little later in this section. For now, let’s dive in and see how to make a purchase.

Getting ready

You’ll need an AWS account and some idea of which instance types you wish to reserve and for how long. Refer to the reserved instance properties that were mentioned previously for the exact information you’ll need to proceed.

The  Payment Option you choose will dramatically affect the price you pay when purchasing the reservation:

  • No Upfront: This means you pay nothing now, but you will be charged the discounted hourly rate for the entire term, whether or not you have an instance that matches the reservation. Also, note that choosing this option limits you to one year for Standard reservations and three years for Convertible reservations.
  • Partial Upfront: These reservations mean that you pay a smaller upfront fee, and then you are charged a discounted hourly rate only for the instance hours you use.
  • All Upfront: As the name suggests, you’ll be required to pay the full cost of the instance for the entire term. An effective 100% discount is applied to the hourly rate of your matching instances for that term.

Once you know all the properties of the instance reservation, you can go ahead and make a purchase.

How to do it…

Follow these steps to purchase a reserved instance:

  1. Go to the EC2 web console, select  Reserved Instances, then  Purchase Reserved Instances:

Purchase Reserved Instances
  1. We now need to perform a search for the instance type that you wish to purchase. In this example, we’re going to choose the following:
    • Platform Linux/Unix
    • Tenancy Default
    • Offering Class Standard
    • Instance Type t2.micro
    • Term 1 months-12 months
    • Payment Option All Upfront
  1. Obviously, choose the options that best match your workload. You almost certainly want to choose  Default as  Tenancy here. Dedicated tenancy/instances are run on hardware that will be occupied by only one customer (you) and are a lot more expensive:

Purchase Reserved Instances—Search
  1. The console will return a price for the instance reservation. Note that because we didn’t select  Only show offerings that reserve capacity, what we are seeing is a single result, that is, a reservation that applies to the region we’re currently viewing in the console. Think of this as a region-level reservation:

Purchase Reserved Instances—Add to Cart
  1. Now try selecting  Only show offerings that reserve capacity and note that all availability zones are showing for the current region. You can think of these as AZ-level reservations. Choosing one of these options obviously locks you in to a specific availability zone; however, you also get a capacity reservation:

Purchase Reserved Instances—Capacity Reservations
  1. Choose the reservation that looks right for you, and then click  Add to Cart and then  View Cart.
  2. The next page shows a summary of your imminent purchase. Click  Purchase to proceed. Note that this is the point of no return. Reserved instances can’t be canceled. Choose wisely!

Purchase Reserved Instances—Cart

Reserved instances are an invaluable tool to lower your overall AWS usage charges. Carefully analyze your EC2 usage, or use a tool such as Trusted Advisor to help with recommendations for making reserved instance purchases.

How it works…

After you’ve completed your purchase, your reservation will be marked as  Payment Pending, and then soon after, Active (there’s a third possible status, which is  Retired).

Once your reservation is  Active, the discount will automatically apply to match instances. AWS refers to this hourly discount as a billing benefit.

Choosing a  Convertible reservation class immediately rules out anything but a 3 year term. In return, you get a little more flexibility than the  Standard reservations, because if you decide the reservation no longer meets your needs, you can convert it to a reservation that is of equal or higher value, paying the difference, of course.

If you made a reservation for a specific availability zone, AWS also provides you with a capacity reservation, which will give you some guarantees around the availability of instances in that zone. This is something you might want to consider if your workload needs to maintain a certain amount of capacity in the event of an entire availability zone outage, for example. An event such as this tends to cause a rush of new instance requests in the unaffected zones; however, customers without a capacity reservation may find that their new instance requests can’t be fulfilled, because of a lack of capacity (this is not unheard of), causing them to miss out or forcing them to issue new instance requests for a different zone and/or instance type while at the same time crossing their fingers.

Unlike the billing benefit (hourly discount), which is applied immediately after purchase, a capacity reservation is used by the first instance you launch in the zone matching the properties of your reservation.

There’s more…

Here are a few more tips to help with your cost-optimization efforts:

  • Services that launch instances on your behalf (auto scaling, Elastic Beanstalk, and so on) are also eligible to have hourly discounts applied to them.
  • Standard reservations can be made for either 1 or 3 years. As mentioned before,  Convertible reservations are fixed at 3 years.
  • Under a consolidated billing model, reserved instance discounts are applied across all your subaccounts. For example, if you purchase a reserved instance intended for account A but there is no server matching its properties, the reservation will automatically apply to matching instances in account B. This only applies to the billing benefit and not the capacity benefit. Note that this behavior can be disabled.
  • Reserved instances can be sold in the AWS marketplace. This is useful if the reservation no longer suits your needs. Note that you will need a US bank account for this.
  • If reserved instances don’t seem to match your type of workload, you might consider a scheduled instance or a spot instance instead.

Comments are closed.

loading...