Skip to content

[Compute] Add AvailabilityPolicy support for Managed Disks#29161

Open
aimuhire wants to merge 7 commits intoAzure:mainfrom
aimuhire:copilot/add-disk-availability-policy-cmdlets
Open

[Compute] Add AvailabilityPolicy support for Managed Disks#29161
aimuhire wants to merge 7 commits intoAzure:mainfrom
aimuhire:copilot/add-disk-availability-policy-cmdlets

Conversation

@aimuhire
Copy link

Description

Exposes Azure SDK's existing Disk Availability Policy feature through PowerShell cmdlets, enabling configuration of VM behavior when disks experience I/O degradation.

New Parameter:

  • -ActionOnDiskDelay parameter added to New-AzDiskConfig and New-AzDiskUpdateConfig
  • Supported values: None, AutomaticReattach

Cmdlets Updated:

  • New-AzDiskConfig
  • New-AzDiskUpdateConfig

Usage

# Create disk with automatic reattachment on I/O issues
$config = New-AzDiskConfig -Location "EastUS" -DiskSizeGB 5 `
    -SkuName Standard_LRS -CreateOption Empty `
    -ActionOnDiskDelay 'AutomaticReattach'
New-AzDisk -ResourceGroupName "rg" -DiskName "disk" -Disk $config

# Update existing disk policy
$update = New-AzDiskUpdateConfig -ActionOnDiskDelay 'None'
Update-AzDisk -ResourceGroupName "rg" -DiskName "disk" -Disk $update

Mandatory Checklist

  • SHOULD update ChangeLog.md file(s) appropriately
    • Update src/{{SERVICE}}/{{SERVICE}}/ChangeLog.md.
      • A snippet outlining the change(s) made in the PR should be written under the ## Upcoming Release header in the past tense.
    • Should not change ChangeLog.md if no new release is required, such as fixing test case only.
  • SHOULD regenerate markdown help files if there is cmdlet API change. Instruction
  • SHOULD have proper test coverage for changes in pull request.
  • SHOULD NOT adjust version of module manually in pull request

@azure-client-tools-bot-prd
Copy link

Thanks for your contribution! The pull request validation has started. Please revisit this comment for updated status.

@microsoft-github-policy-service
Copy link
Contributor

Thank you for your contribution @aimuhire! We will review the pull request and get back to you soon.

@aimuhire
Copy link
Author

@aimuhire please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.

@microsoft-github-policy-service agree [company="{your company}"]

Options:

  • (default - no company specified) I have sole ownership of intellectual property rights to my Submissions and I am not making Submissions in the course of work for my employer.
@microsoft-github-policy-service agree
  • (when company given) I am making Submissions in the course of work for my employer (or my employer has intellectual property rights in my Submissions by contract or applicable law). I have permission from my employer to make Submissions and enter into this Agreement on behalf of my employer. By signing below, the defined term “You” includes me and my employer.
@microsoft-github-policy-service agree company="Microsoft"

Contributor License Agreement

@microsoft-github-policy-service agree company="Microsoft"

haagha and others added 6 commits February 10, 2026 10:18
This agent will create a Powershell PR based on the issue described. It will write tests, make code changes and add changelog.
Co-authored-by: audreyttt <225061541+audreyttt@users.noreply.github.com>
@aimuhire aimuhire force-pushed the copilot/add-disk-availability-policy-cmdlets branch from cf08ffb to 96bd468 Compare February 10, 2026 18:21
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR exposes the Disk Availability Policy feature in the Az.Compute module by adding an -ActionOnDiskDelay parameter to disk config/update config cmdlets, wiring it through to the SDK model, and adding scenario coverage.

Changes:

  • Added -ActionOnDiskDelay to New-AzDiskConfig and New-AzDiskUpdateConfig and mapped it to AvailabilityPolicy.ActionOnDiskDelay.
  • Extended PowerShell disk models to include AvailabilityPolicy so the setting is round-tripped and observable.
  • Added a new scenario test for create/get/update flows and updated Compute changelog/help.

Reviewed changes

Copilot reviewed 5 out of 11 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
src/Compute/Compute/help/New-AzDiskUpdateConfig.md Documents the new -ActionOnDiskDelay parameter for disk update config.
src/Compute/Compute/help/New-AzDiskConfig.md Documents the new -ActionOnDiskDelay parameter for disk config.
src/Compute/Compute/Generated/Models/PSDiskUpdate.cs Adds AvailabilityPolicy to the disk update PS model for mapping/serialization.
src/Compute/Compute/Generated/Models/PSDisk.cs Adds AvailabilityPolicy to the disk PS model so Get-AzDisk can surface it.
src/Compute/Compute/Generated/Disk/Config/NewAzureRmDiskUpdateConfigCommand.cs Introduces -ActionOnDiskDelay and sets AvailabilityPolicy on PSDiskUpdate.
src/Compute/Compute/Generated/Disk/Config/NewAzureRmDiskConfigCommand.cs Introduces -ActionOnDiskDelay and sets AvailabilityPolicy on PSDisk.
src/Compute/Compute/ChangeLog.md Adds an Upcoming Release note for the new disk availability behavior support.
src/Compute/Compute.Test/ScenarioTests/DiskRPTests.ps1 Adds a new scenario test function covering create/get/update with availability policy.
src/Compute/Compute.Test/ScenarioTests/DiskRPTests.cs Wires the new PowerShell scenario test into the test runner.
src/Compute/Compute.Management.Sdk/Rest-api-specs/DiskRP.json Updates AvailabilityPolicy descriptions (grammar).
src/Compute/Compute.Management.Sdk/Generated/Models/AvailabilityPolicy.cs Updates XML docs (grammar) for ActionOnDiskDelay.
Comments suppressed due to low confidence (1)

