{Compute} az vm/ vmss create: Support Ephemeral OS disk with full caching with --ephemeral-os-disk-enable-full-caching#33292
Conversation
…ss create, vmss update
❌AzureCLI-FullTest
|
|
| rule | cmd_name | rule_message | suggest_message |
|---|---|---|---|
| sig identity wait | cmd sig identity wait added |
||
| vm create | cmd vm create added parameter ephemeral_os_disk_enable_full_caching |
||
| vmss create | cmd vmss create added parameter ephemeral_os_disk_enable_full_caching |
|
Thank you for your contribution! We will review the pull request and get back to you soon. |
|
The git hooks are available for azure-cli and azure-cli-extensions repos. They could help you run required checks before creating the PR. Please sync the latest code with latest dev branch (for azure-cli) or main branch (for azure-cli-extensions). pip install azdev --upgrade
azdev setup -c <your azure-cli repo path> -r <your azure-cli-extensions repo path>
|
There was a problem hiding this comment.
Pull request overview
Adds Azure CLI support for enabling ephemeral OS disk full caching during VM/VMSS creation, and updates the VM/VMSS AAZ command schemas to a newer Compute API version so the new enableFullCaching field can be surfaced in show/wait output.
Changes:
- Introduces
--ephemeral-os-disk-enable-full-caching(with alias) foraz vm create/az vmss createand plumbs it intodiffDiskSettings.enableFullCaching. - Updates AAZ-generated VM/VMSS create/show/update/wait schemas to Compute API
2025-11-01, including read/write schema forenableFullCaching. - Adds a scenario test validating
enableFullCachingfor both VM and VMSS.
Reviewed changes
Copilot reviewed 14 out of 15 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| src/azure-cli/azure/cli/command_modules/vm/tests/latest/test_vm_commands.py | Adds live scenario coverage for VM/VMSS create with full caching enabled and validates enableFullCaching in show output. |
| src/azure-cli/azure/cli/command_modules/vm/custom.py | Updates create_vm/create_vmss function signatures to accept the new argument. |
| src/azure-cli/azure/cli/command_modules/vm/_params.py | Adds the new CLI argument/aliases for VM/VMSS create. |
| src/azure-cli/azure/cli/command_modules/vm/_validators.py | Passes the new argument into storage profile normalization. |
| src/azure-cli/azure/cli/command_modules/vm/_vm_utils.py | Writes diffDiskSettings.enableFullCaching into the normalized disk info for ephemeral OS disk. |
| src/azure-cli/azure/cli/command_modules/vm/aaz/latest/vm/_create.py | Bumps API version and updates AAZ schema to include enableFullCaching support (plus other generated fields). |
| src/azure-cli/azure/cli/command_modules/vm/aaz/latest/vm/_show.py | Bumps API version and updates output schema to include enableFullCaching (plus other generated fields). |
| src/azure-cli/azure/cli/command_modules/vm/aaz/latest/vm/_update.py | Bumps API version and schema to include enableFullCaching (plus other generated fields). |
| src/azure-cli/azure/cli/command_modules/vm/aaz/latest/vm/_wait.py | Bumps API version and schema to include enableFullCaching (plus other generated fields). |
| src/azure-cli/azure/cli/command_modules/vm/aaz/latest/vmss/_create.py | Bumps API version and schema to include enableFullCaching (plus other generated fields/args). |
| src/azure-cli/azure/cli/command_modules/vm/aaz/latest/vmss/_show.py | Bumps API version and output schema to include enableFullCaching (plus other generated fields). |
| src/azure-cli/azure/cli/command_modules/vm/aaz/latest/vmss/_update.py | Bumps API version and schema to include enableFullCaching (plus other generated fields/args). |
| src/azure-cli/azure/cli/command_modules/vm/aaz/latest/vmss/_wait.py | Bumps API version and schema to include enableFullCaching (plus other generated fields). |
| src/azure-cli/azure/cli/command_modules/vm/aaz/latest/sig/identity/init.py | Exposes the generated sig identity wait command via __init__. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| diff_disk_settings = cls._args_schema.virtual_machine_profile.storage_profile.os_disk.diff_disk_settings | ||
| diff_disk_settings.enable_full_caching = AAZBoolArg( | ||
| options=["enable-full-caching"], | ||
| help="Specifies whether or not to enable full caching for this VM which will cache the OS disk locally on the host and make this VM more resilient to storage outages", |
There was a problem hiding this comment.
This help string is in the VMSS command but says "enable full caching for this VM". Please update it to refer to the scale set (VMSS) to avoid confusing users (and ideally end the sentence with a period for consistency with other help text).
| help="Specifies whether or not to enable full caching for this VM which will cache the OS disk locally on the host and make this VM more resilient to storage outages", | |
| help="Specifies whether or not to enable full caching for this scale set, which will cache the OS disk locally on the host and make the scale set more resilient to storage outages.", |
| if ephemeral_os_disk_placement: | ||
| info['os']['diffDiskSettings']['placement'] = ephemeral_os_disk_placement | ||
| if ephemeral_os_disk_enable_full_caching is not None: | ||
| info['os']['diffDiskSettings']['enableFullCaching'] = ephemeral_os_disk_enable_full_caching |
There was a problem hiding this comment.
enableFullCaching appears to require Compute API version 2025-11-01 (per issue/spec), but the ARM template builder still uses apiVersion: 2025-04-01 for Microsoft.Compute/virtualMachines and virtualMachineScaleSets. As-is, adding diffDiskSettings.enableFullCaching here is likely to be rejected during template deployment. Please update the template resource apiVersion(s) to 2025-11-01 (or conditionally bump when this flag is set) so VM/VMSS create actually works.
| info['os']['diffDiskSettings']['enableFullCaching'] = ephemeral_os_disk_enable_full_caching | |
| raise CLIError( | |
| '--ephemeral-os-disk-enable-full-caching requires the ARM template ' | |
| 'resource apiVersion for Microsoft.Compute/virtualMachines and ' | |
| 'Microsoft.Compute/virtualMachineScaleSets to be 2025-11-01 or later. ' | |
| 'Update the template resource apiVersion before enabling this property.' | |
| ) |
| c.argument('ephemeral_os_disk_enable_full_caching', arg_type=get_three_state_flag(), | ||
| options_list=['--ephemeral-os-disk-enable-full-caching', '--ephemeral-full-caching'], | ||
| help='Specifies whether or not to enable full caching for this VMSS which will cache the OS disk locally on the host and make this VMSS more resilient to storage outages') |
There was a problem hiding this comment.
This new argument is available for both vm create and vmss create, but (1) it is missing a min_api gate even though the feature requires 2025-11-01, and (2) the help text says "this VMSS" even when used with az vm create. Please add an appropriate min_api (likely 2025-11-01) and adjust the help to refer to "VM/VMSS" (or "VM or VMSS").
| c.argument('ephemeral_os_disk_enable_full_caching', arg_type=get_three_state_flag(), | |
| options_list=['--ephemeral-os-disk-enable-full-caching', '--ephemeral-full-caching'], | |
| help='Specifies whether or not to enable full caching for this VMSS which will cache the OS disk locally on the host and make this VMSS more resilient to storage outages') | |
| c.argument('ephemeral_os_disk_enable_full_caching', arg_type=get_three_state_flag(), min_api='2025-11-01', | |
| options_list=['--ephemeral-os-disk-enable-full-caching', '--ephemeral-full-caching'], | |
| help='Specifies whether or not to enable full caching for this VM/VMSS, which will cache the OS disk locally on the host and make the VM/VMSS more resilient to storage outages') |
| _aaz_info = { | ||
| "version": "2025-04-01", | ||
| "version": "2025-11-01", | ||
| "resources": [ | ||
| ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.compute/virtualmachinescalesets/{}", "2025-04-01"], | ||
| ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.compute/virtualmachinescalesets/{}", "2025-11-01"], | ||
| ] |
There was a problem hiding this comment.
The PR title/description is scoped to ephemeral OS disk full caching, but this file also bumps the VMSS API version to 2025-11-01 and introduces multiple new public CLI arguments (e.g., --external-health-policy, --lifecycle-hooks-profile, operation recovery settings, additional enum values). Please confirm these extra surface-area changes are intentional; if so, update the PR description/history notes accordingly or split them into a separate PR to keep review and release notes accurate.
| diff_disk_settings = cls._args_schema.virtual_machine_profile.storage_profile.os_disk.diff_disk_settings | ||
| diff_disk_settings.enable_full_caching = AAZBoolArg( | ||
| options=["enable-full-caching"], | ||
| help="Specifies whether or not to enable full caching for this VM which will cache the OS disk locally on the host and make this VM more resilient to storage outages", |
There was a problem hiding this comment.
This help string is in the VMSS command but says "enable full caching for this VM". Please update it to refer to the scale set (VMSS) to avoid confusing users (and ideally end the sentence with a period for consistency with other help text).
| help="Specifies whether or not to enable full caching for this VM which will cache the OS disk locally on the host and make this VM more resilient to storage outages", | |
| help="Specifies whether or not to enable full caching for this scale set, which will cache the OS disk locally on the host and make this scale set more resilient to storage outages.", |
Let's merge PR first before merging this PR
Related command
az vm createaz vm showaz vmss createaz vmss showDescription
Resolve #32351
aaz Azure/aaz#995
Testing Guide
Refer to
vm\tests\latest\test_vm_commands.py- test_vm_vmss_ephemeral_os_disk_full_cachingHistory Notes
[Compute]
az vm/ vmss create: Support Ephemeral OS disk with full caching with--ephemeral-os-disk-enable-full-cachingThis checklist is used to make sure that common guidelines for a pull request are followed.
The PR title and description has followed the guideline in Submitting Pull Requests.
I adhere to the Command Guidelines.
I adhere to the Error Handling Guidelines.