How are EC2 Instances Purchased?
Amazon offers 3 different ways to purchase EC2 instances. The different purchase options are available for all EC2 Instance Types. On-Demand Instances, Reserved Instances and Spot Instances. Depending on your technical and financial requirements, one of these options might provide a comparative advantage over the other. There is no difference in terms of the underlying hardware that is being launched. Only the pricing model is different. It’s important to properly understand the costs and benefits associated with each option.
On-Demand Instances
The most common instance purchase option follows the On-Demand pricing model. There is a fixed price for a particular instance type. You will be charged at an hourly rate until the instance is terminated.
Reserved Instances
While purchasing a Reserved Instance, you will need to specify a particular instance type, like m1.small and availability zone such as ‘us-east-1a’. Check the website, http://aws.amazon.com/ec2/, for present pricing data. EC2 instances are mainly treated the same as on-demand instances in the Dashboard. The only difference is the way that Amazon bills your EC2 instance utility. If you purchase Reserved Instances of a specific type in an availability zone and you have existing instances of the same instance type running in that zone, they will automatically be charged at the lower utility rate.
It’s the same Launching process when it comes to Reserved and On-Demand instances, but the system will apply the lower usage rate based on the number of Reserved Instances in that zone of the same type. They are the best purchasing option for businesses that have overly predictable and stable usage needs, and can offer huge cost savings over time. For example, if you’re certain about always having a minimum of four instances running at a stable rate for the upcoming year, you need to consider purchasing four Reserved Instances for a one-year team. Keep in mind that you can always refer to On-Demand Instances to suffice any additional resource requirements.
One of the other benefits of Reserved Instances is that you get to have the priority over On-Demand and Spot Instance users. In case the instance capacity ever reaches a limitation in a specific availability zone, Reserved Instance users have highest priority for launching instances. In case instance capacity ever goes up to 100% used in a specific availability zone, Amazon directly goes ahead and reserves the right to terminate a Spot Instance so that it can be provisioned for the satisfaction of getting a Reserved Instance launch request.
Spot Instances
Amazon provides Spot Instances which allow users to bid on free compute capacity on EC2, so that it gets the chance to maximize the utilization rates of existing cloud resources.
Users can set a maximum bid price that they’re willing to provide for an instance, for example $0.055. In case the Spot Price for Spot Instances drops below their maximum bid price, a Spot Instance will then be launched.
A running Spot Instance gets billed at the variable Spot Price, not the user’s bid price. A Spot Instance will continue to run while the Spot Price stays under the user’s maximum bid price. Yet, in case the Spot Price exceeds your maximum bid price or Amazon requires your Spot Instance in order to satisfy an On-Demand or Reserved Instance launch request, your Spot Instance will be certainly terminated by default.
Generally, Amazon updates the Spot Price multiple times through the day. When you request Amazon for a Spot Instance, you will need to wait till Amazon can satisfy that request. It might take multiple days or weeks before an Instance is launched, in accordance with your maximum bid price and Amazon’s excess compute capacity and Spot Price. Hence, don’t launch a Spot Instance if you wish to directly launch a server.
This option is helpful for running non-critical applications, since the instance may be terminated anytime. Never refer to a Spot Instance to launch a server that needs consistent uptime. When a Spot Instance server is launched inside the Dashboard, this server will stay in a “bidding” state till more compute capacity is available and the Spot Price drops below your maximum bid price. In case a Spot Instance is launched and later terminated by Amazon, the server will stay in the ‘bidding’ state. RightScale will automatically persist your Spot Instance request with Amazon until a new instance is launched when another becomes available. To retract your request for a Spot Instance from Amazon, you need to manually terminate the server.