Use Capacity Reservations with cluster placement groups
You can create Capacity Reservations in a cluster placement group to reserve Amazon EC2 compute capacity for your workloads. Cluster placement groups offer the benefit of low network latency and high network throughput.
Creating a Capacity Reservation in a cluster placement group ensures that you have access to compute capacity in your cluster placement groups when you need it, for as long as you need it. This is ideal for reserving capacity for high-performance (HPC) workloads that require compute scaling. It allows you to scale your cluster down while ensuring that the capacity remains available for your use so that you can scale back up when needed.
After you create a Capacity Reservation in a cluster placement group, you can share it with other Amazon accounts. For more information, see Sharing Capacity Reservations in cluster placement groups.
Topics
Limitations
Keep the following in mind when creating Capacity Reservations in cluster placement groups:
-
If an existing Capacity Reservation is not in a placement group, you can't modify the Capacity Reservation to reserve capacity in a placement group. To reserve capacity in a placement group, you must create the Capacity Reservation in the placement group.
-
After you create a Capacity Reservation in a placement group, you can't modify it to reserve capacity outside of the placement group.
-
You can increase your reserved capacity in a placement group by modifying an existing Capacity Reservation in the placement group, or by creating additional Capacity Reservations in the placement group. However, you increase your chances of getting an insufficient capacity error.
-
You can share Capacity Reservations only from the cluster placement group that you own. You cannot share Capacity Reservations from a cluster placement group that you do not own.
-
You can't delete a cluster placement group that has
active
Capacity Reservations. You must cancel all Capacity Reservations in the cluster placement group before you can delete it.
Work with Capacity Reservations in cluster placement groups
To start using Capacity Reservations with cluster placement groups, perform the following steps.
Note
If you want to create a Capacity Reservation in an existing cluster placement group, skip Step 1. Then for Steps 2 and 3, specify the ARN of the existing cluster placement group.
Tasks
Step 1: (Conditional) Create a cluster placement group for use with a Capacity Reservation
Perform this step only if you need to create a new cluster placement group. To use an existing cluster placement group, skip this step and then for Steps 2 and 3, use the ARN of that cluster placement group.
Step 2: Create a Capacity Reservation in a cluster placement group
You create a Capacity Reservation in a cluster placement group in the same way that you create any Capacity Reservation. However, you must also specify the ARN of the cluster placement group in which to create the Capacity Reservation.
Considerations
-
The specified cluster placement group must be in the
available
state. If the cluster placement group is in thepending
,deleting
, ordeleted
state, the request fails. -
The Capacity Reservation and the cluster placement group must be in the same Availability Zone. If the request to create the Capacity Reservation specifies an Availability Zone that is different from that of the cluster placement group, the request fails.
-
You can create Capacity Reservations only for instance types that are supported by cluster placement groups. If you specify an unsupported instance type, the request fails.
-
If you create an
open
Capacity Reservation in a cluster placement group and there are existing running instances that have matching attributes (placement group ARN, instance type, Availability Zone, platform, and tenancy), those instances automatically run in the Capacity Reservation. -
Your request to create a Capacity Reservation could fail if one of the following is true:
-
Amazon EC2 does not have sufficient capacity to fulfill the request. Either try again at a later time, try a different Availability Zone, or try a smaller capacity. If your workload is flexible across instance types and sizes, try different instance attributes.
-
The requested quantity exceeds your On-Demand Instance limit for the selected instance family. Increase your On-Demand Instance limit for the instance family and try again. For more information, see On-Demand Instance quotas.
-
Step 3: Launch instances into Capacity Reservations in a cluster placement group
You can launch an instance into a Capacity Reservation that is in a cluster placement group with one of the following options:
-
Specifying the ARN of the cluster placement group in which to launch the instance – When you provide the ARN of a cluster placement group, Amazon EC2 launches the instance into that cluster placement group. You can use one of the following methods:
-
Specifying
open
– You do not have to specify the Capacity Reservation in the instance launch request. If the instance has attributes (placement group ARN, instance type, Availability Zone, platform, and tenancy) that match a Capacity Reservation in the specified placement group, the instance automatically runs in the Capacity Reservation. -
Specifying a Capacity Reservation – If the Capacity Reservation accepts only targeted instance launches, you must specify the target Capacity Reservation in addition to the cluster placement group in the request.
-
Specifying a Capacity Reservation group – For more information, see Using Capacity Reservation in cluster placement groups with a Capacity Reservation group.
-
-
Specifying only a Capacity Reservation group – For more information, see Using Capacity Reservation in cluster placement groups with a Capacity Reservation group.
-
Specifying only a Capacity Reservation – You can launch instances into a Capacity Reservation in a cluster placement group.
Note
When you launch instances by specifying only a Capacity Reservation or only a Capacity Reservation group, the instances are launched into the Capacity Reservations that are created in the cluster placement group, but the instances are not directly attached to the cluster placement group.
Sharing Capacity Reservations in cluster placement groups
You can share Capacity Reservations in cluster placement groups by either sharing only the Capacity Reservations, or by sharing both the Capacity Reservations and the cluster placement group in which they were created.
By sharing only the Capacity Reservation, you give consumer accounts access to that Capacity Reservation only. Consumer accounts have no visibility or access to the cluster placement group in which the Capacity Reservation is created. This gives you fine-grained control over consumer account access. Consumer accounts can't view any information about the cluster placement group, including its ARN.
When you share the cluster placement group and the Capacity Reservation, the cluster placement group is visible and accessible to consumer accounts. They can launch instances and create their own Capacity Reservations in it.
For more information, see the following resources.