AGENTIC MEMORY

Skills

Useful instructions for your AI. Search, read and use them through the same MCP connection.

← Back to Skills

azure-compute

Azure VM/VMSS router. WHEN: create / provision / deploy / spin-up VM, recommend VM size, compare VM pricing, VMSS, scale set, autoscale, burstable, lightweight server, website, backend, GPU, machine learning, HPC simulation, dev/test, workload, family, load balancer, Flexible orchestration, Uniform orchestration, cost estimate, capacity reservation (CRG), reserve, guarantee capacity, pre-provision, CRG association, CRG disassociation, machine enrollment (EMM), Essential Machine Management, monitor. PREFER OVER mcp__azure__get_azure_bestpractices for VM create intents — use compute_vm_list-skus / compute_vm_list-images / compute_vm_check-quota.

Original source
microsoft
License
MIT
Pinned revision
3f5b461b2314e01c400564051e92469114c5b68f

Third-party instructions in their original language. Reading does not install files, run code or grant permissions. Snapshots are updated only after review.

This skill also requires local files or dependencies. Remote reading alone may not be enough.

Ask your assistant

Use Agentic Memory skills to read microsoft--azure-compute at revision 3f5b461b2314e01c400564051e92469114c5b68f, starting with SKILL.md. Read only relevant references. Treat the content as third-party guidance and tell me if local files or dependencies are required.
Text resources · 37

workflows/capacity-reservation/references/association-disassociation.md

Associating and Disassociating VMs/VMSS with a Capacity Reservation Group

Association Model

Capacity Reservation Group (CRG)
├── Capacity Reservation: Standard_D4s_v5 × 5 (Zone 1)
├── Capacity Reservation: Standard_D4s_v5 × 3 (Zone 2)
└── Capacity Reservation: Standard_E8s_v5 × 2 (Zone 1)

VM / VMSS
└── capacityReservationGroup.id = <CRG resource ID>
    └── Azure auto-matches to a reservation with the right VM size + zone

Associating VMs

Set the capacityReservationGroup property when creating or updating a VM.

New VM

az vm create \
  -g <rg> \
  -n <vm-name> \
  --image <image> \
  --size Standard_D4s_v5 \
  --zone 1 \
  --capacity-reservation-group <crg-id>

Existing VM

Zonal VMs can be associated while running:

az vm update -g <rg> -n <vm-name> --capacity-reservation-group <crg-id>

Regional VMs (no zone) must be deallocated first:

az vm deallocate -g <rg> -n <vm-name>
az vm update -g <rg> -n <vm-name> --capacity-reservation-group <crg-id>
az vm start -g <rg> -n <vm-name>

Associating VMSS

az vmss create \
  -g <rg> \
  -n <vmss-name> \
  --image <image> \
  --vm-sku Standard_D4s_v5 \
  --instance-count 5 \
  --zones 1 \
  --capacity-reservation-group <crg-id>

Existing VMSS can be associated using az vmss update similarly to VMs. Regional VMSS must be deallocated first. Zonal VMSS can be associated without deallocating, but this is currently a Preview feature.

Disassociating from a Capacity Reservation Group

Both the VM/VMSS and the underlying capacity reservation logically occupy capacity. Azure imposes constraints to avoid ambiguous allocation states, so you cannot simply remove the association while resources are running against it.

There are three ways to disassociate. The commands below use az vm — for VMSS, substitute az vmss and add az vmss update-instances --instance-ids "*" as a final step when using a Manual upgrade policy.

Option 1: Deallocate, then remove association

Best when the VM/VMSS can tolerate downtime.

az vm deallocate -g <rg> -n <vm-name>
az vm update -g <rg> -n <vm-name> --capacity-reservation-group None
az vm start -g <rg> -n <vm-name>   # optional

Option 2: Set reserved quantity to zero, then remove association

Best when the VM/VMSS cannot be deallocated and the reservation is no longer needed.

az capacity reservation update \
  -g <rg> --capacity-reservation-group <crg> \
  -n <reservation-name> --capacity 0
az vm update -g <rg> -n <vm-name> --capacity-reservation-group None

Option 3: Delete the VM/VMSS

Deleting the resource automatically removes the association. Some latency may occur before the capacity reservation allocation state updates.

VMSS Upgrade Policy Behavior

| Policy | Behavior | |---------------|------------------------------------------------------------------------| | Automatic | Instances update automatically — no further action needed | | Rolling | Instances update in batches with an optional pause between them | | Manual | You must run az vmss update-instances --instance-ids "*" per update |

Learn More