Skip to content

Comments

[Compute] Add VMSS Automatic Zone Placement CLI Support#32771

Open
huiii99 wants to merge 12 commits intoAzure:devfrom
huiii99:vmss-zone-automatic-policy-support
Open

[Compute] Add VMSS Automatic Zone Placement CLI Support#32771
huiii99 wants to merge 12 commits intoAzure:devfrom
huiii99:vmss-zone-automatic-policy-support

Conversation

@huiii99
Copy link
Member

@huiii99 huiii99 commented Feb 11, 2026

Related command
az vmss create
az vmss update

Description
This PR Implement zone placement policy feature for VMSS, allowing the platform to automatically select optimal availability zones for deployments.

resolve: #31951

Testing Guide
azdev test VMSSAutomaticZonePlacementTest --live
azdev test VMSSUpdateZoneAllocationPolicyTest --live

History Notes
[Compute] az vmss create

  • Add zone placement policy parameter to enable automatic zone selection
  • Add include zones support
  • Add exclude zones support
  • Add max zone count support (required when zone balance is enabled)
  • Add instance percent policy and max instance percent support

[Compute] az vmss update

  • Add max zone count support
  • Add instance percent policy and max instance percent support

This checklist is used to make sure that common guidelines for a pull request are followed.

@huiii99 huiii99 requested a review from zhoxing-ms as a code owner February 11, 2026 02:20
Copilot AI review requested due to automatic review settings February 11, 2026 02:20
@azure-client-tools-bot-prd
Copy link

azure-client-tools-bot-prd bot commented Feb 11, 2026

️✔️AzureCLI-FullTest
️✔️acr
️✔️latest
️✔️3.12
️✔️3.13
️✔️acs
️✔️latest
️✔️3.12
️✔️3.13
️✔️advisor
️✔️latest
️✔️3.12
️✔️3.13
️✔️ams
️✔️latest
️✔️3.12
️✔️3.13
️✔️apim
️✔️latest
️✔️3.12
️✔️3.13
️✔️appconfig
️✔️latest
️✔️3.12
️✔️3.13
️✔️appservice
️✔️latest
️✔️3.12
️✔️3.13
️✔️aro
️✔️latest
️✔️3.12
️✔️3.13
️✔️backup
️✔️latest
️✔️3.12
️✔️3.13
️✔️batch
️✔️latest
️✔️3.12
️✔️3.13
️✔️batchai
️✔️latest
️✔️3.12
️✔️3.13
️✔️billing
️✔️latest
️✔️3.12
️✔️3.13
️✔️botservice
️✔️latest
️✔️3.12
️✔️3.13
️✔️cdn
️✔️latest
️✔️3.12
️✔️3.13
️✔️cloud
️✔️latest
️✔️3.12
️✔️3.13
️✔️cognitiveservices
️✔️latest
️✔️3.12
️✔️3.13
️✔️compute_recommender
️✔️latest
️✔️3.12
️✔️3.13
️✔️computefleet
️✔️latest
️✔️3.12
️✔️3.13
️✔️config
️✔️latest
️✔️3.12
️✔️3.13
️✔️configure
️✔️latest
️✔️3.12
️✔️3.13
️✔️consumption
️✔️latest
️✔️3.12
️✔️3.13
️✔️container
️✔️latest
️✔️3.12
️✔️3.13
️✔️containerapp
️✔️latest
️✔️3.12
️✔️3.13
️✔️core
️✔️latest
️✔️3.12
️✔️3.13
️✔️cosmosdb
️✔️latest
️✔️3.12
️✔️3.13
️✔️databoxedge
️✔️latest
️✔️3.12
️✔️3.13
️✔️dls
️✔️latest
️✔️3.12
️✔️3.13
️✔️dms
️✔️latest
️✔️3.12
️✔️3.13
️✔️eventgrid
️✔️latest
️✔️3.12
️✔️3.13
️✔️eventhubs
️✔️latest
️✔️3.12
️✔️3.13
️✔️feedback
️✔️latest
️✔️3.12
️✔️3.13
️✔️find
️✔️latest
️✔️3.12
️✔️3.13
️✔️hdinsight
️✔️latest
️✔️3.12
️✔️3.13
️✔️identity
️✔️latest
️✔️3.12
️✔️3.13
️✔️iot
️✔️latest
️✔️3.12
️✔️3.13
️✔️keyvault
️✔️latest
️✔️3.12
️✔️3.13
️✔️lab
️✔️latest
️✔️3.12
️✔️3.13
️✔️managedservices
️✔️latest
️✔️3.12
️✔️3.13
️✔️maps
️✔️latest
️✔️3.12
️✔️3.13
️✔️marketplaceordering
️✔️latest
️✔️3.12
️✔️3.13
️✔️monitor
️✔️latest
️✔️3.12
️✔️3.13
️✔️mysql
️✔️latest
️✔️3.12
️✔️3.13
️✔️netappfiles
️✔️latest
️✔️3.12
️✔️3.13
️✔️network
️✔️latest
️✔️3.12
️✔️3.13
️✔️policyinsights
️✔️latest
️✔️3.12
️✔️3.13
️✔️postgresql
️✔️latest
️✔️3.12
️✔️3.13
️✔️privatedns
️✔️latest
️✔️3.12
️✔️3.13
️✔️profile
️✔️latest
️✔️3.12
️✔️3.13
️✔️rdbms
️✔️latest
️✔️3.12
️✔️3.13
️✔️redis
️✔️latest
️✔️3.12
️✔️3.13
️✔️relay
️✔️latest
️✔️3.12
️✔️3.13
️✔️resource
️✔️latest
️✔️3.12
️✔️3.13
️✔️role
️✔️latest
️✔️3.12
️✔️3.13
️✔️search
️✔️latest
️✔️3.12
️✔️3.13
️✔️security
️✔️latest
️✔️3.12
️✔️3.13
️✔️servicebus
️✔️latest
️✔️3.12
️✔️3.13
️✔️serviceconnector
️✔️latest
️✔️3.12
️✔️3.13
️✔️servicefabric
️✔️latest
️✔️3.12
️✔️3.13
️✔️signalr
️✔️latest
️✔️3.12
️✔️3.13
️✔️sql
️✔️latest
️✔️3.12
️✔️3.13
️✔️sqlvm
️✔️latest
️✔️3.12
️✔️3.13
️✔️storage
️✔️latest
️✔️3.12
️✔️3.13
️✔️synapse
️✔️latest
️✔️3.12
️✔️3.13
️✔️telemetry
️✔️latest
️✔️3.12
️✔️3.13
️✔️util
️✔️latest
️✔️3.12
️✔️3.13
️✔️vm
️✔️latest
️✔️3.12
️✔️3.13

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

