Does Reserve instances free reservation during replacement

0

Hi,

Let's say I bought 1 Zonal Reserved Instances, so InsufficientInstanceCapacity error won't happen during my deployment. I'm using Terraform for my deployment so during deploy this one instance is terminated and after than new one is created.

My question is how Reserved Instances will work in that case. Will terminating instance free reservation instantly or does it work like "terminate" state - instance does not exist anymore, but it still takes reservation for a little while.

preguntada hace un año213 visualizaciones
2 Respuestas
0

Reserved instance(RI) only apply to running instances. Once an instances is terminated the RI covering the instance will be released and applied to another instance that the RI covers or simply go unused if no instances matching the RI exist.

AWS
respondido hace un año
0

To ease any concerns regarding how zonal RIs apply to your instances when you terminate them or launch new ones, we highly recommend using On-Demand Capacity Reservations (ODCR) instead - https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-capacity-reservations.html - Zonal EC2 RIs were the very first type of RIs offered to customers, and they are very restrictive. To make sure you make best use of the capacity reservation, use ODCRs instead. And if you still want to benefit from the discount, purchase EC2 Instance Savings Plans instead of those zonal RIs (if your RIs are currently active, you can wait until they retire, and simply replace them with savings plans instead).

From capacity perspective - ODCR is flexible in a way that if you terminate an instance, the capacity will no longer be used, and you can launch a new instance into that reservation space. You can also set it up the way you need - either specify which ODCR you want your instance to use at launch, or leave the reservation open, so any instance with matching attributes could launch into that ODCR. You cannot do this with RIs (e.g. you can't specify to which EC2 instance you want your RI to apply, it just applies automatically depending on the attributes / parameters).

From the discount perspective - Savings Plans can apply both to your running EC2 instances, or to your unused capacity reservations (unused ODCRs). For example, if you are runing an instance inside the ODCR, in that case that instance will be benefiting from the SP discount; let's say you terminate your instance, now your ODCR is idle - so during that time your SP will be covering that idle reservation; and then, if you decide to launch a new instance inside your ODCR, that instance will start getting the discount from your SP again in place of the original instance that you already terminated. When instances are running inside the ODCR - you are also not paying for that capacity reservation.

I hope this helps!

profile pictureAWS
EXPERTO
respondido hace un año

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.

Pautas para responder preguntas