[Compute] az vm availability-set: Add new commands to support migration from availability sets to VMSS#32180
Conversation
️✔️AzureCLI-FullTest
|
|
Hi @Jing-song, |
|
| rule | cmd_name | rule_message | suggest_message |
|---|---|---|---|
| vm availability-set cancel-migration-to-vmss | cmd vm availability-set cancel-migration-to-vmss added |
||
| vm availability-set convert-to-vmss | cmd vm availability-set convert-to-vmss added |
||
| vm availability-set start-migration-to-vmss | cmd vm availability-set start-migration-to-vmss added |
||
| vm availability-set validate-migration-to-vmss | cmd vm availability-set validate-migration-to-vmss added |
||
| vm migrate-to-vmss | cmd vm migrate-to-vmss added |
|
Thank you for your contribution! We will review the pull request and get back to you soon. |
|
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
This PR adds new commands to the Azure CLI vm availability-set module to support migration from availability sets to Virtual Machine Scale Sets (VMSS). The implementation includes validation, start, cancel, and convert operations for migrating VMs from availability sets to flexible VMSS.
Key changes:
- Added four new availability-set commands for VMSS migration operations
- Added one new VM command for individual VM migration to VMSS
- Added comprehensive test coverage for the migration workflows
Reviewed Changes
Copilot reviewed 8 out of 9 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| test_vm_commands.py | Added test case covering all new migration commands and workflows |
| _validate_migration_to_vmss.py | Command to validate migration feasibility from availability set to VMSS |
| _start_migration_to_vmss.py | Command to start migration operation from availability set to VMSS |
| _convert_to_vmss.py | Command to create new VMSS and migrate all VMs without downtime |
| _cancel_migration_to_vmss.py | Command to cancel an ongoing migration operation |
| _migrate_to_vmss.py | Command for individual VM migration from availability set to VMSS |
| availability_set/init.py | Updated to export the new migration command modules |
| vm/init.py | Updated to export the new VM migration command module |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| @register_command( | ||
| "vm availability-set start-migration-to-vmss", | ||
| ) | ||
| class StartMigrationToVmss(AAZCommand): | ||
| """Start migration operation on an Availability Set to move its Virtual Machines to a Virtual Machine Scale Set. This should be followed by a migrate operation on each Virtual Machine that triggers a downtime on the Virtual Machine. | ||
| """ |
There was a problem hiding this comment.
This command performs a dangerous operation (migration) that could break or affect resources. According to coding guidelines, dangerous operations should include the confirmation=True flag to require user confirmation before execution.
| @register_command( | ||
| "vm availability-set cancel-migration-to-vmss", | ||
| ) | ||
| class CancelMigrationToVmss(AAZCommand): | ||
| """Cancel the migration operation on an Availability Set. | ||
| """ |
There was a problem hiding this comment.
This command performs a dangerous operation (cancel migration) that could affect ongoing migration processes. According to coding guidelines, dangerous operations should include the confirmation=True flag to require user confirmation before execution.
| @register_command( | ||
| "vm availability-set convert-to-vmss", | ||
| ) | ||
| class ConvertToVmss(AAZCommand): | ||
| """Create a new Flexible Virtual Machine Scale Set and migrate all the Virtual Machines in the Availability Set. This does not trigger a downtime on the Virtual Machines. | ||
| """ |
There was a problem hiding this comment.
This command performs a dangerous operation (convert/migrate) that will permanently change the infrastructure setup. According to coding guidelines, dangerous operations should include the confirmation=True flag to require user confirmation before execution.
| @register_command( | ||
| "vm migrate-to-vmss", | ||
| ) | ||
| class MigrateToVmss(AAZCommand): | ||
| """Migrate a virtual machine from availability set to Flexible Virtual Machine Scale Set. | ||
| """ |
There was a problem hiding this comment.
This command performs a dangerous operation (migrate VM) that will permanently change the VM's infrastructure setup and could potentially cause downtime. According to coding guidelines, dangerous operations should include the confirmation=True flag to require user confirmation before execution.
Related command
az vm availability-setDescription
Add new commands to support migration from availability sets to VMSS
close #31867
aaz model: Azure/aaz#865
Testing Guide
History Notes
[Compute]
az vm availability-set: Add new commandvalidate-migration-to-vmssto support validating migration from availability sets to VMSS[Compute]
az vm availability-set: Add new commandstart-migration-to-vmssto support starting migration from availability sets to VMSS[Compute]
az vm availability-set: Add new commandcancel-migration-to-vmssto support canceling migration from availability sets to VMSS[Compute]
az vm availability-set: Add new commandconvert-to-vmssto support converting availability sets to VMSS[Compute]
az vm: Add new commandmigrate-to-vmssto support migratiing VM to VMSSThis 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.