Loading source
Pulling the file list, source metadata, and syntax-aware rendering for this listing.
Source from repo
Select, configure, and scale Azure compute resources—VMs, App Service, AKS, and Container Apps
Files
Skill
Size
Entrypoint
Format
Open file
Syntax-highlighted preview of this file as included in the skill package.
workflows/capacity-reservation/references/capacity-reservation-overview.md
1# Capacity Reservation Overview23Reference material for Azure Capacity Reservation Groups and Capacity Reservations.45## What Is a Capacity Reservation Group?67A Capacity Reservation Group (CRG) is a logical container for one or more capacity reservations. It acts as the association point for VMs and VMSS — you associate a VM or scale set with the **group**, and Azure matches the VM to a suitable reservation within that group.89## Constraints1011| Constraint | Detail |12|--------------------------------|------------------------------------------------------------------------------------------------------------|13| **Region-scoped** | A CRG and all its reservations must be in the same Azure region |14| **Zone-specific** | Each reservation targets a specific Availability Zone (or is non-zonal) |15| **Subscription-scoped** | A CRG lives in a single subscription but can be shared with other subscriptions via the `sharing` property |16| **VM size per reservation** | Each capacity reservation covers exactly one VM size |17| **Billing starts immediately** | You are charged for reserved capacity whether or not VMs are running against it |1819## Association and Disassociation2021See [association-disassociation.md](association-disassociation.md) for how to associate and disassociate VMs/VMSS with a CRG.2223## Common CLI Commands2425| Action | Command |26|-----------------------------|-------------------------------------------------------------------------------------------------------------|27| List CRGs | `az capacity reservation group list` |28| Show CRG | `az capacity reservation group show -g <rg> -n <crg> --instance-view` |29| Delete CRG | `az capacity reservation group delete -g <rg> -n <crg>` |30| List reservations | `az capacity reservation list -g <rg> --capacity-reservation-group <crg>` |31| Update reservation quantity | `az capacity reservation update -g <rg> --capacity-reservation-group <crg> -n <res> --capacity <new-count>` |32| Delete reservation | `az capacity reservation delete -g <rg> --capacity-reservation-group <crg> -n <res>` |3334## Finding Valid CRGs for a VM3536To associate a VM with a CRG, the CRG must contain a capacity reservation that matches the VM's **size**, **region**, and **zone** (if zonal). While `az capacity reservation group list` can enumerate CRGs at the subscription level, filtering down to matching reservations across many groups is inefficient. Azure Resource Graph is recommended for cross-resource-group discovery.3738### Option 1: Azure Resource Graph (recommended)3940ARG can query all capacity reservations across resource groups in a single call, filtering by location, VM size, and zone. This is the most efficient approach.4142> ⚠️ **Prerequisite:** `az extension add --name resource-graph`4344You must collapse this query to a **single line** before running it:4546```bash47az graph query -q "48Resources49| where type =~ 'Microsoft.Compute/capacityReservationGroups/capacityReservations'50| where location =~ '<region>'51| where properties.provisioningState =~ 'Succeeded'52| where sku.name =~ '<vm-size>'53| project id,54crgId = extract('(.*)/capacityReservations', 1, id),55resourceGroup,56zones,57size = sku.name,58capacity = coalesce(sku.capacity, 0),59associationCount = coalesce(array_length(properties.virtualMachinesAssociated), 0),60location61" --query "data[]" -o table62```6364The `crgId` in the output is the parent Capacity Reservation Group resource ID — this is the value to use when associating a VM or VMSS.6566To further narrow results for zonal VMs, add a zone filter:6768```kql69| where zones has '<zone>'70```7172### Option 2: CLI enumeration7374If ARG is unavailable, list CRGs per resource group and inspect their reservations:7576```bash77# List all CRGs78az capacity reservation group list -o table7980# List reservations within a CRG and check for matching size/capacity81az capacity reservation list \82-g <rg> \83--capacity-reservation-group <crg-name> \84--query "[?sku.name=='<vm-size>'].{name:name, size:sku.name, capacity:sku.capacity, zones:zones}" \85-o table86```8788## Estimating Reservation Cost8990Capacity reservations are billed at the same pay-as-you-go rate as the underlying VM size, whether or not VMs are running against them. Use the [Retail Prices API guide](../../../references/retail-prices-api.md) (unauthenticated) to look up hourly rates.9192**Estimated monthly cost:** `quantity × hourly rate × 730`9394> ⚠️ Prices returned are **estimates based on current retail pay-as-you-go rates**, not a final cost or contractual commitment. Actual charges may vary due to taxes, discounts (Reserved Instances, Savings Plans), or price changes.9596## Important Notes9798- **Deletion is blocked until prerequisites are met:** Azure rejects a CRG delete unless all VMs/VMSS are disassociated and all capacity reservations are deleted. Order: disassociate VMs/VMSS → delete reservations → delete group.99- **Quota required:** Capacity reservations consume vCPU quota just like running VMs.100101## Learn More102103- [Azure Capacity Reservations documentation](https://learn.microsoft.com/en-us/azure/virtual-machines/capacity-reservation-overview)104- [Create a Capacity Reservation](https://learn.microsoft.com/en-us/azure/virtual-machines/capacity-reservation-create)105- [Association and disassociation](association-disassociation.md)106