AWS Compute Blog
Efficiently manage HAQM EC2 On-Demand Capacity Reservations (ODCRs) with split, move, and modify
This post is written by Ninad Joshi, Senior Solutions Architect, Ballu Singh, Principal Solutions Architect, and Ankush Goyal, Enterprise Support Lead AWS.
Introduction
In today’s cloud-first world, managing compute capacity efficiently while making sure of application availability is crucial for your business. HAQM EC2 On-Demand Capacity Reservations (ODCR) is a valuable tool for organizations looking to manage their reservations, but managing reservations across multiple teams and accounts is challenging. Recently, AWS introduced new capabilities – split, move, and modify – that improve how organizations can manage their Capacity Reservations. In this post, we explore how these features can transform your operations.
Common ODCR management challenges
As a consumer of ODCR, you might face several challenges managing your Capacity Reservations. These challenges include but are not limited to the following:
- Underused reserved capacity in some accounts
- Inability to redistribute excess capacity efficiently
- Difficulty in managing existing capacity across multiple AWS accounts
- Difficulty in modifying reservation attributes post-creation
With multiple development teams and various projects running simultaneously, you might struggle with efficient capacity allocation. You might also find yourself dealing with situations where one team has excess capacity while another desperately needs it.
Use case 1: Redistributing capacity across teams
The unused capacity dilemma
Consider a scenario where your machine learning (ML) team has an ODCR for ten c5.2xlarge instances, but they’re only using five. Meanwhile, your Analytics team urgently needs three HAQM Elastic Compute Cloud (HAQM EC2) instances of the same type for a new project. Previously, your Analytics team would have had to create a new reservation, leading to unnecessary overhead of managing their own Capacity Reservation. Meanwhile, the five unused capacity slots of the ODCR owned by your ML team results in unnecessary costs.
Split capability to the rescue
Using the new split capability, you can now divide the existing ODCR (see ODCR-1 in the following figure), which has a total capacity of ten EC2 instances, and create a new ODCR with three of the unused capacity.
Figure 1: Before split, ODCR-1 with original total and unused capacity
This results in the creation of two ODCRs:
- Original ODCR: total capacity of seven instances for the ML team
- New ODCR: three instances for the Analytics team
The following figure illustrates the split result:
Figure 2: After split, ODCR-1 with updated total and unused capacity, and newly created ODCR-2
Sharing across accounts
The split operation creates the new ODCR in the same AWS account. If your teams operate under the same AWS account, then the split operation is direct without any further steps. However, if your teams use different AWS accounts, then you would need to use AWS Resource Access Manager (AWS RAM) to share the newly created ODCR after the split operation. This enables cross-account capacity management while maintaining centralized control.
Refer to the API and CLI documentation for further information on the split capability such as parameters, exceptions, and limits.
Use case 2: moving capacity between reservations
Scaling for growth
After a few days, when your Analytics team needs one more capacity to launch an instance for their expanding project, you need to add more capacity to ODCR-2.
Move capability to the rescue
Instead of creating a new ODCR for this purpose, you can move one of the unused slots from ODCR-1 to ODCR-2. This flexibility saves you multiple steps involved in reserving new capacity, removes any disruptions to running existing workloads, and helps with simpler ODCR management. This rebalancing makes sure of optimal resource usage without further procurement.
Figure 3: Before move, ODCR-1 with unused capacity and ODCR-2 with current capacity
Figure 4: After move, ODCR-1 with reduced capacity and ODCR-2 with additional capacity
Refer to the API and CLI documentation for further information on the move capability such as parameters, exceptions, and limits.
Use case 3: adjusting reservation attributes for changing workload patterns
Dynamic workload requirements
When your data processing workload patterns change significantly, you must adapt. Initially, you might have set up your ODCR with specific instance matching criteria, making it a targeted reservation for predictable workloads. However, as you introduce more dynamic, impromptu analysis projects, you need more flexibility in how instances can be launched against your reservation.
Modify feature to the rescue
Using the modify capability, you can now change the reservation’s attributes without creating a new reservation or disrupting running workloads. You can modify your ODCR by:
- Changing instance quantity
- Changing instance eligibility from Targeted to Open
- Adjusting the reservation’s end date to align with your project timeline
This modification allows you to:
- Launch new instances more flexibly without strict instance eligibility
- Improve the usage of reserved capacity across different projects
- Maintain cost optimization while adapting to changing business needs
The modify feature provides this flexibility while making sure that your existing workloads continue running uninterrupted, making it an invaluable tool for dynamic environments. See the following figures for an example where the instance quantity of ODCR-2 is modified from four to six:
Figure 5: Before modify, ODCR-2 with total capacity of four and instance eligibility of targeted
Figure 6: After modify, ODCR-2 with new total capacity of six and instance eligibility of open
Increasing ODCR size or creating a new one is subject to capacity availability in HAQM EC2 on-demand availability. Therefore, if unused capacity is available in an existing ODCR, then moving/splitting that could be a better option than modifying an ODCR.
Refer to the AWS Documentation for more information on pre-requisites and considerations when modifying Capacity Reservations.
Refer to the API and CLI documentation for further information on the modify capability such as parameters, exceptions, and limits.
Special considerations for split capacity
In the preceding sections, we saw how you can use the split capability to detach excess unused capacity to create an ODCR for another team. However, you can also use this capability to split used capacity to create new ODCRs. This capability is particularly helpful when you want to split partially used ODCRs to create a new one for easier tracking and management. Along with the considerations for splitting unused/excess capacity, the following considerations apply for splitting used capacity:
- The used capacity can only be split for an ODCR with open instance eligibility that isn’t shared with any account.
- The instances running inside the reservation are of open eligibility (in other words they are not targeting the reservation).
- When you split the used capacity, the eligible instances are randomly selected. You cannot specify which running instances are split. If a sufficient number of eligible instances aren’t found to fulfill the split quantity, then the split operation fails. When you specify the quantity of instances to be split, by default any unused capacity is moved first, followed by any eligible running instances (the used capacity in your reservation).
In the next section we different scenarios where you can or can’t use split capability.
Scenario 1: managing internal ODCRs (Capacity Reservation not shared with any other AWS account)
For your internal projects, when managing ODCRs that aren’t shared with external partners (other AWS accounts) and all have open instance eligibility, consider this example with ODCR-1:
- Total capacity of ten c5.2xlarge instances, all with open instance eligibility
- Eight instances currently in use by your ML team
- Two unused instances
Figure 7: Before split, ODCR-1 with total capacity of 10 and 2 unused instances
This ODCR isn’t shared with any external AWS accounts, thus you have maximum flexibility in splitting the reservation. You can split up to nine instances into a new reservation (total capacity minus one), regardless of how many instances are currently in use. In this scenario, you can share used as well as unused capacity. This gives you significant freedom in restructuring the capacity allocation for your internal teams.
Figure 8: After split, ODCR-1 remains with total capacity of one, and ODCR-2 with total capacity of nine with two unused capacities
Scenario 2: managing shared ODCRs with partners (Capacity Reservation shared with other AWS account)
When you need to share your ODCR with a partner’s AWS account, consider this scenario where ODCR-1 has:
- Total capacity of ten c5.2xlarge instances
- Eight instances in use by both your team and your partner’s team
- Two unused instances
Figure 9: Before split, ODCR-1 shared with another AWS account
In this case, your options are more limited. ODCR-1 is shared with your partner’s AWS account, thus you can only split the unused capacity (maximum of two instances). After split, the newly created ODCR (ODCR-2) remains in your AWS account and isn’t shared with any other AWS account. This restriction helps prevent any disruption to your partner’s running workloads while still allowing for some flexibility in capacity management.
Figure 10: After split, ODCR-1 remains shared with another AWS account, and newly created ODCR-2 isn’t shared
These scenarios demonstrate important factors about capacity management in both internal and partner-shared environments. You should carefully consider the sharing status of ODCRs before planning any splits or modifications, making sure of smooth operations for both your teams and your partners.
Special considerations for move capability
The move capability enables you to redistribute available (or excess) capacity between ODCRs. However, in certain cases, you can also use this capability to move used instances between ODCRs. This capability is particularly helpful if you want to merge partially used ODCRs into one for easier tracking and management. Along with the considerations for moving unused capacity, the following considerations apply for moving used capacity:
- Both source and destination ODCR are of open instance eligibility and in active state.
- The instances running inside the reservation are of open eligibility (in other words they are not targeting the reservation).
- Both source and destination ODCRs are owned by the same account.
- The source and destination ODCRs can be shared, but with the same list of accounts when moving used portion. This sharing to same accounts condition doesn’t apply to the unused portion of the ODCR.
When you specify the quantity of instances to be moved, by default any unused capacity is moved first, followed by any eligible running instances (the used capacity in your reservation).
In the next sections, we review where you can or can’t use this capability.
Scenario 1: source and destination ODCRs not shared with other account(s) (Team Transfers)
When managing capacity between your internal teams using the same AWS account (Account-A), you find the process clear. For example, when consolidating the ML team’s resources:
- ODCR-1 (ML Team A): had ten capacities total (all with open eligibility), with eight in use and two unused.
- ODCR-2 (ML Team B): had five capacities (all with open eligibility), all in use.
Figure 11: Before move, ODCR-1 and ODCR-2 both in the same AWS account, unshared
Both ODCRs belonged to the same account and weren’t shared externally, and the ODCRs have open instance eligibility. Therefore, you could freely move all ten instances from ODCR-1 to ODCR-2, creating a unified pool of 15 instances for the consolidated DevOps team.
Figure 12: After moving capacity from ODCR-1, ODCR-2 has combined total capacity of 15 with 2 unused
Scenario 2: source and destination ODCRs shared with the same account(s) (External Partner Collaboration)
If your ML team (ODCR-1) collaborates with an external AI research partner (Account-B), your setup might look like the following:
- ODCR-1: ten instances (eight used, two unused), all with open instance eligibility, shared with the research partner through AWS RAM.
- ODCR-2: Five instances (all used), all with open instance eligibility, for internal Analytics team.
Figure 13: Before move, ODCR-1 and ODCR-2 both in the same AWS account, with ODCR-1 shared with other AWS account
When your Analytics team needs more capacity, you can only move the two unused instances from ODCR-1 to ODCR-2, as the other eight are actively used in the partner collaboration.
Figure 14: Since ODCR-1 is shared with other AWS account, only unused capacity is moved to ODCR-2
Scenario 3: source and destination ODCRs shared with different account(s) (Multi-Partner Projects)
In this scenario involving managing capacity across different partner engagements:
- ODCR-1: Ten instances (eight used, two unused), shared with a database partner (Account-B).
- ODCR-2: Five instances (all used), shared with a security partner (Account-C).
Figure 15: ODCR-1 and ODCR-2 are shared with different AWS account
Due to the different partner arrangements, in other words ODCRs shared with another accounts, you can only move the two unused capacities from ODCR-1 to ODCR-2. This makes sure that there is no disruption to database partner workloads.
Figure 16: Only unused capacity moved to ODCR-2 due to shared capacity reservations
These scenarios teach valuable lessons about capacity management in multi-account environments. You can develop a comprehensive sharing strategy that balances flexibility with partner commitments, enabling you to optimize your resource usage while maintaining strong partner relationships.
Conclusion
The new ODCR features of AWS –a split, move, and modify – represent a significant advancement in cloud capacity management. For your organization, these features transform how you handle compute resources, enabling more efficient operations and cost management. The ability to dynamically adjust and share Capacity Reservations provides the flexibility you need while maintaining the stability necessary for your critical workloads.
As cloud infrastructure continues to evolve, these features demonstrate the AWS commitment to addressing real-world challenges that you face when managing complex cloud environments. If you’re looking to optimize your AWS infrastructure, then these new ODCR capabilities offer powerful tools for better capacity management and resource usage.
To enhance your understanding of these capabilities, we’ve created a GitHub repository containing APIs for implementation purposes. For more details, refer to the updated Capacity Reservations documentation. If you have any questions or feedback, feel free to share them in the comments section or contact AWS Support.