Work with Capacity Blocks
To start using Capacity Blocks, you first find and purchase an available Capacity Block that matches your reservation size, duration, and timing needs. Then, when the reservation begins, you can use the Capacity Block by launching instances that target the reservation ID. Thirty minutes before the reservation expires, we begin to terminate any instances that are still running in the Capacity Block.
Capacity Blocks are delivered as targeted
Capacity Reservations in a single Availability Zone.
To run instances in a Capacity Block, you must specify the reservation ID when launching your
instances. If you stop instances on your own and the Capacity Block expires, you can't restart
them until you target another Capacity Block in the active
state.
By default, Capacity Blocks deliver low-latency, high-throughput network connectivity between the instances inside the Capacity Block, so there is no need to use a cluster placement group with a Capacity Block.
Topics
Prerequisites
You must use the corresponding Amazon Web Services Region for the instance type that you want to use. For more information, see Regions.
Capacity Blocks with p5.48xlarge
instances are available in following
Amazon Web Services Regions.
Region name | Region code |
---|---|
US East (Ohio) |
us-west-2 |
US East (N. Virginia) |
us-east-1 |
Capacity Blocks with p4d.24xlarge
instances are available in following
Amazon Web Services Regions.
Region name | Region code |
---|---|
US East (Ohio) |
us-west-2 |
US West (Oregon) |
us-west-2 |
Note
Capacity Block sizes of 64 instances are not supported for all instance types in all Amazon Web Services Regions.
Find and purchase Capacity Blocks
To reserve a Capacity Block, you first need to find a block of time when capacity is available that matches your needs. To find a Capacity Block that is available to reserve, you specify.
-
The number of instances that you need
-
The duration of time you that you need the instances
-
The date range that you need your reservation
To search for an available Capacity Block offering, you specify a reservation duration and instance count. You must select one of the following options.
-
For reservation duration – Up to 14 days in 1-day increments
-
For instance count – 1, 2, 4, 8, 16, 32, or 64 instances
If a Capacity Block is available that matches your specifications, we return the details of a single Capacity Block offering. The offering details include the start time of the reservation, the Availability Zone for the reservation, and the price of the reservation. For more information, see Pricing.
You can purchase the Capacity Block offering you are shown, or you can modify your search criteria to see the other options that are available. There is no predefined expiration time for the offering, but offerings are only available on a first-come, first-served basis.
When you purchase a Capacity Block offering, you get an immediate response confirming
that your Capacity Block was reserved. After confirmation, you will see a new Capacity Reservation in your
account with a reservation type of capacity-block
and a
start-date
set to the start time of the offering that you
purchased. Your Capacity Block reservation is created with a state of
payment-pending
. After the upfront payment is successfully
processed, the reservation state changes to scheduled
. For more
information, see Billing.
You can use one of the following methods to find and purchase a Capacity Block.
Launch instances into Capacity Blocks
After you reserve a Capacity Block, you can view the Capacity Block reservation in your Amazon
account. You can view the start-date
and end-date
to see
when your reservation will begin and end. Before a Capacity Block reservation begins, the
available capacity appears as zero. You can see how many instances will be available
in your Capacity Block by the tag value for the tag key
aws:ec2capacityreservation:incrementalRequestedQuantity
.
When a Capacity Block reservation begins, the reservation state changes from
scheduled
to active
. We emit an event through Amazon EventBridge
to notify you that the Capacity Block is available to use. For more information, see Monitor Capacity Blocks.
To use your Capacity Block, you must specify the Capacity Block reservation ID when launching instances. Launching an instance into a Capacity Block reduces the available capacity by the number of instances launched. For example, if your purchased instance capacity is eight instances and you launch four instances, the available capacity is reduced by four.
If you terminate an instance running in the Capacity Block before the reservation ends,
you can launch a new instance in its place. When you stop or terminate an instance
in a Capacity Block, it takes several minutes to clean up your instance before you can
launch another instance to replace it. During this time, your instance will be in a
stopping or shutting-down
state. After this process is complete, your
instance state will change to stopped
or terminated
. Then,
the available capacity in your Capacity Block will update to show another instance
available to use.
The following steps explain how to launch instances into a Capacity Block in the
active
state using the Amazon Web Services Management Console or the Amazon CLI.
For information about how to set up an EKS node group to automatically use a Capacity Block when it begins, see Capacity Blocks for ML in the Amazon EKS User Guide.
For information about how to launch instances into a Capacity Block using EC2 Fleet, see Tutorial: Launch instances into Capacity Blocks.
For information about how to create a Launch Template targeting a Capacity Block, see Launch an instance from a launch template.
You can use one of the following methods to launch instances into a Capacity Block.
View Capacity Blocks
Capacity Blocks have the following states:
-
payment-pending
– The upfront payment hasn't been processed yet. -
payment-failed
—The payment couldn't be processed in the 12 hour time frame. Your Capacity Block was released. -
scheduled
– The payment was processed and the Capacity Block reservation hasn't started yet. -
active
– The reserved capacity is available for your use. -
expired
– The Capacity Block reservation expired automatically at the date and time specified in your reservation request. The reserved capacity is no longer available for your use.
You can use one of the following methods to view your Capacity Block reservation.