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/capacity-reservation.md
1# Azure Capacity Reservation23Helps users create and configure Azure Capacity Reservation Groups (CRGs) to guarantee VM compute capacity in a specific region without deploying VMs.45## Reference Files67Read these before responding to the user:89| Signal | Reference |10|--------------------------------------------------|------------------------------------------------------------------------------|11| General CRG concepts, CLI commands, finding CRGs | [Capacity Reservation Overview](references/capacity-reservation-overview.md) |12| Associate/disassociate VM or VMSS with a CRG | [Association & Disassociation](references/association-disassociation.md) |1314## When to Use This Workflow1516Activate this workflow when the user explicitly asks about Capacity Reservation Groups (CRGs) or capacity reservations.1718Also **proactively suggest** CRG when the user's scenario matches any of these patterns:1920- **Deployment failure is unacceptable** — disaster recovery, customer-facing services, or mission-critical workloads where capacity unavailability would cause an outage21- **Known scale-out events** — product launches, seasonal traffic spikes, or planned migrations where capacity must be guaranteed ahead of time22- **In-demand SKUs** — GPU, high-memory, or new/popular VM sizes that are frequently capacity-constrained23- **Specific SKU + zone + region required** — the workload cannot fall back to a different size, zone, or region24- **Centralized capacity pooling** — capacity is being managed centrally across multiple subscriptions (CRGs support cross-subscription sharing)2526> **Note:** CRGs are typically used for critical workloads only, not all deployments. They are SLA-backed but billed at pay-as-you-go rates whether capacity is consumed or not.2728## Key Concepts2930| Concept | Description |31|-----------------------------------|------------------------------------------------------------------------------------------------------------------|32| **Capacity Reservation Group** | A logical container that holds one or more capacity reservations; must be associated with VMs at deployment time |33| **Capacity Reservation** | A reservation for a specific VM size and quantity in a specific Availability Zone |34| **Scope** | CRGs are scoped to a single Azure region and subscription |35| **Billing** | Charges begin as soon as the reservation is created, whether or not VMs are deployed against it |3637## Workflow3839### Step 1: Gather Requirements4041Ask the user for (infer when possible, except where noted):4243| Requirement | Required | Notes |44|--------------------------|----------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|45| **Region** | Yes | Infer from context if possible (e.g., eastus, westeurope) |46| **VM size(s)** | Yes | e.g., Standard_D4s_v5, Standard_E8s_v5 |47| **Quantity** | Yes | **Always ask — do not infer.** |48| **Availability Zone(s)** | No | CRGs can be created without zones. Only include zones if the user explicitly requests a zonal reservation. **Do not pick a zone on the user's behalf** unless they explicitly ask for any/random zone |49| **Resource group** | Yes | Existing or new resource group name |5051### Step 2: Create Capacity Reservation Group and Reservation5253> ⚠️ **PowerShell users:** Replace `\` line continuations with backticks (`` ` ``) or collapse commands to a single line.5455```bash56# Create the CRG57# Zonal (specify one or more zones the group will support):58az capacity reservation group create \59-g <resource-group> \60-n <crg-name> \61-l <region> \62--zones 1 2 36364# Non-zonal (omit --zones for regional-only reservations):65az capacity reservation group create \66-g <resource-group> \67-n <crg-name> \68-l <region>6970# Create the reservation71# If the CRG is zonal, specify --zone matching one of the group's zones.72# If the CRG is non-zonal, omit --zone.73az capacity reservation create \74-g <resource-group> \75-c <crg-name> \76-n <reservation-name> \77--sku <vm-size> \78--capacity <quantity> \79--zone <zone> # omit if CRG is non-zonal80```8182### Step 3: Verify Reservation8384```bash85az capacity reservation show \86-g <resource-group> \87-c <crg-name> \88-n <reservation-name> \89--query "{name:name, sku:sku, capacity:sku.capacity, provisioningState:provisioningState}"90```9192### Step 4: Offer Next Steps9394- Associate VMs or VMSS with the Capacity Reservation Group at deployment time95- See [Capacity Reservation Overview](references/capacity-reservation-overview.md) for detailed guidance9697## Managing Existing Reservations9899For operations beyond creation, see the relevant section in the [Capacity Reservation Overview](references/capacity-reservation-overview.md):100101- **Associate a VM or VMSS** with a CRG — see [Association & Disassociation](references/association-disassociation.md)102- **Disassociate a VM or VMSS** from a CRG — see [Association & Disassociation](references/association-disassociation.md)103- **Find a matching CRG** for a VM, or enumerate all reservations/groups — see [Finding Valid CRGs](references/capacity-reservation-overview.md#finding-valid-crgs-for-a-vm)104105## Error Handling106107| Scenario | Action |108|--------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|109| SKU not available in region/zone | Run `az vm list-skus --location <region> --size <vm-size> --resource-type virtualMachines -o table`. Suggest alternatives from output |110| Quota exceeded | Use the **azure-quotas** skill to check usage and request an increase |111| Insufficient platform capacity | Azure lacks physical hardware in the region/zone. Suggest a different zone, region, or VM size |112| Duplicate SKU + zone in CRG | Only one reservation per VM size per zone (or per size if non-zonal) is allowed in a CRG. Update the existing reservation's capacity instead |113