Videos
I'm having a hard time understanding the pricing for EC2 on-demand instances when launched via "spot requests" and would be grateful if someone with more AWS experience can clue me in :)
So EC2 on-demand pricing is relatively straight forwarded when launching on-demand instances in a standard way (Console -> EC2 -> Instances -> Launch instance -> Select Instance type)
E.g. for t2.micro the price is 0,018 USD
However, when the same instance is launched via "spot requests" (Console -> EC2 -> Spot request -> Request spot instances) it is much cheaper. I understand what spot instances are (they can be reclaimed by the AWS with short notice), but with spot requests, it is possible to request on-demand capacity along with spot capacity... It is possible to request only on-demand capacity and get on-demand instances much cheaper.
E.g. "spot request" config for a single on-demand instance
Spot request capacity definition defining a single on-demand instanceGiven that instance is provisioned this way it is significantly cheaper than instances of the same type started via standard "Instance launch" flow. See the savings section for t2.micro on-demand instances started via "spot request" on the following image:
So for the t2.micro instance:
Standard launch => 0,018USD per hour
Spot request launch => 0,004USD per hour
So the question is what is the catch with on-demand instances started via "spot requests"? Can they also be reclaimed at short notice (I didn't find any docs stating so...)? Is there something else that I'm missing here?
Sadly, spot fleets don't work like this. If your spot instance gets terminated, no on-demand replacement is going to be created for you automatically. If it worked like this, everyone would be using spot instances in my view.
The on-demand portion of your spot fleet is separate from spot portion. This way your application will always run at minimum capacity (without spot). When spot is available, your spot instances will run along side your on-demand. This way you will have more computational power for cheap, which is very beneficial for any heavy processing application (e.g. batch image processing).
Details of how spot fleet and spot instances work are in How Spot Fleet works and How Spot Instances work docs.
Nevertheless, if you would like to have such replacement provisioned you would have to develop a custom solution for that.
There's a third-party solution called Spot.io that not only replaces the spot instance for an on-demand instance in a scenario like the one you describe but it has an algorithm that anticipates the interruption event and stands up an On-demand instance and has it ready before the interruption occurs.