[Compute] Fix #34069: az vm update: Fix conflicting Capacity Reservation state transitions - #34070
Open
WhaleTech (ryo-whaletech) wants to merge 1 commit into
Conversation
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
microsoft-github-policy-service
Bot
requested review from
Julie Zhu (yanzhudd) and
Yong Zhang (yonzhan)
September 13, 2026 23:51
Contributor
|
Thank you for your contribution WhaleTech (@ryo-whaletech)! We will review the pull request and get back to you soon. |
WhaleTech (ryo-whaletech)
marked this pull request as ready for review
September 14, 2026 00:00
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
Copilot started reviewing on behalf of
WhaleTech (ryo-whaletech)
September 14, 2026 00:01
View session
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
Focused changes have regression coverage with no unresolved blocking issues.
Pull request overview
Fixes conflicting Capacity Reservation state transitions in az vm update by removing stale opposing values while preserving valid states.
Changes:
- Reconciles Capacity Reservation assignment updates.
- Adds focused transition and compatibility regression tests.
File summaries
| File | Description |
|---|---|
src/azure-cli/azure/cli/command_modules/vm/tests/latest/test_custom_vm_commands.py |
Adds transition, compatibility, and validation coverage. |
src/azure-cli/azure/cli/command_modules/vm/custom.py |
Reconciles persisted Capacity Reservation state. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Collaborator
|
Compute |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related command
az vm updateDescription
Fixes #34069
az vm updatestarts from the existing VM state before applying command-specific update arguments. When switching Capacity Reservation assignment modes, the persisted opposite state could therefore remain in the outgoing request.This change removes only the conflicting persisted value:
disableCapacityReservationAssignmentonly when its persisted value istrue;--disable-capacity-reservation-assignment trueremoves a persisted Capacity Reservation Group.Valid persisted or explicit
falseis preserved. Omitted arguments, unrelated VM updates, the existing"None"Capacity Reservation Group disassociation behavior, and the current same-invocation validation remain unchanged.The fix is limited to the standalone VM update customization and focused regression tests. Generated AAZ files are unchanged because they correctly serialize the state provided by the update layer.
Testing Guide
Added regression coverage for both conflicting transitions and compatibility coverage for
false, omitted arguments, unrelated updates, and the"None"sentinel.Validation:
test_custom_vm_commands.py: 9 passed.azdev style vm: passed.azdev linter vm: passed.git diff --check: passed.Full upstream CI remains pending on the PR.
History Notes
[Compute]
az vm update: Fix conflicting Capacity Reservation state when switching assignment modesThis 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.