|
1 | 1 | ---
|
2 |
| -title: Move Azure single instance Virtual Machines from regional to zonal availability zones using PowerShell and CLI |
| 2 | +title: Move Azure single instance Virtual Machines from regional to zonal availability zones using PowerShell and CLI |
3 | 3 | description: Move single instance Azure virtual machines from a regional configuration to a target Availability Zone within the same Azure region using PowerShell and CLI.
|
4 | 4 | author: ankitaduttaMSFT
|
5 | 5 | ms.service: virtual-machines
|
6 | 6 | ms.custom: devx-track-azurecli, devx-track-azurepowershell
|
7 | 7 | ms.topic: tutorial
|
8 |
| -ms.date: 09/25/2023 |
| 8 | +ms.date: 06/10/2024 |
9 | 9 | ms.author: ankitadutta
|
10 | 10 | ---
|
11 | 11 |
|
12 |
| -# Move a virtual machine in an availability zone using Azure PowerShell and CLI |
| 12 | +# Move a virtual machine in an availability zone using Azure PowerShell and CLI |
13 | 13 |
|
14 | 14 | This article details using Azure PowerShell and CLI cmdlets to move Azure single instance VMs from regional to zonal availability zones. An [availability zone](../availability-zones/az-overview.md) is a physically separate zone in an Azure region. Use availability zones to protect your apps and data from an unlikely failure or loss of an entire data center.
|
15 | 15 |
|
16 | 16 | To use an availability zone, create your virtual machine in a [supported Azure region](../availability-zones/az-region.md).
|
17 | 17 |
|
18 |
| -> [!IMPORTANT] |
19 |
| -> Regional to zonal move of single instance VM(s) configuration is currently in *Public Preview*. |
20 | 18 |
|
21 | 19 | ## Prerequisites
|
22 | 20 |
|
23 |
| -Verify the following requirements: |
| 21 | +Verify the following requirements before you start the move process: |
24 | 22 |
|
25 | 23 | | Requirement | Description |
|
26 | 24 | | --- | --- |
|
@@ -422,9 +420,10 @@ Check whether the regional VMs you added have any dependencies on other resource
|
422 | 420 | AdditionalInfo :
|
423 | 421 | Code :
|
424 | 422 | Detail :
|
| 423 | + EndTime : |
425 | 424 | EndTime : 9/8/2023 6:52:14 AM
|
426 |
| - Id : /subscriptions/<Subscription-id>/resourceGroups/RegionToZone-DemoMCRG/providers/Microsoft.Migrate/moveCollections/RegionToZone-DemoMC/o |
427 |
| - perations/bc68354b-ec1f-44cb-92ab-fb3b4ad90229 |
| 425 | +
|
| 426 | + Id : /subscriptions/<Subscription-id>/resourceGroups/RegionToZone-DemoMCRG/providers/Microsoft.Migrate/moveCollections/RegionToZone-DemoMC/operations/bc68354b-ec1f-44cb-92ab-fb3b4ad90229 |
428 | 427 | Message :
|
429 | 428 | Name : bc68354b-ec1f-44cb-92ab-fb3b4ad90229
|
430 | 429 | Property : Microsoft.Azure.PowerShell.Cmdlets.ResourceMover.Models.Any
|
@@ -480,6 +479,75 @@ Check whether the regional VMs you added have any dependencies on other resource
|
480 | 479 |
|
481 | 480 | 1. To remove resources from the resource collection, follow these [instructions](../resource-mover/remove-move-resources.md).
|
482 | 481 |
|
| 482 | +### Availability Zones VM SKU, Quota and Capacity validations |
| 483 | +
|
| 484 | +Azure provides recommendations when the selected Availability Zone doesn't have the virtual machine SKU, or when there is not enough Quota or Capacity available. Here are some examples of these recommendations and the actions that should be taken if the virtual machine SKU is not available. |
| 485 | +
|
| 486 | +#### VM SKU not available |
| 487 | +
|
| 488 | +When the source virtual machine size `Standard_DC1ds_v3` isn't available in the selected availability zone `1`. |
| 489 | +
|
| 490 | +**Recommended Action**: Choose a different virtual machine size in the same availability zone or select a different availability zone with corresponding recommended VM size. |
| 491 | +
|
| 492 | +**Recommendations**: |
| 493 | +
|
| 494 | +- SKU: Standard_DC1ds_v3, Zones: [ 2 ] |
| 495 | +- SKU: Standard_DC2ds_v3, Zones: [ 2 ] |
| 496 | +- SKU: Standard_DC4ds_v3, Zones: [ 2 ] |
| 497 | +- SKU: Standard_DC1s_v3, Zones: [ 2 ] |
| 498 | +- SKU: Standard_D2ds_v5, Zones: [ 2, 3 ] |
| 499 | +- SKU: Standard_D2as_v4, Zones: [ 1, 2, 3 ] |
| 500 | +- SKU: Standard_D2s_v3, Zones: [ 1, 2, 3 ] |
| 501 | +- SKU: Standard_D2as_v5, Zones: [ 1, 2, 3 ] |
| 502 | +- SKU: Standard_D2s_v5, Zones: [ 2, 3 ] |
| 503 | +
|
| 504 | +
|
| 505 | +### Capacity recommendations |
| 506 | +
|
| 507 | +Capacity recommendations for the current selection virtual machine size `Standard_DC1ds_v3` in the selected availability zone `1`. |
| 508 | +
|
| 509 | +**Recommended Action:** To increase the likelihood of a successful deployment, Azure has identified other recommended virtual machine sizes and zones. To deploy seamlessly, choose a different VM size in the same availability zone or a different availability zone with corresponding virtual machine size. |
| 510 | +
|
| 511 | +**Recommendations**: |
| 512 | +
|
| 513 | +- SKU: Standard_DC1ds_v3, Zones: [ 2 ] |
| 514 | +- SKU: Standard_DC2ds_v3, Zones: [ 2 ] |
| 515 | +- SKU: Standard_DC4ds_v3, Zones: [ 2 ] |
| 516 | +- SKU: Standard_DC1s_v3, Zones: [ 2 ] |
| 517 | +- SKU: Standard_D2ds_v5, Zones: [ 2, 3 ] |
| 518 | +- SKU: Standard_D2as_v4, Zones: [ 1, 2, 3 ] |
| 519 | +- SKU: Standard_D2s_v3, Zones: [ 1, 2, 3 ] |
| 520 | +- SKU: Standard_D2as_v5, Zones: [ 1, 2, 3 ] |
| 521 | +- SKU: Standard_D2s_v5, Zones: [ 2, 3 ] |
| 522 | +
|
| 523 | +### Address the recommendations |
| 524 | +
|
| 525 | +To address the situations where the VM SKU is not found or there is a capacity issue, update the move resource and then run resolve again. Here is an example for reference: |
| 526 | +
|
| 527 | +1. Update virtual machine move resource object to new Zone or SKU as per the recommendations. |
| 528 | +
|
| 529 | + ```azurepowershell |
| 530 | + $targetResourceSettingsObj.TargetVmSize = "Standard_DC1ds_v3" |
| 531 | + $targetResourceSettingsObj.TargetAvailabilityZone = "3" |
| 532 | + ``` |
| 533 | +
|
| 534 | +1. Update virtual machine move resource |
| 535 | +
|
| 536 | + ```azurepowershell |
| 537 | + Add-AzResourceMoverMoveResource -ResourceGroupName "RegionToZone-DemoMCRG" -MoveCollectionName "RegionToZone-DemoMC" -SourceId "/subscriptions/<Subscription ID>/resourceGroups/<Resource Group Name>/providers/Microsoft.Compute/virtualMachines/vmtwo" -Name "demoVM-MoveResource2" -ResourceSetting $targetResourceSettingsObj |
| 538 | + ``` |
| 539 | +
|
| 540 | +1. Run resolve again |
| 541 | +
|
| 542 | + `Resolve-AzResourceMoverMoveCollectionDependency -ResourceGroupName "RegionToZone-DemoMCRG" -MoveCollectionName "RegionToZone-DemoMC"` |
| 543 | +
|
| 544 | +### Insufficient Quota |
| 545 | +
|
| 546 | +Selected virtual machine can't be moved to availability zone due to insufficient quota. |
| 547 | +
|
| 548 | +**Recommended Action:** In-sufficient quota found. Refer to link and contact [support](https://learn.microsoft.com/azure/azure-resource-manager/management/azure-subscription-service-limits). |
| 549 | +
|
| 550 | +
|
483 | 551 |
|
484 | 552 | ## Initiate move of VM resources
|
485 | 553 |
|
@@ -574,6 +642,22 @@ After the initial move, you must commit the move or discard it. **Commit** compl
|
574 | 642 |
|
575 | 643 | ---
|
576 | 644 |
|
| 645 | +## Remove a resource |
| 646 | + |
| 647 | +You can remove a single resource or multiple resources from a `MoveCollection` using the following cmdlets: |
| 648 | + |
| 649 | +1. Get a list of the move resources that are added to the move collection: |
| 650 | + `$list = Get-AzResourceMoverMoveResource -ResourceGroupName "<MoveCollectionResourceGroupName>" -MoveCollectionName "<MoveCollectionName>"` |
| 651 | + |
| 652 | +1. Remove the move resources you found: |
| 653 | + `Invoke-AzResourceMoverBulkRemove -ResourceGroupName "<MoveCollectionResourceGroupName>" -MoveCollectionName "<MoveCollectionName>" -MoveResource $($list.Name)` |
| 654 | + |
| 655 | +1. Remove the move collection: |
| 656 | + `Remove-AzResourceMoverMoveCollection -ResourceGroupName "<MoveCollectionResourceGroupName>" -MoveCollectionName "<MoveCollectionName>"` |
| 657 | + |
| 658 | +> [!NOTE] |
| 659 | +> If you observe managed identities authorization issues, re-enable the managed identities access by following [these steps](#grant-access-to-the-managed-identity) again. |
| 660 | +
|
577 | 661 |
|
578 | 662 | ## Delete source regional VMs
|
579 | 663 |
|
|
0 commit comments