Skip to content

[Compute] az vmss create: Add new parameter --enable-automatic-repairs to support setting automatic repairs policy#31722

Merged
zhoxing-ms merged 5 commits intoAzure:devfrom
Jing-song:jins-vmss-auto-repair
Jul 22, 2025
Merged

[Compute] az vmss create: Add new parameter --enable-automatic-repairs to support setting automatic repairs policy#31722
zhoxing-ms merged 5 commits intoAzure:devfrom
Jing-song:jins-vmss-auto-repair

Conversation

@Jing-song
Copy link
Contributor

@Jing-song Jing-song commented Jun 26, 2025

Related command

Description

close #31585

Fix #31709 #31581

Testing Guide

History Notes

[Compute] az vmss create: Add new parameter --enable-automatic-repairs to support setting automatic repairs policy
[ARM] Fix #31709: az deployment: Fix the content for this response was already consumed when create resource


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

Copilot AI review requested due to automatic review settings June 26, 2025 07:20
@azure-client-tools-bot-prd
Copy link

azure-client-tools-bot-prd bot commented Jun 26, 2025

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

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

azure-client-tools-bot-prd bot commented Jun 26, 2025

⚠️AzureCLI-BreakingChangeTest
⚠️vm
rule cmd_name rule_message suggest_message
⚠️ 1006 - ParaAdd vmss create cmd vmss create added parameter enable_automatic_repairs

@yonzhan
Copy link
Collaborator

yonzhan commented Jun 26, 2025

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

This PR adds a new parameter --enable-automatic-repairs to the vmss create command so that users can configure the automatic repairs policy and improves related validations and template generation. Key changes include new test cases for the parameter, updates to function signatures and error validations, and modifications to template building logic to support the repairs policy.

Reviewed Changes

Copilot reviewed 6 out of 7 changed files in this pull request and generated no comments.

Show a summary per file
File Description
tests/latest/test_vm_commands.py Added new test case for vmss with automatic repairs and zone balancing
custom.py Updated create_vmss function signature to include enable_automatic_repairs
_validators.py Added validation logic to raise an error for incompatible repairs settings
_template_builder.py Updated build_vmss_resource signature and logic to support enable_automatic_repairs
_params.py Introduced a new command argument for enable_automatic_repairs
_utils.py Improved HTTP response error handling with additional exception support
Comments suppressed due to low confidence (2)

src/azure-cli/azure/cli/command_modules/vm/_template_builder.py:1047

  • [nitpick] Consider updating the function docstring for build_vmss_resource to document the new parameter 'enable_automatic_repairs'.
                        automatic_zone_balancing_strategy=None, automatic_zone_balancing_behavior=None,

Comment on lines +90 to +95
from azure.core.exceptions import StreamClosedError, StreamConsumedError
try:
error_txt = http_error.response.internal_response.text
error_info = json.loads(error_txt)['error']
except (StreamClosedError, StreamConsumedError):
error_info = http_error.response.json()['error']
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you recording some az deployment related tests to check the fix effect of ARM deployment

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

zhoxing-ms
zhoxing-ms previously approved these changes Jun 26, 2025
@zhoxing-ms zhoxing-ms changed the title [Compute] az vmss create Add new parameter --enable-automatic-repairs to support setting automatic repairs policy [Compute] az vmss create: Add new parameter --enable-automatic-repairs to support setting automatic repairs policy Jul 22, 2025
@zhoxing-ms zhoxing-ms merged commit d0a24c7 into Azure:dev Jul 22, 2025
48 checks passed
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.

Avoid read response again when LRO operation raises HttpResponseError Add "--enable-auto-repairs" to az vmss create

5 participants