Skip to content

{Compute} az vm/vmss create: Add new param --schedule-profile-start and --minimum-commitment-days to support future capacity reservation - #34031

Open
William (william051200) wants to merge 7 commits into
Azure:devfrom
william051200:fcr
Open

Conversation

@william051200

@william051200 William (william051200) commented Sep 4, 2026

Copy link
Copy Markdown
Member

🤖 PR Validation — ⚠️ Review suggested

Breaking Changes Tests
⚠️ None ️✔️ 130/130
⚠️AzureCLI-BreakingChangeTest
⚠️vm
rule cmd_name rule_message suggest_message
⚠️ 1006 - ParaAdd capacity reservation create cmd capacity reservation create added parameter end
⚠️ 1006 - ParaAdd capacity reservation create cmd capacity reservation create added parameter minimum_commitment_days
⚠️ 1006 - ParaAdd capacity reservation create cmd capacity reservation create added parameter schedule_profile_start
⚠️ 1006 - ParaAdd capacity reservation list cmd capacity reservation list added parameter expand

Related command

az capacity reservation create/show/list

Description

Resolve #33898

aaz Azure/aaz#1082

Testing Guide

Refer to azure-cli\src\azure-cli\azure\cli\command_modules\vm\tests\latest\test_vm_commands.py: test_future_capacity_reservation
Currently not able to run yet. No access to Canary
Provided private preview package for the service team to test.

History Notes

[Compute] az capacity reservation create: Add new param --schedule-profile-start and --minimum-commitment-days to support future capacity reservation


This checklist is used to make sure that common guidelines for a pull request are followed.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The create operation’s LRO polling was changed to final-state-via: location inconsistently with related operations, which is likely to break async polling behavior.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

This PR adds Azure CLI support for Future Capacity Reservations by surfacing the new schedule profile fields (start/minimumCommitmentDays/modifiableUntil) and reservation state info on az capacity reservation commands, aligned to Compute API version 2026-04-01.

Changes:

  • Adds a new live-only scenario test validating scheduleProfile.* appears on create/show/list and instanceView.reservationStateInfo.reservationState appears with --instance-view.
  • Updates AAZ-generated capacity reservation commands to 2026-04-01 and extends response schemas to include scheduleProfile, systemData, and reservationStateInfo.
  • Adds new create-time schedule profile arguments and request shaping for scheduleProfile in capacity reservation create.
File summaries
File Description
src/azure-cli/azure/cli/command_modules/vm/tests/latest/test_vm_commands.py Adds a live-only test covering create/show/list + instance view for Future Capacity Reservations.
src/azure-cli/azure/cli/command_modules/vm/aaz/latest/capacity/reservation/_wait.py Bumps API version and extends wait schema to include schedule profile + reservation state info.
src/azure-cli/azure/cli/command_modules/vm/aaz/latest/capacity/reservation/_list.py Bumps API version and extends list schema to include schedule profile + reservation state info (and adds --expand).
src/azure-cli/azure/cli/command_modules/vm/aaz/latest/capacity/reservation/_create.py Adds schedule profile args and request shaping; bumps API version; changes LRO polling behavior.
Review details

Suppressed comments (1)

src/azure-cli/azure/cli/command_modules/vm/aaz/latest/capacity/reservation/_create.py:170

  • Same as above: the 200/201 path also uses final-state-via: location, which may cause incorrect LRO polling if the operation follows the Compute RP Azure-AsyncOperation pattern.
            if session.http_response.status_code in [200, 201]:
                return self.client.build_lro_polling(
                    self.ctx.args.no_wait,
                    session,
                    self.on_200_201,
                    self.on_error,
                    lro_options={"final-state-via": "location"},
                    path_format_arguments=self.url_parameters,
                )
  • Files reviewed: 4/4 changed files
  • Comments generated: 3
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines 154 to 161
return self.client.build_lro_polling(
self.ctx.args.no_wait,
session,
self.on_200_201,
self.on_error,
lro_options={"final-state-via": "azure-async-operation"},
lro_options={"final-state-via": "location"},
path_format_arguments=self.url_parameters,
)
Comment on lines +26 to +27
:example: Create a Future capacity reservation.
az capacity reservation create -c ReservationGroupName -n ReservationName -g MyResourceGroup --sku Standard_A1_v2 --capacity 5 --schedule-profile-start 2026-12-01T12:00:00Z --minimum-commitment-days 30
Comment on lines +99 to +103
_args_schema.end = AAZStrArg(
options=["--end"],
arg_group="ScheduleProfile",
help="The required end date for Block capacity reservations. Must be after the start date, with a duration of either 1–14 whole days or 3–26 whole weeks. Example: 2025-06-28.",
)
@yonzhan

Copy link
Copy Markdown
Collaborator

Compute

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

act-observability-squad Auto-Assign Auto assign by bot Compute az vm/vmss/image/disk/snapshot Reservations az reservations

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Compute] Add Support for Future Capacity Reservation (FCR)

4 participants