[Compute] Add Set-AzVMZoneMovement cmdlet for VM zone movement resiliency - #29967
Conversation
Introduces the Set-AzVMZoneMovement cmdlet that enables/disables zone movement on a PSVirtualMachine config object via the ResiliencyProfile, wired into New-AzVM and Update-AzVM. Adds Test-VirtualMachineZoneMovementProfile scenario test with session recording, help docs, and ChangeLog entry. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 24d5b428-7aa9-4adb-a2ed-ea1be9c9f27d
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
|
/azp run |
|
Azure Pipelines: Successfully started running 3 pipeline(s). |
…8100) Set-AzVMZoneMovement is an in-memory configuration cmdlet that only mutates a local PSVirtualMachine object and makes no service call, so it does not need ShouldProcess. Add it to the Compute signature-issue exception list, matching the existing convention for sibling config cmdlets such as Set-AzVMOperatingSystem, Set-AzVMSourceImage, and Set-AzVMBootDiagnostic. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 24d5b428-7aa9-4adb-a2ed-ea1be9c9f27d
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 12 out of 12 changed files in this pull request and generated no new comments.
Suppressed comments (2)
src/Compute/Compute.Test/ScenarioTests/VirtualMachineProfileTests.ps1:468
- Same
Assert-AreEqualargument order issue as above: expected value should come first for consistency with the rest of the test suite.
Assert-AreEqual $vm.ResiliencyProfile.ZoneMovement.IsEnabled $false;
src/Compute/Compute.Test/ScenarioTests/VirtualMachineProfileTests.ps1:464
Assert-AreEqualis used throughout the Compute scenario tests with the expected value first (e.g.,Assert-AreEqual $false $disk.EncryptionSettingsCollection.Enabledin DiskRPTests.ps1). Here the arguments are reversed, which can lead to confusing failure output and may fail if the assertion helper is not symmetric.
This issue also appears on line 468 of the same file.
Assert-AreEqual $vm.ResiliencyProfile.ZoneMovement.IsEnabled $true;
|
/azp run |
|
Azure Pipelines: Successfully started running 3 pipeline(s). |
|
nityatiwari-microsoft |
|
@microsoft-github-policy-service agree company="Microsoft" |
| * Deprecated installing the legacy Azure Enhanced Monitoring (AEM) extension for SAP on Virtual Machines (VMs); `Set-AzVMAEMExtension` now installs the new extension by default. | ||
| * Added `New-AzInterconnectBlock`, `Get-AzInterconnectBlock`, `Update-AzInterconnectBlock`, and `Remove-AzInterconnectBlock` cmdlets to manage Microsoft.Compute/interconnectBlocks resources for high-performance artificial intelligence (AI) and machine learning (ML) workloads. | ||
| * Marked the `-EnableWAD`, `-SkipStorage`, and `-InstallNewExtension` parameters of `Set-AzVMAEMExtension` as deprecated using breaking-change attributes. They will be removed in a future major release. | ||
| * Preserved CMD-special characters in `Invoke-AzVMRunCommand` and `Invoke-AzVmssVMRunCommand` parameter values for Windows PowerShell RunCommand execution. [#29880] | ||
| * Added `Set-AzVMZoneMovement` to set ZoneMovement configuration on a VM (Virtual Machine) model and persist it with `Update-AzVM`. | ||
| - Added `ResiliencyProfile` support in VM create and update flows so ZoneMovement is sent to the Compute API. | ||
| - Fixed issue [#1562] |
There was a problem hiding this comment.
Can your remove this line about the fixed issue it is not needed
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 24d5b428-7aa9-4adb-a2ed-ea1be9c9f27d
|
/azp run |
|
Azure Pipelines: Successfully started running 3 pipeline(s). |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 12 out of 12 changed files in this pull request and generated no new comments.
Suppressed comments (1)
src/Compute/Compute/Models/PSVirtualMachine.cs:168
PSVirtualMachine.csis marked as generated code (header warns changes will be lost if regenerated). AddingResiliencyProfiledirectly here is fragile and could be overwritten by future model regeneration. Consider moving this customization into the source generator/template, or (if supported in this area) switchingPSVirtualMachineto apartialclass and addingResiliencyProfilein a separate manual partial file (pattern used by other generated PS* models).
// Gets or sets the ResiliencyProfile.
public ResiliencyProfile ResiliencyProfile { get; set; }
Adds the
Set-AzVMZoneMovementcmdlet to enable/disable zone movement on aPSVirtualMachineconfig object via the ResiliencyProfile, wired intoNew-AzVMandUpdate-AzVM. Includes scenario testTest-VirtualMachineZoneMovementProfile(Record + Playback passing), help docs, and ChangeLog entry.