Sub topic 5
Regional vs zonal RIs and capacity reservation
This chapter covers the scope setting on a Reserved Instance (RI). Scope decides where the discount applies and whether the RI reserves capacity. It assumes you know how Standard and Convertible RIs, terms, and payment options work. It also assumes you are comfortable with Regions, Availability Zones (AZs), and the AWS CLI.
Two separate jobs: discount and capacity
An RI can do two things for you:
- Billing discount. A matching running instance is billed at the lower RI rate instead of the On-Demand rate.
- Capacity reservation. AWS holds capacity for you in a specific AZ, so a launch request in that AZ is not rejected for lack of capacity.
The scope you choose when you buy the RI decides which of these you get.
| Property | Regional RI | Zonal RI |
|---|---|---|
| Scope setting | Region | Availability Zone |
| Discount applies in | Any AZ in the Region | Only the AZ you chose |
| Reserves capacity | No | Yes |
| Instance size flexibility | Yes, for eligible platforms | No |
| Fits matching instances | Within one instance family | Exact instance type only |
A Regional RI gives you the discount and flexibility. A zonal RI gives you the discount and a capacity reservation. You cannot get a capacity guarantee from a Regional RI.
Regional RIs
A Regional RI is the default choice in the console. The discount follows your usage across all AZs in the Region. If an Auto Scaling group moves instances from us-east-1a to us-east-1b, the discount moves with them.
Regional RIs also get instance size flexibility on eligible platforms. This applies to Linux/UNIX with default (shared) tenancy. The RI then covers any size in the same instance family and Region. Other platforms, such as Windows, don't get size flexibility, so check your platform before relying on it.
AWS compares sizes using a normalization factor:
| Size | Factor |
|---|---|
| nano | 0.25 |
| micro | 0.5 |
| small | 1 |
| medium | 2 |
| large | 4 |
| xlarge | 8 |
| 2xlarge | 16 |
| 4xlarge | 32 |
Suppose you own one Regional RI for m5.2xlarge (16 units). It can cover any of these in the same Region:
- One
m5.2xlarge(16 units). - Two
m5.xlarge(2 × 8 = 16 units). - Four
m5.large(4 × 4 = 16 units). - One
m5.xlargeplus twom5.large(8 + 4 + 4 = 16 units).
Flexibility stops at the family boundary. The same RI does not cover an m5a.xlarge or a c5.xlarge.
Partial coverage is possible. If you run one m5.4xlarge (32 units) against that 16-unit RI, half of its hours are billed at the RI rate and the rest at On-Demand.
Zonal RIs
A zonal RI is tied to one AZ and one exact instance type. Two things follow from this:
- The discount applies only to matching instances running in that AZ. A matching instance in another AZ is billed at On-Demand.
- AWS reserves capacity in that AZ for the term of the RI. This holds whether or not you have an instance running.
The capacity reservation is the reason to buy zonal. Consider a launch that must succeed during a predictable event, such as a regulated batch window or a failover target. If us-east-1a runs short of c5.large capacity, your launch there will still succeed. You are paying for that certainty with less flexibility.
The cost of zonal scope shows up when your layout changes:
- If you move the workload to another AZ, the RI stops discounting it.
- If you resize from
c5.largetoc5.xlarge, the RI no longer matches. - Unused zonal RI hours are still billed to you.
AWS evaluates zonal RIs before Regional RIs when it applies the discount. This is why mixing the two can leave a Regional RI to cover what the zonal ones don't.
Inspect the scope of your RIs
The describe-reserved-instances command shows each RI's scope and, for zonal RIs, the AZ.
aws ec2 describe-reserved-instances \
--filters Name=state,Values=active \
--query 'ReservedInstances[].{Id:ReservedInstancesId,Type:InstanceType,Scope:Scope,AZ:AvailabilityZone,Count:InstanceCount}' \
--output tableIn the output, Scope is either Region or Availability Zone. The AZ column is empty for Regional RIs. A zonal RI whose AZ no longer hosts matching instances is a candidate for modification, which comes next.
Changing scope
You can change the scope of an RI after purchase, but only within limits. The rules differ by RI type, so check the current modification rules for your RI before you plan around one. For a Standard RI, you can switch between Regional and zonal and change the AZ. The modified RI must keep the same total capacity, so the target instance count has to match the source.
aws ec2 modify-reserved-instances \
--reserved-instances-ids aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee \
--target-configurations Scope=Region,InstanceCount=2The ID above is a placeholder. Use an ID returned by describe-reserved-instances. Moving a zonal RI to Region scope gives up its capacity reservation, so confirm you no longer need it before you submit the change.
Capacity without a long commitment: On-Demand Capacity Reservations
Zonal RIs tie capacity to a one-year or three-year discount commitment. If you only need capacity, you can reserve it separately with an On-Demand Capacity Reservation (ODCR). An ODCR has these properties:
- It reserves capacity in one AZ for an instance type and platform.
- It can start immediately and be cancelled at any time. It has no one-year or three-year term.
- It bills at the On-Demand rate whether or not instances use it.
- It carries no discount by itself.
The discounts come from your other commitments. A Regional RI or a Savings Plan can discount instances running in the reservation. The ODCR holds the capacity and the commitment lowers the price. Zonal RIs bundle both functions, while the ODCR plus a Regional commitment lets you separate them.
aws ec2 create-capacity-reservation \
--instance-type c5.large \
--instance-platform Linux/UNIX \
--availability-zone us-east-1a \
--instance-count 4 \
--end-date-type unlimitedThis reserves four c5.large slots in us-east-1a until you cancel it. Launches that match the reservation's attributes use it automatically by default. Remember to cancel an ODCR you no longer need, because you pay for idle reserved capacity.
aws ec2 cancel-capacity-reservation \
--capacity-reservation-id cr-0123456789abcdef0Savings Plans behave like Regional RIs here. They discount usage but never reserve capacity. If you hold only Savings Plans and need a guarantee, pair them with an ODCR.
Choosing a scope
Use these criteria in order:
- Do you need guaranteed capacity in a specific AZ? If yes, buy a zonal RI, or an ODCR plus a Regional commitment.
- Does the workload move between AZs or change sizes? If yes, buy Regional. Auto Scaling groups that span AZs are the usual case.
- Is capacity only occasionally important? An ODCR on a Regional commitment lets you hold capacity for a short window (a launch, a sale) and release it afterward.
- Are you unsure? Default to Regional. You can narrow later with a modification more easily than you can recover from a stranded zonal RI.
Common mistakes:
- Buying zonal RIs for an Auto Scaling group that rebalances across AZs. Some of those RIs sit unused while instances in other AZs bill On-Demand.
- Assuming a Regional RI protects against capacity shortages. It does not.
- Forgetting that zonal RIs match the exact type, so a later move to a newer instance generation strands them.
- Leaving an ODCR active after the event it was for.
Exercise
You run twelve c5.xlarge instances across three AZs in an Auto Scaling group, and you also need a guaranteed c5.xlarge pair in us-east-1a for a failover test every quarter. Which scope would you choose for the steady load, and how would you handle the failover capacity?
Show answer
Buy Regional RIs (or a Savings Plan) for the steady load. The instances move between AZs, and Regional scope lets the discount follow them, with size flexibility if the platform is Linux/UNIX. For the failover pair, create an On-Demand Capacity Reservation for two c5.xlarge in us-east-1a shortly before each test and cancel it afterward. The Regional commitment still discounts instances that run in the reservation. A zonal RI would also reserve the capacity, but it would bill idle hours all year for a need that occurs once a quarter.