| external help file | Az.Migrate-help.xml |
|---|---|
| Module Name | Az.Migrate |
| online version | https://learn.microsoft.com/powershell/module/az.migrate/new-azmigratelocalserverreplication |
| schema | 2.0.0 |
| content_git_url | https://github.com/Azure/azure-powershell/blob/main/src/Migrate/Migrate/help/New-AzMigrateLocalServerReplication.md |
| original_content_git_url | https://github.com/Azure/azure-powershell/blob/main/src/Migrate/Migrate/help/New-AzMigrateLocalServerReplication.md |
Starts replication for the specified server.
New-AzMigrateLocalServerReplication -MachineId <String> -TargetStoragePathId <String>
-TargetResourceGroupId <String> -TargetVMName <String> -SourceApplianceName <String>
-TargetApplianceName <String> -TargetVirtualSwitchId <String> -OSDiskID <String> [-TargetVMCPUCore <Int32>]
[-TargetTestVirtualSwitchId <String>] [-IsDynamicMemoryEnabled <String>] [-TargetVMRam <Int64>]
[-SubscriptionId <String>] [-DefaultProfile <PSObject>] [-WhatIf]
[-Confirm] [<CommonParameters>]
New-AzMigrateLocalServerReplication -MachineId <String> -TargetStoragePathId <String>
-TargetResourceGroupId <String> -TargetVMName <String> -SourceApplianceName <String>
-TargetApplianceName <String> [-TargetVMCPUCore <Int32>] [-IsDynamicMemoryEnabled <String>]
[-TargetVMRam <Int64>] [-SubscriptionId <String>] -DiskToInclude <AzLocalDiskInput[]>
-NicToInclude <AzLocalNicInput[]> [-DefaultProfile <PSObject>] [-WhatIf]
[-Confirm] [<CommonParameters>]
The New-AzMigrateLocalServerReplication cmdlet starts the replication for a particular discovered server in the Azure Migrate project.
New-AzMigrateLocalServerReplication -MachineId "/subscriptions/xxx-xxx-xxx/resourceGroups/test-rg/providers/Microsoft.OffAzure/HyperVSites/testsrc7972site/machines/005-005-005" -OSDiskID "Microsoft:0EC082D5-6827-457A-BAE2-F986E1B94851\83F8638B-8DCA-4152-9EDA-2CA8B33039B4\0\0\L" -TargetStoragePathId "/subscriptions/xxx-xxx-xxx/resourceGroups/hciclus-rg/providers/Microsoft.AzureStackHCI/storagecontainers/testStorageContainer1" -TargetVirtualSwitchId "/subscriptions/xxx-xxx-xxx/resourceGroups/hciclus-rg/providers/Microsoft.AzureStackHCI/logicalnetworks/external" -TargetResourceGroupId "/subscriptions//xxx-xxx-xxx/resourceGroups/target-rg"-TargetVMName "targetVM"ActivityId : ActivityId: 00000000-0000-0000-0000-000000000000
AllowedAction : {}
CustomPropertyAffectedObjectDetail : Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20240901.JobModelCustomPropertiesAffectedObjectDetails
DisplayName : Create or update protected item
EndTime : 1/1/1900 8:54:47 PM
Error : {}
Id : /subscriptions/xxx-xxx-xxx/resourceGroups/test-rg/providers/Microsoft.DataReplication/replicationVaults/proj62434replicationvault/jobs/f2d3430a-2977-419f-abd5-11d171e17f5e
Name : f2d3430a-2977-419f-abd5-11d171e17f5e
ObjectId : /subscriptions/xxx-xxx-xxx/resourceGroups/test-rg/providers/Microsoft.DataReplication/replicationVaults/proj62434replicationvault/protectedItems/aaaaaaaa-0000-1111-2222-bbbbbbbbbbbb
ObjectInternalId : a8b5ee68-102c-5aae-9499-c57a475a8fd4
ObjectInternalName : test_vm
ObjectName : aaaaaaaa-0000-1111-2222-bbbbbbbbbbbb
ObjectType : ProtectedItem
ReplicationProviderId : xxx-xxx-xxx
SourceFabricProviderId : b35da11c-d69e-4220-9a90-d81ed93ad2fc
StartTime : 1/1/1900 8:49:27 PM
State : Succeeded
SystemDataCreatedAt :
SystemDataCreatedBy :
SystemDataCreatedByType :
SystemDataLastModifiedAt :
SystemDataLastModifiedBy :
SystemDataLastModifiedByType :
TargetFabricProviderId : 22f00372-a1b7-467f-87ce-d95e17a6e7c7
Task : {Creating or updating the protected item, Initializing Protection, Enabling Protection, Starting Replication}
Type : Microsoft.DataReplication/replicationVaults/jobs
This is for the scenario, when there is only one single disk that has to be protected.
[AzLocalDiskInput[]]$DisksToInclude = @()
$OSDisk = New-AzMigrateLocalDiskMappingObject -DiskID "Microsoft:bbbbbbbb-1111-2222-3333-cccccccccccc\83F8638B-8DCA-4152-9EDA-2CA8B33039B4\0\0\L" -IsOSDisk true -IsDynamic true -Size 42 -Format VHD
$DataDisk = New-AzMigrateLocalDiskMappingObject -DiskID "Microsoft:bbbbbbbb-1111-2222-3333-cccccccccccc\C92FAB89-DA8B-47E9-92F3-364642ECDF39\0\0\L" -IsOSDisk false -IsDynamic true -Size 5 -Format VHD
$DisksToInclude += $OSDisk
$DisksToInclude += $DataDisk
[AzLocalNicInput[]]$NicsToInclude = @()
$Nic = New-AzMigrateLocalNicMappingObject -NicID "Microsoft:bbbbbbbb-1111-2222-3333-cccccccccccc\99CDFD2E-D60C-4218-AC2E-E7C2D8253EB9" -TargetVirtualSwitchId "/subscriptions/xxx-xxx-xxx/resourceGroups/hciclus-rg/providers/Microsoft.AzureStackHCI/logicalnetworks/external"
$NicsToInclude += $Nic
New-AzMigrateLocalServerReplication -MachineId "/subscriptions/xxx-xxx-xxx/resourceGroups/test-rg/providers/Microsoft.OffAzure/HyperVSites/testsrc7972site/machines/005-005-005" -TargetStoragePathId "/subscriptions/xxx-xxx-xxx/resourceGroups/hciclus-rg/providers/Microsoft.AzureStackHCI/storagecontainers/testStorageContainer1" -TargetResourceGroupId "/subscriptions//xxx-xxx-xxx/resourceGroups/target-rg"-TargetVMName "targetVM" -DiskToInclude $DisksToInclude -NicToInclude $NicsToIncludeActivityId : ActivityId: 00000000-0000-0000-0000-000000000000
AllowedAction : {}
CustomPropertyAffectedObjectDetail : Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20240901.JobModelCustomPropertiesAffectedObjectDetails
DisplayName : Create or update protected item
EndTime : 1/1/1900 2:27:14 PM
Error : {}
Id : /subscriptions/xxx-xxx-xxx/resourceGroups/test-rg/providers/Microsoft.DataReplication/replicationVaults/proj62434replicationvault/jobs/f855305c-5bed-4bc6-996e-d273115ab833
Name : f855305c-5bed-4bc6-996e-d273115ab833
ObjectId : /subscriptions/xxx-xxx-xxx/resourceGroups/test-rg/providers/Microsoft.DataReplication/replicationVaults/proj62434replicationvault/protectedItems/bbbbbbbb-1111-2222-3333-cccccccccccc
ObjectInternalId : a40ecd8e-6413-574d-b1f8-2ef925e087fc
ObjectInternalName : test_vm
ObjectName : bbbbbbbb-1111-2222-3333-cccccccccccc
ObjectType : ProtectedItem
ReplicationProviderId : 4de0fddc-bdfe-40d9-b60e-678bdce89630
SourceFabricProviderId : b35da11c-d69e-4220-9a90-d81ed93ad2fc
StartTime : 1/1/1900 2:21:50 PM
State : Succeeded
SystemDataCreatedAt :
SystemDataCreatedBy :
SystemDataCreatedByType :
SystemDataLastModifiedAt :
SystemDataLastModifiedBy :
SystemDataLastModifiedByType :
TargetFabricProviderId : 22f00372-a1b7-467f-87ce-d95e17a6e7c7
Task : {Creating or updating the protected item, Initializing Protection, Enabling Protection, Starting Replication}
Type : Microsoft.DataReplication/replicationVaults/jobs
This is for the scenario, when there are multiple disks that has to be protected.
The credentials, account, tenant, and subscription used for communication with Azure.
Type: System.Management.Automation.PSObject
Parameter Sets: (All)
Aliases: AzureRMContext, AzureCredential
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies the disks on the source server to be included for replication.
Type: Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20240901.AzLocalDiskInput[]
Parameter Sets: ByIdPowerUser
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies if RAM is dynamic or not.
Type: System.String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies the machine ARM ID of the discovered server to be migrated.
Type: System.String
Parameter Sets: (All)
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies the NICs on the source server to be included for replication.
Type: Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20240901.AzLocalNicInput[]
Parameter Sets: ByIdPowerUser
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies the operating system disk for the source server to be migrated.
Type: System.String
Parameter Sets: ByIdDefaultUser
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies the source appliance name for the AzLocal scenario.
Type: System.String
Parameter Sets: (All)
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseAzure Subscription ID.
Type: System.String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: (Get-AzContext).Subscription.Id
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies the target appliance name for the AzLocal scenario.
Type: System.String
Parameter Sets: (All)
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies the target resource group ARM ID where the migrated VM resources will reside.
Type: System.String
Parameter Sets: (All)
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies the storage path ARM ID where the VMs will be stored.
Type: System.String
Parameter Sets: (All)
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies the test logical network ARM ID that the VMs will use.
Type: System.String
Parameter Sets: ByIdDefaultUser
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies the logical network ARM ID that the VMs will use.
Type: System.String
Parameter Sets: ByIdDefaultUser
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies the number of CPU cores.
Type: System.Int32
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies the name of the VM to be created.
Type: System.String
Parameter Sets: (All)
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies the target RAM size in MB.
Type: System.Int64
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalsePrompts you for confirmation before running the cmdlet.
Type: System.Management.Automation.SwitchParameter
Parameter Sets: (All)
Aliases: cf
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseShows what would happen if the cmdlet runs. The cmdlet is not run.
Type: System.Management.Automation.SwitchParameter
Parameter Sets: (All)
Aliases: wi
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseThis cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.