{Compute} az vm/ vmss create: Support Aligned Zonal Fault Domains with --data-disk-storage-fault-domain-alignment, --os-disk-storage-fault-domain-alignment and --zonal-platform-fault-domain-align-mode#33390
Conversation
️✔️AzureCLI-FullTest
|
|
Hi @william051200, |
|
Thank you for your contribution! We will review the pull request and get back to you soon. |
|
| rule | cmd_name | rule_message | suggest_message |
|---|---|---|---|
| vm create | cmd vm create added parameter data_disk_storage_fault_domain_alignment |
||
| vm create | cmd vm create added parameter os_disk_storage_fault_domain_alignment |
||
| vmss create | cmd vmss create added parameter data_disk_storage_fault_domain_alignment |
||
| vmss create | cmd vmss create added parameter os_disk_storage_fault_domain_alignment |
||
| vmss create | cmd vmss create added parameter zonal_platform_fault_domain_align_mode |
|
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 support in the vm command module for configuring “Aligned Zonal Fault Domains” for Flex VMSS and member VMs by introducing new CLI parameters, wiring them into the ARM template builder payload, and adding a live-only scenario test.
Changes:
- Adds new
vm createandvmss createparameters to set VMSS-level zonal alignment mode and per-disk storage fault domain alignment. - Propagates the new arguments through
custom.pyinto_template_builder.py(VM + VMSS template payload). - Adds validators and a live-only scenario test covering positive and negative cases.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
src/azure-cli/azure/cli/command_modules/vm/tests/latest/test_vm_commands.py |
Adds a live-only scenario test for aligned zonal fault domains. |
src/azure-cli/azure/cli/command_modules/vm/custom.py |
Threads new parameters through create_vm/create_vmss into the template builder. |
src/azure-cli/azure/cli/command_modules/vm/_vm_utils.py |
Introduces enums backing the new CLI parameters. |
src/azure-cli/azure/cli/command_modules/vm/_validators.py |
Adds validation for Flex/single-zone requirements and wires it into vm create / vmss create. |
src/azure-cli/azure/cli/command_modules/vm/_template_builder.py |
Emits new Compute properties in VM/VMSS ARM template resources. |
src/azure-cli/azure/cli/command_modules/vm/_params.py |
Defines the new CLI parameters and their enums. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| if os_disk_storage_fault_domain_alignment is not None: | ||
| profile['osDisk']['storageFaultDomainAlignment'] = os_disk_storage_fault_domain_alignment |
| min_api='2017-12-01', operation_group='virtual_machine_scale_sets'): | ||
| vmss_properties['platformFaultDomainCount'] = platform_fault_domain_count | ||
|
|
||
| if zonal_platform_fault_domain_align_mode is not None: |
| '--os-disk-storage-fault-domain-alignment ' | ||
| 'is only available for VM in a Flex VMSS.') | ||
|
|
||
| if len(vmss_show.get('zones', [])) > 1: |
| if not namespace.vmss: | ||
| raise InvalidArgumentValueError('usage error: --data-disk-storage-fault-domain-alignment/' | ||
| '--os-disk-storage-fault-domain-alignment ' | ||
| 'is only available for VM in a Flex VMSS.') | ||
|
|
| if namespace.zones and len(namespace.zones) > 1: | ||
| raise InvalidArgumentValueError('usage error: --data-disk-storage-fault-domain-alignment/' | ||
| '--os-disk-storage-fault-domain-alignment/' | ||
| '--zonal-platform-fault-domain-align-mode ' | ||
| 'is only available for VMSS with single Availability Zone') |
| from azure.cli.core.azclierror import ArgumentUsageError | ||
| with self.assertRaisesRegex(ArgumentUsageError, 'Flex'): |
| 'data_disk_storage_fault_domain_alignment', | ||
| options_list=['--data-disk-storage-fault-domain-alignment', '--data-disk-storage-fda'], | ||
| arg_type=get_enum_type(DiskStorageAlignment), | ||
| help='Specifies the storage fault domain alignment type for the disk.' | ||
| ) |
| arg_type=get_enum_type(DiskStorageAlignment), | ||
| help='Specifies the storage fault domain alignment type for the disk.' | ||
| ) | ||
| c.argument( | ||
| 'os_disk_storage_fault_domain_alignment', | ||
| options_list=['--os-disk-storage-fault-domain-alignment', '--os-disk-storage-fda'], | ||
| arg_type=get_enum_type(DiskStorageAlignment), | ||
| help='Specifies the storage fault domain alignment type for the disk.' | ||
| ) | ||
| c.argument( | ||
| 'zonal_platform_fault_domain_align_mode', | ||
| options_list=['--zonal-platform-fault-domain-align-mode', '--zonal-fda'], | ||
| arg_type=get_enum_type(FaultDomainAlignment), |
az vm create/ update: Support Aligned Zonal Fault Domains with --data-disk-storage-fault-domain-alignment, --os-disk-storage-fault-domain-alignment and --zonal-platform-fault-domain-align-modeaz vm/ vmss create: Support Aligned Zonal Fault Domains with --data-disk-storage-fault-domain-alignment, --os-disk-storage-fault-domain-alignment and --zonal-platform-fault-domain-align-mode
Related command
az vm createaz vmss createDescription
Resolve #32693
I do notice:

Aligned zonal platform storage fault domain mode can not be applied when feature 'VMOrchestratorZonalMultiFD' is registered.
Testing Guide
Refer to
vm\tests\latest\test_vm_commands.py-test_vmss_zonal_aligned_fault_domainsNot able to run live recording, due to:

Feature
Microsoft.Compute/ZonalAlignedMultipleFDsdoesn't support registration.Currently waiting for Service Team's support on this.
History Notes
[Compute]
az vm create: Support Aligned Zonal Fault Domains with--data-disk-storage-fault-domain-alignmentand--os-disk-storage-fault-domain-alignment[Compute]
az vmss create: Support Aligned Zonal Fault Domains with--data-disk-storage-fault-domain-alignment,--os-disk-storage-fault-domain-alignmentand--zonal-platform-fault-domain-align-modeThis 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.