|
1 |
| -### Example 1: Adding a resource to the move collection. |
| 1 | +### Example 1: Add a resource to the Move Collection. |
2 | 2 | ```powershell
|
3 |
| -PS C:\> Add-AzResourceMoverMoveResource -ResourceGroupName RG-MoveCollection-demoRM -MoveCollectionName "PS-centralus-westcentralus-demoRM" -SourceId "/subscriptions/e80eb9fa-c996-4435-aa32-5af6f3d3077c/resourceGroups/PSDemoRM/providers/Microsoft.Compute/virtualMachines/PSDemoVM" -Name PSDemoVM -ResourceSettingResourceType "Microsoft.Compute/virtualMachines" -ResourceSettingTargetResourceName PSDemoVM |
4 |
| -
|
5 |
| -Output: |
6 |
| -
|
7 |
| -Code : |
8 |
| -DependsOn : {} |
9 |
| -DependsOnOverride : {} |
10 |
| -Detail : |
11 |
| -ExistingTargetId : |
12 |
| -Id : /subscriptions/e80eb9fa-c996-4435-aa32-5af6f3d3077c/resourceGroups/RG-MoveCollection-demoRM/providers/Microsoft.Migr |
13 |
| - ate/MoveCollections/PS-centralus-westcentralus-demoRM/MoveResources/PSDemoVM |
14 |
| -Message : |
15 |
| -MoveStatusCode : DependencyComputationPending |
16 |
| -MoveStatusDetail : {} |
17 |
| -MoveStatusJobName : |
18 |
| -MoveStatusJobProgress : |
19 |
| -MoveStatusMessage : The dependency computation is not completed for resource - /subscriptions/e80eb9fa-c996-4435-aa32-5af6f3d3077c/resou |
20 |
| - rceGroups/PSDemoRM/providers/Microsoft.Compute/virtualMachines/PSDemoVM. |
21 |
| - Possible Causes: Dependency computation is pending for resource. |
22 |
| - Recommended Action: Validate dependencies to compute the dependencies. |
23 |
| -
|
24 |
| -MoveStatusMoveState : PreparePending |
25 |
| -MoveStatusTarget : |
26 |
| -MoveStatusTargetId : |
27 |
| -Name : PSDemoVM |
28 |
| -ProvisioningState : Succeeded |
29 |
| -ResourceSettingResourceType : Microsoft.Compute/virtualMachines |
30 |
| -ResourceSettingTargetResourceName : PSDemoVM |
31 |
| -SourceId : /subscriptions/e80eb9fa-c996-4435-aa32-5af6f3d3077c/resourceGroups/PSDemoRM/providers/Microsoft.Compute/virtualMachi |
32 |
| - nes/PSDemoVM |
33 |
| -SourceResourceSettingResourceType : Microsoft.Compute/virtualMachines |
34 |
| -SourceResourceSettingTargetResourceName : PSDemoVM |
35 |
| -Target : |
36 |
| -TargetId : |
37 |
| -Type |
| 3 | +PS C:\> Add-AzResourceMoverMoveResource -ResourceGroupName "RG-MoveCollection-demoRMS" -MoveCollectionName "PS-centralus-westcentralus-demoRMS" -SourceId "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/PSDemoRM/providers/Microsoft.Compute/virtualMachines/PSDemoVM" -Name "PSDemoVM" -ResourceSetting $targetResourceSettingsObj |
| 4 | +
|
| 5 | +DependsOn : {} |
| 6 | +DependsOnOverride : {} |
| 7 | +ErrorsPropertiesCode : |
| 8 | +ErrorsPropertiesDetail : |
| 9 | +ErrorsPropertiesMessage : |
| 10 | +ErrorsPropertiesTarget : |
| 11 | +ExistingTargetId : |
| 12 | +Id : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/RG-MoveCollection-demoRMS/providers/Microsoft.Migrate/moveCollections/PS-centralus-westcentralus-demoRMS/moveResources/PSDemoVM |
| 13 | +IsResolveRequired : False |
| 14 | +JobStatusJobName : |
| 15 | +JobStatusJobProgress : |
| 16 | +MoveStatusErrorsPropertiesCode : DependencyComputationPending |
| 17 | +MoveStatusErrorsPropertiesDetail : {} |
| 18 | +MoveStatusErrorsPropertiesMessage : The dependency computation is not completed for resource - /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/PSDemoRM/providers/Microsoft.Compute/virtualMachines/PSDemoVM. Possible Causes: Dependency computation is pending for resource. Recommended Action: Validate dependencies to compute the dependencies. |
| 19 | +MoveStatusErrorsPropertiesTarget : |
| 20 | +MoveStatusMoveState : PreparePending |
| 21 | +Name : PSDemoVM |
| 22 | +ProvisioningState : Succeeded |
| 23 | +ResourceSetting : Microsoft.Azure.PowerShell.Cmdlets.ResourceMover.Models.Api202101.VirtualMachineResourceSettings |
| 24 | +SourceId : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/PSDemoRM/providers/Microsoft.Compute/virtualMachines/PSDemoVM |
| 25 | +SourceResourceSetting : Microsoft.Azure.PowerShell.Cmdlets.ResourceMover.Models.Api202101.VirtualMachineResourceSettings |
| 26 | +TargetId : |
| 27 | +Type : |
| 28 | +
|
| 29 | +PS C:\> $targetResourceSettingsObj = New-Object Microsoft.Azure.PowerShell.Cmdlets.ResourceMover.Models.Api202101.VirtualMachineResourceSettings |
| 30 | +PS C:\> $targetResourceSettingsObj.ResourceType = "Microsoft.Compute/virtualMachines" |
| 31 | +$targetResourceSettingsObj.TargetResourceName = "PSDemoVM" |
| 32 | +
|
| 33 | +``` |
| 34 | + |
| 35 | +Add a resource to the Move Collection. |
| 36 | + |
| 37 | +### Example 2: Add a resource to the Move Collection that has existing target resource. |
| 38 | +```powershell |
| 39 | +PS C:\> Add-AzResourceMoverMoveResource -ResourceGroupName "RG-MoveCollection-demoRMS" -MoveCollectionName "PS-centralus-westcentralus-demoRMS" -SourceId "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourcegroups/psdemorm" -Name "psdemorm" -ExistingTargetId "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourcegroups/PSDemoRM-target" |
| 40 | +
|
| 41 | +DependsOn : {} |
| 42 | +DependsOnOverride : {} |
| 43 | +ErrorsPropertiesCode : |
| 44 | +ErrorsPropertiesDetail : |
| 45 | +ErrorsPropertiesMessage : |
| 46 | +ErrorsPropertiesTarget : |
| 47 | +ExistingTargetId : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourcegroups/PSDemoRM-target |
| 48 | +Id : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/RG-MoveCollection-demoRMS/providers/Microsoft.Migrate/moveCollections/PS-centralus-westcentralus-demoRMS/moveResources/psdemorm |
| 49 | +IsResolveRequired : False |
| 50 | +JobStatusJobName : |
| 51 | +JobStatusJobProgress : |
| 52 | +MoveStatusErrorsPropertiesCode : |
| 53 | +MoveStatusErrorsPropertiesDetail : |
| 54 | +MoveStatusErrorsPropertiesMessage : |
| 55 | +MoveStatusErrorsPropertiesTarget : |
| 56 | +MoveStatusMoveState : CommitPending |
| 57 | +Name : psdemorm |
| 58 | +ProvisioningState : Succeeded |
| 59 | +ResourceSetting : Microsoft.Azure.PowerShell.Cmdlets.ResourceMover.Models.Api202101.ResourceSettings |
| 60 | +SourceId : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourcegroups/psdemorm |
| 61 | +SourceResourceSetting : Microsoft.Azure.PowerShell.Cmdlets.ResourceMover.Models.Api202101.ResourceSettings |
| 62 | +TargetId : |
| 63 | +Type : |
| 64 | +
|
| 65 | +``` |
| 66 | + |
| 67 | +Add a resource to the Move Collection that has existing target resource. |
| 68 | + |
| 69 | +### Example 3: Update target resource settings after the Move Resource has been added. |
| 70 | +```powershell |
| 71 | +PS C:\> Update-AzResourceMoverMoveResource -ResourceGroupName "RG-MoveCollection-demoRMS" -MoveCollectionName "PS-centralus-westcentralus-demoRMS" -SourceId "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/PSDemoRM/providers/Microsoft.Compute/virtualMachines/PSDemoVM" -Name "PSDemoVM" -ResourceSetting $TargetResourceSettingObj |
| 72 | +
|
| 73 | +
|
| 74 | +DependsOn : {/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/PSDemoRM/providers/Microsoft.Network/networkInterfaces/psdemov |
| 75 | + m111, /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourcegroups/PSDemoRM} |
| 76 | +DependsOnOverride : {} |
| 77 | +ErrorsPropertiesCode : |
| 78 | +ErrorsPropertiesDetail : |
| 79 | +ErrorsPropertiesMessage : |
| 80 | +ErrorsPropertiesTarget : |
| 81 | +ExistingTargetId : |
| 82 | +Id : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/RG-MoveCollection-demoRMS/providers/Microsoft.Migrate/moveCollections/PS-centralus-westcentralus-demoRMS/moveResources/PSDemoVM |
| 83 | +IsResolveRequired : True |
| 84 | +JobStatusJobName : |
| 85 | +JobStatusJobProgress : |
| 86 | +MoveStatusErrorsPropertiesCode : |
| 87 | +MoveStatusErrorsPropertiesDetail : |
| 88 | +MoveStatusErrorsPropertiesMessage : |
| 89 | +MoveStatusErrorsPropertiesTarget : |
| 90 | +MoveStatusMoveState : PreparePending |
| 91 | +Name : PSDemoVM |
| 92 | +ProvisioningState : Succeeded |
| 93 | +ResourceSetting : Microsoft.Azure.PowerShell.Cmdlets.ResourceMover.Models.Api202101.VirtualMachineResourceSettings |
| 94 | +SourceId : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/PSDemoRM/providers/Microsoft.Compute/virtualMachines/PSDemoVM |
| 95 | +SourceResourceSetting : Microsoft.Azure.PowerShell.Cmdlets.ResourceMover.Models.Api202101.VirtualMachineResourceSettings |
| 96 | +TargetId : |
| 97 | +Type : |
| 98 | +
|
| 99 | +PS C:\> $moveResourceObj = Get-AzResourceMoverMoveResource -MoveCollectionName "PS-centralus-westcentralus-demoRMS1" -ResourceGroupName "RG-MoveCollection-demoRMS" -Name "PSDemoVM" |
| 100 | +PS C:\> $TargetResourceSettingObj = $moveResourceObj.ResourceSetting |
| 101 | +$TargetResourceSettingObj.TargetResourceName="PSDemoVM-target" |
38 | 102 |
|
39 | 103 | ```
|
40 | 104 |
|
41 |
| -Adding a resource to the move collection within the specified subscription. |
| 105 | +Update target resource settings after the Move Resource has been added. |
0 commit comments