Az.Compute: Add -DisableCapacityReservationAssignment and surface capacity reservation details on VMSS VMs - #30013
Draft
Haider Agha (haagha) with Copilot wants to merge 3 commits into
Draft
Conversation
Contributor
There was a problem hiding this comment.
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.
Contributor
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
…ation VMSS VM properties Co-authored-by: haagha <64601174+haagha@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 7 changed files in this pull request and generated no new comments.
Suppressed comments (1)
src/Compute/Compute/ChangeLog.md:25
- The PR description says "Fixes #1567", but issue #1567 is about the Azure PowerShell Start menu shortcut launching 32-bit Windows PowerShell on x64 machines; this ChangeLog entry (and the code changes in this PR) are about VMSS capacity reservation assignment instead. Please update the PR’s linked issue (or remove the "Fixes" reference) and, if there is a relevant issue for this VMSS change, consider referencing it in the ChangeLog entry.
* Added `-DisableCapacityReservationAssignment` parameter to `New-AzVmss`, `New-AzVmssConfig`, and `Update-AzVmss` to opt VMSS instances out of capacity reservation assignment.
* Added `CapacityReservation` property to `Get-AzVmssVM` output and `CapacityReservationType` property to its `-InstanceView` output.
…h; update tests and help Co-authored-by: haagha <64601174+haagha@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add cmdlets for VMSS VM capacity reservation details
Az.Compute: Add -DisableCapacityReservationAssignment and surface capacity reservation details on VMSS VMs
Aug 14, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 8 out of 12 changed files in this pull request and generated no new comments.
Suppressed comments (4)
src/Compute/Compute/ChangeLog.md:24
- Changelog entry uses the acronym “VMSS” without expanding it on first use in the “Upcoming Release” section. For user-facing release notes, please expand it (e.g., “Virtual Machine Scale Set (VMSS)”).
* Added `-DisableCapacityReservationAssignment` parameter to `New-AzVmss`, `New-AzVmssConfig`, and `Update-AzVmss` to opt VMSS instances out of capacity reservation assignment.
src/Compute/Compute/ChangeLog.md:25
- The PR description says “Fixes #1567”, but the linked issue #1567 is about a Windows Start menu shortcut launching 32-bit PowerShell, which doesn’t match these VMSS capacity reservation changes. Please confirm the correct issue reference (or remove it) and add the appropriate issue link in this changelog entry if applicable.
* Added `-DisableCapacityReservationAssignment` parameter to `New-AzVmss`, `New-AzVmssConfig`, and `Update-AzVmss` to opt VMSS instances out of capacity reservation assignment.
* Added `CapacityReservation` property to `Get-AzVmssVM` output and `CapacityReservationType` property to its `-InstanceView` output.
src/Compute/Compute.Test/ScenarioTests/StrategiesVmssTests.ps1:937
- The test synopsis claims it covers the “config+New-AzVmss pipeline”, but the test only creates a config object and asserts the in-memory property; it doesn’t deploy via New-AzVmss. Either add the pipeline deployment or adjust the synopsis to match what’s actually exercised.
Tests -DisableCapacityReservationAssignment on New-AzVmssConfig/New-AzVmss (both the simple
parameter set and the config+New-AzVmss pipeline), on Update-AzVmss, verifies the resulting
CapacityReservation/CapacityReservationType properties surfaced by Get-AzVmssVM, and validates
that -DisableCapacityReservationAssignment and -CapacityReservationGroupId are mutually exclusive.
src/Compute/Compute/help/Update-AzVmss.md:308
- Grammar: “opted out from” should be “opted out of” in this parameter description (same phrasing appears in the other VMSS cmdlet help for this parameter).
Specifies that the virtual machine scale set instances are explicitly opted out from being associated with any capacity reservation. When set, the instances will not be allowed to implicitly or explicitly associate with any type of capacity reservation and will consume capacity from the publicly available capacity. Minimum api-version: 2026-04-01. This parameter is only supported when updating a Virtual Machine Scale Set via the `-VirtualMachineScaleSet` object parameter (e.g. piping the output of `Get-AzVmss`).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
VMSS customers need a way to opt all instances out of capacity reservation assignment and to inspect the resulting capacity reservation state on individual VMSS VMs.
Cmdlet changes
-DisableCapacityReservationAssignment(SwitchParameter) toNew-AzVmssConfig,New-AzVmss(simple parameter set), andUpdate-AzVmss, mapping toVirtualMachineProfile.CapacityReservation.DisableCapacityReservationAssignment.-DisableCapacityReservationAssignmentand-CapacityReservationGroupIdare mutually exclusive; using both throws aPSArgumentException.Update-AzVmssrejects-DisableCapacityReservationAssignmentwhen no-VirtualMachineScaleSetobject is supplied, since the PATCH model doesn't supportCapacityReservation— consistent with the existing-ScheduledEventsApiVersionrestriction.Output model changes
Get-AzVmssVMnow surfacesCapacityReservationon the model view (PSVirtualMachineScaleSetVM) andCapacityReservationTypeon the-InstanceViewoutput (PSVirtualMachineScaleSetVMInstanceView).Docs & tests
New-AzVmssConfig,New-AzVmss, andUpdate-AzVmss(syntax + parameter descriptions).ChangeLog.md.Get-AzVmssVM/-InstanceViewoutput, and the mutual-exclusivity negative case.Note: Build/test validation could not be run end-to-end in the development sandbox due to blocked NuGet restore to the internal package feed (pre-existing environment restriction). Changes were verified via manual review and the automated code review tool.