[Compute] az vmss: Support Open Capacity Reservation - #33929
[Compute] az vmss: Support Open Capacity Reservation#33929William (william051200) wants to merge 23 commits into
az vmss: Support Open Capacity Reservation#33929Conversation
…nd show capacity reservation details
|
Hi William (@william051200), |
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
There was a problem hiding this comment.
Pull request overview
Adds Azure CLI support for Open Capacity Reservation scenarios across VMSS and capacity reservation resources, aligning compute API usage to 2026-04-01 and surfacing new response fields needed by az vmss show/get-instance-view.
Changes:
- Adds
--disable-capacity-reservation-assignment/--no-cap-reservationsupport for VM/VMSS create/update and enforces mutual exclusivity with--capacity-reservation-group. - Surfaces capacity reservation details in VMSS VM model-view and instance-view outputs (including
capacityReservationType). - Updates large sets of scenario-test recordings to newer Compute RP API versions (primarily
2026-04-01), plus adds a live-only Open Capacity Reservation test.
Reviewed changes
Copilot reviewed 132 out of 132 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/azure-cli/azure/cli/command_modules/vm/tests/latest/test_vm_commands.py | Adds a live-only scenario test for Open Capacity Reservation on VMs. |
| src/azure-cli/azure/cli/command_modules/vm/tests/latest/recordings/test_vmss_windows_patch_mode.yaml | Updates recorded Compute VM GET api-version to 2026-04-01. |
| src/azure-cli/azure/cli/command_modules/vm/tests/latest/recordings/test_vmss_simple_orchestration_mode.yaml | Updates recorded Compute VM GET api-version(s) to 2026-04-01. |
| src/azure-cli/azure/cli/command_modules/vm/tests/latest/recordings/test_vmss_linux_patch_mode.yaml | Updates recorded Compute VM GET api-version to 2026-04-01. |
| src/azure-cli/azure/cli/command_modules/vm/tests/latest/recordings/test_vm_zone_movement_preserved.yaml | Updates recorded Compute VM GET/PUT api-version(s) to 2026-04-01. |
| src/azure-cli/azure/cli/command_modules/vm/tests/latest/recordings/test_vm_vmss_non_persisted_tpm.yaml | Updates recorded Compute VM GET api-version(s) to 2026-04-01. |
| src/azure-cli/azure/cli/command_modules/vm/tests/latest/recordings/test_vm_trusted_launch_update.yaml | Updates recorded Compute VM GET/PUT api-version(s) to 2026-04-01. |
| src/azure-cli/azure/cli/command_modules/vm/tests/latest/recordings/test_vm_ssh_key.yaml | Updates recorded Compute VM GET api-version(s) to 2026-04-01. |
| src/azure-cli/azure/cli/command_modules/vm/tests/latest/recordings/test_vm_ssh_key_ed25519.yaml | Updates recorded Compute VM GET api-version(s) to 2026-04-01. |
| src/azure-cli/azure/cli/command_modules/vm/tests/latest/recordings/test_vm_restore_point_instant_access.yaml | Updates recorded Compute VM GET/PUT api-version(s) to 2026-04-01. |
| src/azure-cli/azure/cli/command_modules/vm/tests/latest/recordings/test_vm_resize_changes_size.yaml | Updates recorded Compute VM GET/PUT api-version(s) to 2026-04-01. |
| src/azure-cli/azure/cli/command_modules/vm/tests/latest/recordings/test_vm_priority_eviction_billing.yaml | Updates recorded Compute VM GET/PUT api-version(s) to 2026-04-01. |
| src/azure-cli/azure/cli/command_modules/vm/tests/latest/recordings/test_vm_list_filter.yaml | Updates recorded Compute VM list api-version(s) to 2026-04-01. |
| src/azure-cli/azure/cli/command_modules/vm/tests/latest/recordings/test_vm_install_patches.yaml | Updates recorded Compute VM GET api-version(s) to 2026-04-01. |
| src/azure-cli/azure/cli/command_modules/vm/tests/latest/recordings/test_vm_extended_location.yaml | Updates recorded Compute VM GET api-version(s) to 2026-04-01. |
| src/azure-cli/azure/cli/command_modules/vm/tests/latest/recordings/test_vm_encryption_at_host.yaml | Updates recorded Compute VM GET api-version(s) to 2026-04-01. |
| src/azure-cli/azure/cli/command_modules/vm/tests/latest/recordings/test_vm_disk_encryption_with_key.yaml | Updates recorded Compute VM GET api-version(s) to 2026-04-01. |
| src/azure-cli/azure/cli/command_modules/vm/tests/latest/recordings/test_vm_disk_encryption_with_incorrect_encryption_identity_e2e.yaml | Updates recorded Compute VM GET api-version(s) to 2026-04-01. |
| src/azure-cli/azure/cli/command_modules/vm/tests/latest/recordings/test_vm_create_ultrassd_data_disk_iops_mbps.yaml | Updates recorded Compute VM GET api-version(s) to 2026-04-01. |
| src/azure-cli/azure/cli/command_modules/vm/tests/latest/recordings/test_vm_create_special_name.yaml | Updates recorded Compute VM GET api-version(s) to 2026-04-01. |
| src/azure-cli/azure/cli/command_modules/vm/tests/latest/recordings/test_vm_create_nsg_rule.yaml | Updates recorded Compute VM GET api-version(s) to 2026-04-01. |
| src/azure-cli/azure/cli/command_modules/vm/tests/latest/recordings/test_vm_create_existing_nic.yaml | Updates recorded Compute VM GET api-version(s) to 2026-04-01. |
| src/azure-cli/azure/cli/command_modules/vm/tests/latest/recordings/test_vm_create_auto_create_subnet.yaml | Updates recorded Compute VM list/get api-version(s) to 2026-04-01. |
| src/azure-cli/azure/cli/command_modules/vm/tests/latest/recordings/test_vm_auto_shutdown.yaml | Updates recorded Compute VM GET api-version(s) to 2026-04-01. |
| src/azure-cli/azure/cli/command_modules/vm/tests/latest/recordings/test_vm_add_application.yaml | Updates recorded Compute VM GET/PUT api-version(s) to 2026-04-01. |
| src/azure-cli/azure/cli/command_modules/vm/tests/latest/recordings/test_vm_add_application_with_order_application.yaml | Updates recorded Compute VM GET/PUT api-version(s) to 2026-04-01. |
| src/azure-cli/azure/cli/command_modules/vm/tests/latest/recordings/test_vm_add_application_empty_version_ids.yaml | Updates recorded Compute VM GET/PUT api-version(s) to 2026-04-01. |
| src/azure-cli/azure/cli/command_modules/vm/tests/latest/recordings/test_shared_gallery.yaml | Updates recorded api-versions for gallery and VM operations (note: includes gallery api-version changes). |
| src/azure-cli/azure/cli/command_modules/vm/tests/latest/recordings/test_restore_point.yaml | Updates recorded Compute VM GET api-version(s) to 2026-04-01. |
| src/azure-cli/azure/cli/command_modules/vm/tests/latest/recordings/test_restore_point_encryption_remote.yaml | Updates recorded Compute VM GET api-version(s) to 2026-04-01. |
| src/azure-cli/azure/cli/command_modules/vm/tests/latest/recordings/test_restore_point_encryption_local.yaml | Updates recorded Compute VM GET api-version(s) to 2026-04-01. |
| src/azure-cli/azure/cli/command_modules/vm/tests/latest/recordings/test_restore_point_collection.yaml | Updates recorded Compute VM GET api-version(s) to 2026-04-01. |
| src/azure-cli/azure/cli/command_modules/vm/tests/latest/recordings/test_replication_mode.yaml | Updates recorded api-versions for gallery and VM operations (note: includes gallery api-version changes). |
| src/azure-cli/azure/cli/command_modules/vm/tests/latest/recordings/test_ppg_with_related_resources.yaml | Updates recorded Compute VM GET api-version(s) to 2026-04-01. |
| src/azure-cli/azure/cli/command_modules/vm/tests/latest/recordings/test_ppg_update.yaml | Updates recorded Compute VM GET/PUT api-version(s) to 2026-04-01. |
| src/azure-cli/azure/cli/command_modules/vm/tests/latest/recordings/test_os_disk_security_encryption.yaml | Updates recorded Compute VM GET api-version(s) to 2026-04-01. |
| src/azure-cli/azure/cli/command_modules/vm/tests/latest/recordings/test_linux_vm_patch_mode.yaml | Updates recorded Compute VM GET api-version(s) to 2026-04-01. |
| src/azure-cli/azure/cli/command_modules/vm/tests/latest/recordings/test_image_version_end_of_life_date.yaml | Updates recorded api-versions for gallery and VM operations (note: includes gallery api-version changes). |
| src/azure-cli/azure/cli/command_modules/vm/tests/latest/recordings/test_image_version_create_os_vhd.yaml | Updates recorded api-versions for gallery and VM operations (note: includes gallery api-version changes). |
| src/azure-cli/azure/cli/command_modules/vm/tests/latest/recordings/test_image_version_create_for_diff_source.yaml | Updates recorded api-versions for gallery and VM operations (note: includes gallery api-version changes). |
| src/azure-cli/azure/cli/command_modules/vm/tests/latest/recordings/test_image_update_add_set.yaml | Updates recorded api-versions for gallery and VM operations (note: includes gallery api-version changes). |
| src/azure-cli/azure/cli/command_modules/vm/tests/latest/recordings/test_image_build_managed_image.yaml | Updates recorded Compute VM GET api-version(s) to 2026-04-01. |
| src/azure-cli/azure/cli/command_modules/vm/tests/latest/recordings/test_gallery_soft_delete.yaml | Updates recorded api-versions for gallery and VM operations (note: includes gallery api-version changes). |
| src/azure-cli/azure/cli/command_modules/vm/tests/latest/recordings/test_gallery_image_version_vhd.yaml | Updates recorded api-versions for gallery and VM operations (note: includes gallery api-version changes). |
| src/azure-cli/azure/cli/command_modules/vm/tests/latest/recordings/test_gallery_e2e.yaml | Updates recorded api-versions for gallery and VM operations (note: includes gallery api-version changes). |
| src/azure-cli/azure/cli/command_modules/vm/tests/latest/recordings/test_disk_trusted_launch.yaml | Updates recorded Compute VM GET api-version(s) to 2026-04-01. |
| src/azure-cli/azure/cli/command_modules/vm/tests/latest/recordings/test_create_vm_with_community_gallery_image.yaml | Updates recorded api-versions for community gallery flows (note: includes gallery/share api-version changes). |
| src/azure-cli/azure/cli/command_modules/vm/tests/latest/recordings/test_create_image_version_with_allow_replicated_location_deletion.yaml | Updates recorded api-versions for gallery and VM operations (note: includes gallery api-version changes). |
| src/azure-cli/azure/cli/command_modules/vm/tests/latest/recordings/test_copy_vm_restore_point.yaml | Updates recorded Compute VM GET api-version(s) to 2026-04-01. |
| src/azure-cli/azure/cli/command_modules/vm/tests/latest/recordings/test_community_gallery_operations.yaml | Updates recorded api-versions for community gallery flows (note: includes gallery/share api-version changes). |
| src/azure-cli/azure/cli/command_modules/vm/tests/latest/recordings/test_capacity_reservation_operations.yaml | Updates recorded capacity reservation api-version(s) to 2026-04-01. |
| src/azure-cli/azure/cli/command_modules/vm/tests/latest/recordings/test_capacity_reservation_list_query_params.yaml | Updates recorded capacity reservation list api-version(s) to 2026-04-01. |
| src/azure-cli/azure/cli/command_modules/vm/operations/vmss.py | Extends snake_case conversion to include capacity reservation opt-out and interconnect block profile. |
| src/azure-cli/azure/cli/command_modules/vm/operations/vmss_vms.py | Surfaces and snake_case-converts VMSS VM capacity reservation model-view fields. |
| src/azure-cli/azure/cli/command_modules/vm/operations/vm.py | Adds snake_case conversion for VM capacity reservation opt-out field. |
| src/azure-cli/azure/cli/command_modules/vm/aaz/latest/vmss/vms/instance_view/_show.py | Bumps VMSS VM instance-view API version to 2026-04-01 and surfaces new instance-view fields. |
| src/azure-cli/azure/cli/command_modules/vm/aaz/latest/capacity/reservation/group/_update.py | Bumps API version to 2026-04-01 and adds reservation type + richer instance-view schema. |
| src/azure-cli/azure/cli/command_modules/vm/aaz/latest/capacity/reservation/group/_show.py | Bumps API version to 2026-04-01 and adds reservation type + richer instance-view schema. |
| src/azure-cli/azure/cli/command_modules/vm/aaz/latest/capacity/reservation/group/_create.py | Bumps API version to 2026-04-01 and adds reservation type + richer instance-view schema. |
| src/azure-cli/azure/cli/command_modules/vm/aaz/latest/capacity/reservation/_show.py | Bumps API version to 2026-04-01 and expands schema (scheduleProfile/systemData/utilization counts). |
| src/azure-cli/azure/cli/command_modules/vm/_validators.py | Adds VMSS update validation for --instance-id vs opt-out flag and enforces mutual exclusivity with capacity reservation group. |
| src/azure-cli/azure/cli/command_modules/vm/_template_builder.py | Adds disableCapacityReservationAssignment support and bumps VM/VMSS ARM template apiVersion to 2026-04-01. |
| src/azure-cli/azure/cli/command_modules/vm/_params.py | Adds new args for disable capacity reservation assignment and reservation type. |
| src/azure-cli/azure/cli/command_modules/vm/_help.py | Adds help examples for disabling capacity reservation assignment and creating Open reservation groups. |
| src/azure-cli/azure/cli/command_modules/sqlvm/tests/latest/recordings/test_sqlvm_update_license_and_sku.yaml | Updates recorded Compute VM GET api-version to 2026-04-01. |
| src/azure-cli/azure/cli/command_modules/sqlvm/tests/latest/recordings/test_sqlvm_mgmt.yaml | Updates recorded Compute VM GET api-version to 2026-04-01. |
| src/azure-cli/azure/cli/command_modules/sqlvm/tests/latest/recordings/test_sqlvm_mgmt_assessment.yaml | Updates recorded Compute VM GET api-version(s) to 2026-04-01. |
| src/azure-cli/azure/cli/command_modules/sqlvm/tests/latest/recordings/test_sqlvm_create_and_delete.yaml | Updates recorded Compute VM GET api-version(s) to 2026-04-01. |
| src/azure-cli/azure/cli/command_modules/sqlvm/tests/latest/recordings/test_sqlvm_add_and_remove.yaml | Updates recorded Compute VM GET api-version to 2026-04-01. |
| src/azure-cli/azure/cli/command_modules/resource/tests/latest/recordings/test_resource_patch.yaml | Updates recorded Compute VM GET api-version(s) to 2026-04-01. |
| src/azure-cli/azure/cli/command_modules/resource/tests/latest/recordings/test_invoke_action.yaml | Updates recorded Compute VM GET api-version(s) to 2026-04-01. |
| src/azure-cli/azure/cli/command_modules/network/tests/latest/recordings/test_nw_connection_monitor_v2_endpoint.yaml | Updates recorded Compute VM GET api-version(s) to 2026-04-01. |
| src/azure-cli/azure/cli/command_modules/network/tests/latest/recordings/test_nw_connection_monitor_v2_creation.yaml | Updates recorded Compute VM GET api-version(s) to 2026-04-01. |
| src/azure-cli/azure/cli/command_modules/network/tests/latest/recordings/test_nw_connection_monitor_output.yaml | Updates recorded Compute VM GET api-version(s) to 2026-04-01. |
| src/azure-cli/azure/cli/command_modules/network/tests/latest/recordings/test_nw_connection_monitor_output_type_as_workspace.yaml | Updates recorded Compute VM GET api-version(s) to 2026-04-01. |
| src/azure-cli/azure/cli/command_modules/network/tests/latest/recordings/test_network_watcher_packet_capture.yaml | Updates recorded Compute VM GET api-version(s) to 2026-04-01. |
| src/azure-cli/azure/cli/command_modules/network/tests/latest/recordings/test_network_nic_convenience_commands.yaml | Updates recorded Compute VM GET api-version(s) to 2026-04-01. |
| src/azure-cli/azure/cli/command_modules/monitor/tests/latest/recordings/test_monitor_metrics_list_by_sub.yaml | Updates recorded Compute VM GET api-version to 2026-04-01. |
| src/azure-cli/azure/cli/command_modules/monitor/tests/latest/recordings/test_monitor_clone_vm_metric_alerts_scenario.yaml | Updates recorded Compute VM GET api-version(s) to 2026-04-01. |
| src/azure-cli/azure/cli/command_modules/monitor/tests/latest/recordings/test_metric_alert_single_scope.yaml | Updates recorded Compute VM GET api-version to 2026-04-01. |
| src/azure-cli/azure/cli/command_modules/monitor/tests/latest/recordings/test_metric_alert_multiple_scopes.yaml | Updates recorded Compute VM GET api-version(s) to 2026-04-01. |
| src/azure-cli/azure/cli/command_modules/monitor/tests/latest/recordings/test_metric_alert_for_rg_and_sub.yaml | Updates recorded Compute VM GET api-version(s) to 2026-04-01. |
| src/azure-cli/azure/cli/command_modules/monitor/tests/latest/recordings/test_metric_alert_condition_create.yaml | Updates recorded Compute VM GET api-version(s) to 2026-04-01. |
| src/azure-cli/azure/cli/command_modules/monitor/tests/latest/recordings/test_dynamic_metric_alert_multiple_scopes.yaml | Updates recorded Compute VM GET api-version(s) to 2026-04-01. |
| src/azure-cli/azure/cli/command_modules/monitor/tests/latest/recordings/test_dynamic_metric_alert_basic.yaml | Updates recorded Compute VM GET api-version to 2026-04-01. |
| src/azure-cli/azure/cli/command_modules/backup/tests/latest/recordings/test_vault_soft_delete_with_items.yaml | Updates recorded Compute VM GET api-version(s) to 2026-04-01. |
| src/azure-cli/azure/cli/command_modules/backup/tests/latest/recordings/test_backup_softdelete.yaml | Updates recorded Compute VM GET api-version(s) to 2026-04-01. |
| src/azure-cli/azure/cli/command_modules/backup/tests/latest/recordings/test_backup_scenario.yaml | Updates recorded Compute VM GET api-version(s) to 2026-04-01. |
| src/azure-cli/azure/cli/command_modules/backup/tests/latest/recordings/test_backup_rp.yaml | Updates recorded Compute VM GET api-version(s) to 2026-04-01. |
| src/azure-cli/azure/cli/command_modules/backup/tests/latest/recordings/test_backup_rg_mapping.yaml | Updates recorded Compute VM GET api-version(s) to 2026-04-01. |
| src/azure-cli/azure/cli/command_modules/backup/tests/latest/recordings/test_backup_restore.yaml | Updates recorded Compute VM GET api-version(s) to 2026-04-01. |
| src/azure-cli/azure/cli/command_modules/backup/tests/latest/recordings/test_backup_restore_when_storage_in_different_rg.yaml | Updates recorded Compute VM GET api-version(s) to 2026-04-01. |
| src/azure-cli/azure/cli/command_modules/backup/tests/latest/recordings/test_backup_protection.yaml | Updates recorded Compute VM GET api-version(s) to 2026-04-01. |
| src/azure-cli/azure/cli/command_modules/backup/tests/latest/recordings/test_backup_policy.yaml | Updates recorded Compute VM GET api-version(s) to 2026-04-01. |
| src/azure-cli/azure/cli/command_modules/backup/tests/latest/recordings/test_backup_job.yaml | Updates recorded Compute VM GET api-version(s) to 2026-04-01. |
| src/azure-cli/azure/cli/command_modules/backup/tests/latest/recordings/test_backup_item.yaml | Updates recorded Compute VM GET api-version(s) to 2026-04-01. |
| src/azure-cli/azure/cli/command_modules/backup/tests/latest/recordings/test_backup_CrossZonalRestore.yaml | Updates recorded Compute VM GET api-version(s) to 2026-04-01. |
Suppressed comments (2)
src/azure-cli/azure/cli/command_modules/vm/tests/latest/recordings/test_create_vm_with_community_gallery_image.yaml:248
- This recording uses api-version=2021-07-01 for
sig share enable-community(POST .../share). The currentsig shareAAZ command targets 2023-07-03, so playback will fail due to URI mismatch. Please re-record or update the api-version(s) in this recording to match the command implementation.
src/azure-cli/azure/cli/command_modules/vm/tests/latest/recordings/test_community_gallery_operations.yaml:248 - This recording uses api-version=2021-07-01 for
sig share enable-community(POST .../share). The currentsig shareAAZ command targets 2023-07-03, so playback will fail due to URI mismatch. Please re-record or update the api-version(s) in this recording to match the command implementation.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| - AZURECLI/2.85.0 azsdk-python-core/1.39.0 Python/3.12.10 (Windows-11-10.0.26200-SP0) | ||
| method: PUT | ||
| uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Compute/galleries/gellery000005?api-version=2025-03-03 | ||
| uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest.rg000001/providers/Microsoft.Compute/galleries/gellery000005?api-version=2021-07-01 |
| - AZURECLI/2.86.0 azsdk-python-core/1.39.0 Python/3.12.10 (Windows-11-10.0.26200-SP0) | ||
| method: PUT | ||
| uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_community_gallery_operations_000001/providers/Microsoft.Compute/galleries/gellery000003?api-version=2025-03-03 | ||
| uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_community_gallery_operations_000001/providers/Microsoft.Compute/galleries/gellery000003?api-version=2021-07-01 |
|
/azp run |
|
Azure Pipelines: Successfully started running 3 pipeline(s). |
Live test results —
|
|
William (@william051200) Please fix the issues identified from testing and failures. |
There was a problem hiding this comment.
The following CI checks are failing:
- Azure.azure-cli Full Test
- Azure.azure-cli Full Test (Automation Full Test Python312 Profile Latest instance1)
- Azure.azure-cli
- Azure.azure-cli Full Test (Automation Full Test Python312 Profile Latest instance2)
- Azure.azure-cli Full Test (Automation Full Test Python314 Profile Latest instance1)
- Azure.azure-cli Full Test (Automation Full Test Python312 Profile Latest instance7)
- Azure.azure-cli Full Test (Automation Full Test Python314 Profile Latest instance7)
- Azure.azure-cli Full Test (Automation Full Test Python314 Profile Latest instance2)
- Azure.azure-cli (Check the Format of Pull Request Title and Content)
- Live test run failed (see the dispatched
live-test.ymlworkflow run for details).
|
🔔 Routing this PR to @Azure/act-observability-squad. |
🤖 PR Validation — ❌ Action needed
❌AzureCLI-FullTest
Related command
az vmss create/ update/ show/ get-instance-viewDescription
Resolve #33868
aaz Azure/aaz#1067
Testing Guide
History Notes
[Compute]
az vmss create/ update: Add new parameter --disable-capacity-reservation-assignment to support Open Capacity ReservationThis checklist is used to make sure that common guidelines for a pull request are followed.
The PR title and description has followed the guideline in Submitting Pull Requests.
I adhere to the Command Guidelines.
I adhere to the Error Handling Guidelines.