src/Compute/Compute/ChangeLog.md:30

  • ChangeLog entries should reflect the user-facing PowerShell surface. Here the parameter name is written without the leading dash; please update to -ActionOnDiskDelay for consistency with other entries and cmdlet usage, and keep wording in past tense (for example, avoid 'Users can now …' phrasing if possible).
    - Removed local swagger files and replaced references with remote swagger files.
* Added new cmdlets for Availability Set to Virtual Machine Scale Set (VMSS) Flex migration (Public Preview)
    - `Convert-AzAvailabilitySet`: Converts an Availability Set to a new Flexible Virtual Machine Scale Set without downtime
    - `Test-AzAvailabilitySetMigration`: Validates that VMs in an Availability Set can be migrated to a VMSS

@audreyttt
Copy link
Member

/azp run

@azure-pipelines
Copy link
Contributor

Azure Pipelines successfully started running 3 pipeline(s).

@audreyttt audreyttt added this to the Az 15.4.0 (03/03/2026) milestone Feb 10, 2026
Copy link
Member

@isra-fel isra-fel left a comment

Choose a reason for hiding this comment

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

LGTM besides @audreyttt 's comment

@github-actions
Copy link

This PR was labeled "needs-revision" because it has unresolved review comments or CI failures.
Please resolve all open review comments and make sure all CI checks are green. Refer to our guide to troubleshoot common CI failures.

Copy link
Contributor

Copilot AI left a comment

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 10 changed files in this pull request and generated 1 comment.

Comment on lines 53 to 56
* Added support for Disk Availability Policy
- Added `ActionOnDiskDelay` parameter to `New-AzDiskConfig` cmdlet to configure disk availability behavior
- Added `ActionOnDiskDelay` parameter to `New-AzDiskUpdateConfig` cmdlet to update disk availability behavior
- Users can now specify how VMs handle disks with slow I/O using values 'None' or 'AutomaticReattach'
Copy link

Copilot AI Feb 11, 2026

Choose a reason for hiding this comment

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

The new release note entry was added under the historical "## Version 11.0.0" section. Per this file’s header guidance, new user-facing changes should be placed under "## Upcoming Release" at the top. Also consider formatting the parameter as -ActionOnDiskDelay (with the leading dash) to match how users pass it on the command line.

Copilot uses AI. Check for mistakes.
Copy link
Author

@aimuhire aimuhire Feb 11, 2026

Choose a reason for hiding this comment

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

@audreyttt I moved this to Upcoming Release, let me know if it should stay under Version 11.0.0

Copy link
Member

Choose a reason for hiding this comment

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

Yes it should go under upcoming release, thanks!

…riptions, fix test location, fix changelog
@aimuhire aimuhire force-pushed the copilot/add-disk-availability-policy-cmdlets branch from c6f67f8 to 22db800 Compare February 11, 2026 17:16
Copilot AI review requested due to automatic review settings February 11, 2026 17:16
Copy link
Contributor

Copilot AI left a comment

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 10 changed files in this pull request and generated 1 comment.

Comment on lines +23 to +25
* Added support for Disk Availability Policy
- Added `-ActionOnDiskDelay` parameter to `New-AzDiskConfig` cmdlet to configure disk availability behavior
- Added `-ActionOnDiskDelay` parameter to `New-AzDiskUpdateConfig` cmdlet to update disk availability behavior
Copy link

Copilot AI Feb 11, 2026

Choose a reason for hiding this comment

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

The new ChangeLog entry is a bit generic ("Added support for Disk Availability Policy") and doesn’t clearly describe the user-visible behavior/impact (what policy is being set and when it applies). Consider rewriting the top-level bullet to explicitly mention managed disks and that -ActionOnDiskDelay configures the disk’s availability behavior when the disk experiences slow I/O, keeping the wording user-focused per the ChangeLog header guidance.

Suggested change
* Added support for Disk Availability Policy
- Added `-ActionOnDiskDelay` parameter to `New-AzDiskConfig` cmdlet to configure disk availability behavior
- Added `-ActionOnDiskDelay` parameter to `New-AzDiskUpdateConfig` cmdlet to update disk availability behavior
* Added support for configuring managed disk availability behavior when disks experience slow I/O
- Added `-ActionOnDiskDelay` parameter to `New-AzDiskConfig` cmdlet so users can choose how a managed disk should behave when it experiences slow I/O
- Added `-ActionOnDiskDelay` parameter to `New-AzDiskUpdateConfig` cmdlet so users can update the slow I/O availability behavior of existing managed disks

Copilot uses AI. Check for mistakes.
@audreyttt
Copy link
Member

/azp run

@azure-pipelines
Copy link
Contributor

Azure Pipelines successfully started running 3 pipeline(s).

Copy link
Member

@audreyttt audreyttt left a comment

Choose a reason for hiding this comment

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

LGTM!

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants