Skip to content

[Compute] Support Future Capacity Reservations in New-AzCapacityReservation and Get-AzCapacityReservation - #30011

Draft
Haider Agha (haagha) with Copilot wants to merge 3 commits into
mainfrom
copilot/wip-az-compute-future-capacity-reservations
Draft

[Compute] Support Future Capacity Reservations in New-AzCapacityReservation and Get-AzCapacityReservation#30011
Haider Agha (haagha) with Copilot wants to merge 3 commits into
mainfrom
copilot/wip-az-compute-future-capacity-reservations

Conversation

Copilot AI commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Future Capacity Reservations (private preview) let customers reserve capacity for a future start date. The Compute SDK already exposes scheduleProfile and instanceView.reservationStateInfo (API 2026-04-01), but no cmdlet surface existed for them.

Changes

  • New-AzCapacityReservation — new optional parameters:
    • -ScheduleProfileStart <DateTime>: when bound, builds scheduleProfile.start (serialized yyyy-MM-dd, invariant culture), turning the request into a future reservation.
    • -MinimumCommitmentDays <Int32>: maps to scheduleProfile.minimumCommitmentDays; only sent when explicitly bound so the service applies its own default. Errors if used without -ScheduleProfileStart.
    • No range validation in the cmdlet — the 7-day/6-month window and the 30-day minimum are left to CRP, per the design request.
  • PSCapacityReservation — added ScheduleProfile, so Get-AzCapacityReservation surfaces Start, MinimumCommitmentDays, and read-only ModifiableUntil. InstanceView.ReservationStateInfo.ReservationState already flows through the SDK instance view type.
  • Help — new parameters in SYNTAX and alphabetically in PARAMETERS of New-AzCapacityReservation.md plus a future-reservation example; new example in Get-AzCapacityReservation.md for state/modifiable-until.
  • TestsTest-CapacityReservationFutureReservation covers start-only, start + commitment days, persistence via follow-up Get-*, instance-view reservation state, a non-future reservation asserting the new properties stay null, and the mutually-dependent-parameter error. Wired as a check-in [Fact].
  • ChangeLog.md entry under ## Upcoming Release.
New-AzCapacityReservationGroup -ResourceGroupName rg -Name crg -Location eastus
New-AzCapacityReservation -ResourceGroupName rg -ReservationGroupName crg -Name res `
  -Sku Standard_D2s_v3 -CapacityToReserve 10 -Zone 1 `
  -ScheduleProfileStart 2026-12-25 -MinimumCommitmentDays 30

(Get-AzCapacityReservation -ResourceGroupName rg -ReservationGroupName crg -Name res -InstanceView).InstanceView.ReservationStateInfo.ReservationState
(Get-AzCapacityReservation -ResourceGroupName rg -ReservationGroupName crg -Name res).ScheduleProfile.ModifiableUntil

Note: NuGet restore against pkgs.dev.azure.com is blocked in this environment, so the module was not compiled and the scenario test was not recorded here; the scenario script was parse-validated only.

Verification Checklist

  • Cmdlet implementation updated with the new parameters and binding logic.
  • PSCapacityReservation correctly represents the API schema (ScheduleProfile).
  • Confirm yyyy-MM-dd serialization of -ScheduleProfileStart matches CRP expectations (vs. full ISO 8601 date-time).
  • Help content: new parameters in SYNTAX and alphabetically ordered in PARAMETERS; examples cover the new parameters.
  • Scenario test covers each parameter alone and combined, affected cmdlets, and negative cases.
  • Test assertions check concrete sub-properties and re-read the resource with a follow-up Get-*.
  • New .ps1 scenario function is wired into the .cs file as a [Fact] check-in test.
  • Session records recorded against a subscription registered for Microsoft.Compute/FutureCapacityReservation.
  • ChangeLog.md entry is concise and user-focused under ## Upcoming Release.

Copilot AI lite review requested due to automatic review settings August 14, 2026 14:16

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.

Copilot wasn't able to review any files in this pull request.


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

@azure-pipelines

Copy link
Copy Markdown
Contributor
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

…eservation

Co-authored-by: haagha <64601174+haagha@users.noreply.github.com>
Copilot AI review requested due to automatic review settings August 14, 2026 14:20

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.

Copilot wasn't able to review any files in this pull request.

Co-authored-by: haagha <64601174+haagha@users.noreply.github.com>
Copilot AI review requested due to automatic review settings August 14, 2026 14:23
Copilot AI changed the title [WIP] WIP Add cmdlet design for future capacity reservations [Compute] Support Future Capacity Reservations in New-AzCapacityReservation and Get-AzCapacityReservation Aug 14, 2026

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.

Pull request overview

Copilot reviewed 5 out of 7 changed files in this pull request and generated no new comments.

Suppressed comments (3)

src/Compute/Compute/ChangeLog.md:23

  • The new changelog entry references PR/issue context (Fixes #1570 in the PR description) but the entry itself doesn't include an issue link/reference. Add an explicit issue reference (for example, "Fixed issue [#1570]") to match the changelog header guidance.
* Added `-ScheduleProfileStart` and `-MinimumCommitmentDays` parameters to `New-AzCapacityReservation` to create Future capacity reservations, and surfaced the read-only `ScheduleProfile` (including `ModifiableUntil`) and instance view `ReservationStateInfo` on `Get-AzCapacityReservation` output.

src/Compute/Compute.Test/ScenarioTests/VirtualMachineTests.ps1:5434

  • The test formats $start as a string and passes it to a DateTime-typed parameter (-ScheduleProfileStart). This introduces unnecessary culture-dependent parsing. Pass a DateTime to the cmdlet and keep a separate formatted string only for comparing to ScheduleProfile.Start.
        $sku = "Standard_DS1_v2";
        $start = (Get-Date).AddDays(60).ToString("yyyy-MM-dd");

src/Compute/Compute/help/New-AzCapacityReservation.md:107

  • Parameter description refers to "ScheduleProfileStart" without the leading dash, which makes it harder to identify as a parameter name in help. Use the PowerShell parameter name (-ScheduleProfileStart) consistently.
### -MinimumCommitmentDays
The minimum number of days that must pass after the start date before a Future capacity reservation can be updated or deleted once it has been committed.
Can only be used together with ScheduleProfileStart.
Minimum API version: 2026-04-01.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants