Repository navigation
{Compute} az vm create/update: Support FlexProfile with --preferred-size - #34231
William (william051200) wants to merge 7 commits into
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
The inherited size default blocks VM creation when only --preferred-size is supplied.
1 open finding
What changed in this PR
Adds FlexProfile support to VM commands, allowing preferred sizes and preserving FlexProfile during ordinary updates.
Changes:
- Adds
--preferred-sizevalidation and create/update handling. - Extends generated VM schemas to retain and return FlexProfile.
- Adds usage examples and live scenarios.
| File | Description |
|---|---|
| src/azure-cli/azure/cli/command_modules/vm/tests/latest/test_vm_commands.py | Adds FlexProfile lifecycle scenarios. |
| src/azure-cli/azure/cli/command_modules/vm/operations/vm.py | Converts FlexProfile field names. |
| src/azure-cli/azure/cli/command_modules/vm/custom.py | Handles preferred-size creation and updates. |
| src/azure-cli/azure/cli/command_modules/vm/aaz/latest/vm/_wait.py | Recognizes FlexProfile responses. |
| src/azure-cli/azure/cli/command_modules/vm/aaz/latest/vm/_update.py | Preserves and updates FlexProfile. |
| src/azure-cli/azure/cli/command_modules/vm/aaz/latest/vm/_show.py | Exposes FlexProfile in VM details. |
| src/azure-cli/azure/cli/command_modules/vm/aaz/latest/vm/_list.py | Exposes FlexProfile in resource-group listings. |
| src/azure-cli/azure/cli/command_modules/vm/aaz/latest/vm/_list_all.py | Exposes FlexProfile in subscription listings. |
| src/azure-cli/azure/cli/command_modules/vm/aaz/latest/vm/_create.py | Adds generated FlexProfile schemas. |
| src/azure-cli/azure/cli/command_modules/vm/_validators.py | Validates size options and uses preferred sizes. |
| src/azure-cli/azure/cli/command_modules/vm/_template_builder.py | Emits FlexProfile without a fixed VM size. |
| src/azure-cli/azure/cli/command_modules/vm/_params.py | Registers --preferred-size. |
| src/azure-cli/azure/cli/command_modules/vm/_help.py | Documents creation, opt-in, and opt-out. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
|
||
| for scope in ['vm create', 'vm update']: | ||
| with self.argument_context(scope) as c: | ||
| c.argument('preferred_size', completer=get_vm_size_completion_list, is_preview=True, help='Preferred VM size for Flow VMs. Azure may deploy a compatible alternative size. Cannot be used with --size.') |
X Engineering Agent ReportReview — Comments Upstream CI passed, but regression coverage for #34222's FlexProfile service scenarios is not verified. The new read/write mappings address the reported GET-to-PUT field loss in the inspected paths; successful feature-enabled round-trips and generated-source reproducibility remain unverified. Upstream CI53 upstream checks completed successfully for Test validation
Required scenario evidence: Both new cases in The changed template builder omits fixed Repository policy findings
Release-finding reconciliation: The description already contains Generated ownership: The six changed Risk assessment — 59/100 · High · High confidenceThe High rating is driven by security-sensitive behavior, public CLI behavior, generated output.
Posted by x-engineering-agent (Reviewer) |
|
/azp run |
|
Azure Pipelines: Successfully started running 3 pipeline(s). |
az vm create/update: Support FlexProfile with --preferred-sizeaz vm create/update: Support FlexProfile with --preferred-size
az vm create/update: Support FlexProfile with --preferred-sizeaz vm create/update: Support FlexProfile with --preferred-size
az vm create/update: Support FlexProfile with --preferred-sizeaz vm create/update: Support FlexProfile with --preferred-size
az vm create/update: Support FlexProfile with --preferred-sizeaz vm create/update: Support FlexProfile with --preferred-size

🤖 PR Validation —⚠️ Review suggested
Related command
az vm create/ show/ update/ listDescription
Resolve #34222
aaz Azure/aaz#1128
Testing Guide
Prepared 2 test cases
test_vm_flex_profile_create_and_updateandtest_vm_flex_profile_opt_in_opt_outCurrently not able to run due to insufficient permission, providing private preview package for service team to test it out
History Notes
[Compute]
az vm create/update: Support FlexProfile with--preferred-sizeThis 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.