azure-client-tools-bot-prd bot commented Feb 11, 2026

⚠️AzureCLI-BreakingChangeTest
⚠️vm
rule cmd_name rule_message suggest_message
⚠️ 1006 - ParaAdd vmss create cmd vmss create added parameter exclude_zones
⚠️ 1006 - ParaAdd vmss create cmd vmss create added parameter include_zones
⚠️ 1006 - ParaAdd vmss create cmd vmss create added parameter instance_percent_policy
⚠️ 1006 - ParaAdd vmss create cmd vmss create added parameter max_instance_percent
⚠️ 1006 - ParaAdd vmss create cmd vmss create added parameter max_zone_count
⚠️ 1006 - ParaAdd vmss create cmd vmss create added parameter zone_placement_policy
⚠️ 1006 - ParaAdd vmss update cmd vmss update added parameter instance_percent_policy
⚠️ 1006 - ParaAdd vmss update cmd vmss update added parameter max_instance_percent
⚠️ 1006 - ParaAdd vmss update cmd vmss update added parameter max_zone_count

@yonzhan
Copy link
Collaborator

yonzhan commented Feb 11, 2026

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

@github-actions
Copy link

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).
After that please run the following commands to enable git hooks:

pip install azdev --upgrade
azdev setup -c <your azure-cli repo path> -r <your azure-cli-extensions repo path>

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

Adds Azure CLI support for VMSS “Automatic Zone Placement” and related zone allocation policies for az vmss create and az vmss update, plus scenario tests/recordings to validate the new flags and server payloads.

Changes:

  • Add new CLI parameters for zone placement (--zone-placement-policy, --include-zones, --exclude-zones) on vmss create.
  • Add/extend zone allocation policy support (--max-zone-count, --instance-percent-policy, --max-instance-percent) for vmss create and vmss update, including validation and request shaping.
  • Add scenario tests and recordings covering create/update flows and key validation errors.

Reviewed changes

Copilot reviewed 12 out of 14 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/custom.py Wires new zone allocation policy args into VMSS update request payload.
src/azure-cli/azure/cli/command_modules/vm/_template_builder.py Adds placement and resiliencyPolicy.zoneAllocationPolicy to ARM template deployment payload for VMSS create.
src/azure-cli/azure/cli/command_modules/vm/_validators.py Adds validation for zone placement policy conflicts and zone allocation policy inputs.
src/azure-cli/azure/cli/command_modules/vm/_params.py Exposes new CLI parameters for VMSS create/update.
src/azure-cli/azure/cli/command_modules/vm/tests/latest/test_vm_commands.py Adds live scenario tests for VMSS automatic zone placement and zone allocation policy updates.
src/azure-cli/azure/cli/command_modules/vm/tests/latest/recordings/test_vmss_zone_placement_policy_with_include_zones.yaml Recording for create with --zone-placement-policy Auto + --include-zones.
src/azure-cli/azure/cli/command_modules/vm/tests/latest/recordings/test_vmss_zone_placement_policy_with_exclude_zones.yaml Recording for create with --zone-placement-policy Auto + --exclude-zones.
src/azure-cli/azure/cli/command_modules/vm/tests/latest/recordings/test_vmss_zone_placement_policy_with_max_instance_percent.yaml Recording for create with max-instance-percent-per-zone policy enabled.
src/azure-cli/azure/cli/command_modules/vm/tests/latest/recordings/test_vmss_zone_placement_policy_validation_overprovision_uniform.yaml Recording for validation error when using zone placement policy with overprovisioning in Uniform mode.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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

Labels

Auto-Assign Auto assign by bot Compute az vm/vmss/image/disk/snapshot

Projects

None yet

Development

Successfully merging this pull request may close these issues.

VMSS Automatic Zone Placement CLI Support

4 participants