Create Capacity Reservations in 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.
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't share Capacity Reservations that have been created in a cluster placement group.
-
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.
Topics
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.
You can create the cluster placement group using one of the following methods.
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. For more information, see Create a 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.
-
You can create the Capacity Reservation in the cluster placement group using one of the following methods.
Step 3: Launch instances into the cluster placement group
You launch an instance into a Capacity Reservation in a cluster placement group in the same way that you launch an instance into any Capacity Reservation. However, you must also specify the ARN of the cluster placement group in which to launch the instance. For more information, see Create a Capacity Reservation.
Considerations
-
If the Capacity Reservation is
open
, you do not need 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. -
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.
-
If the Capacity Reservation is in a Capacity Reservation group, you must specify the target Capacity Reservation group in addition to the cluster placement group in the request. For more information, see Capacity Reservation groups.
You can launch an instance into a Capacity Reservation in a cluster placement group using one of the following methods.