Skip to content

Az.Compute: add -ProcessorMode support across VM/VMSS create/config/update cmdlets - #30012

Draft
Haider Agha (haagha) with Copilot wants to merge 2 commits into
mainfrom
copilot/compute-turbo-on-off
Draft

Az.Compute: add -ProcessorMode support across VM/VMSS create/config/update cmdlets#30012
Haider Agha (haagha) with Copilot wants to merge 2 commits into
mainfrom
copilot/compute-turbo-on-off

Conversation

Copilot AI commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

This change adds first-class ProcessorMode support (Deterministic/Opportunistic) to Az.Compute VM and VMSS cmdlet surfaces, aligned with Compute API 2026-04-01 behavior. The parameter is available on create/config/update flows and maps to hardwareProfile.processorMode only when explicitly supplied.

  • Cmdlet surface updates

    • Added optional -ProcessorMode <string> with argument completer values to:
      • New-AzVMConfig, New-AzVM, Update-AzVM
      • New-AzVmssConfig, New-AzVmss, Update-AzVmss
    • Preserved existing parameter-set behavior (no new cmdlets, no breaking signature changes).
  • Request/model mapping

    • VM paths now set HardwareProfile.ProcessorMode when bound.
    • VMSS paths now set VirtualMachineProfile.HardwareProfile.ProcessorMode when bound.
    • Updated both simple strategy-based create flows and object/patch update flows so behavior is consistent across:
      • direct parameter usage
      • input-object + pipeline update usage.
  • Docs and user guidance

    • Updated help for all affected cmdlets:
      • syntax blocks include -ProcessorMode
      • parameter docs added in alphabetical order
      • examples added for VM and VMSS create/update usage.
    • Added changelog entry under src/Compute/Compute/ChangeLog.md for upcoming release.
  • Scenario coverage wiring

    • Added VM and VMSS scenario functions plus C# [Fact] registrations to validate:
      • config object assignment
      • create-time assignment
      • update-time assignment
      • pipeline/object update flow
      • unsupported string surfacing service-side error.
# VM
$vm = New-AzVM -ResourceGroupName rg -Name vm1 -Credential (Get-Credential) -Size Standard_E2pds_v8 -ProcessorMode Deterministic
$vm = Get-AzVM -ResourceGroupName rg -Name vm1
Update-AzVM -ResourceGroupName rg -VM $vm -ProcessorMode Opportunistic

# VMSS
$vmss = New-AzVmss -ResourceGroupName rg -VMScaleSetName vmss1 -Credential (Get-Credential) -VmSize Standard_E2pds_v8 -ProcessorMode Deterministic
$vmss = Get-AzVmss -ResourceGroupName rg -VMScaleSetName vmss1
Update-AzVmss -ResourceGroupName rg -VMScaleSetName vmss1 -VirtualMachineScaleSet $vmss -ProcessorMode Opportunistic

Verification Checklist

  • Cmdlet implementation updated with the new/changed parameter(s)
  • Model class updated to represent the API schema.
  • Help content regenerated: new parameter appears in the SYNTAX section and in alphabetical order in the PARAMETERS section.
  • Examples updated to cover the new parameter(s).
  • If adding a new command, add it to the help/Az.Compute.md file
  • If adding a new command, register it in Az.Compute.psd1 (CmdletsToExport, alphabetical order).
  • New scenario tests cover the full matrix: each new parameter exercised alone and in combination (may share a single test), every affected cmdlet, Update merge semantics, removal/disable paths, and negative/edge cases (mutually exclusive params; $null/empty inputs validated per [ValidateNotNullOrEmpty] or other validation attributes).
  • Test assertions check concrete sub-properties (type/enum, collection counts and membership, computed fields) and re-read the resource with a follow-up Get-* call to confirm the values persisted.
  • Every new .ps1 scenario function is wired into the .cs file as a [Fact] check-in test.
  • ChangeLog.md updated with a concise, user-focused entry under ## Upcoming Release.

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

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.

Co-authored-by: haagha <64601174+haagha@users.noreply.github.com>
Copilot AI review requested due to automatic review settings August 14, 2026 14:31
Copilot AI changed the title [WIP] Add compute cmdlets for turbo on/off Az.Compute: add -ProcessorMode support across VM/VMSS create/config/update cmdlets 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 17 out of 19 changed files in this pull request and generated no new comments.

Suppressed comments (4)

src/Compute/Compute/VirtualMachine/Operation/UpdateAzureVMCommand.cs:169

  • ProcessorMode is a free-form string and currently allows -ProcessorMode '' (empty string). Because the code treats "bound" parameters as intended to be sent to the service, an empty string can result in invalid requests and inconsistent behavior vs other call paths that treat null/empty as "not set". Add [ValidateNotNullOrEmpty] to prevent empty input.
        [Parameter(
            Mandatory = false,
            ValueFromPipelineByPropertyName = true,
            HelpMessage = "Specifies processor frequency behavior.")]
        [PSArgumentCompleter("Deterministic", "Opportunistic")]
        public string ProcessorMode { get; set; }

src/Compute/Compute/VirtualMachine/Operation/NewAzureVMCommand.cs:420

  • ProcessorMode currently accepts an empty string (e.g., -ProcessorMode '') which would be treated as a bound value and can produce an invalid request body. Add [ValidateNotNullOrEmpty] to fail fast and keep behavior consistent with other string parameters in this cmdlet.
        [PSArgumentCompleter("Deterministic", "Opportunistic")]
        public string ProcessorMode { get; set; }

src/Compute/Compute/VirtualMachine/Config/NewAzureVMConfigCommand.cs:203

  • ProcessorMode allows empty-string input, which can later be serialized into the VM config and sent to the service as an invalid value. Add [ValidateNotNullOrEmpty] so users can’t pass -ProcessorMode ''.
            ValueFromPipelineByPropertyName = true,
            HelpMessage = "Specifies processor frequency behavior.")]
        [PSArgumentCompleter("Deterministic", "Opportunistic")]
        public string ProcessorMode { get; set; }

src/Compute/Compute/Manual/VirtualMachineScaleSetCreateOrUpdateMethod.cs:242

  • ProcessorMode accepts empty string values, which are treated as explicitly provided and can lead to invalid requests. Add [ValidateNotNullOrEmpty] to align with other string parameters and fail fast.
            HelpMessage = "Specifies processor frequency behavior for VM instances in the scale set model.")]
        [PSArgumentCompleter("Deterministic", "Opportunistic")]
        public string ProcessorMode { get; set; }

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