你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

New-AzMigrateHCIServerReplication

启动指定服务器的复制。

语法

New-AzMigrateHCIServerReplication
   -MachineId <String>
   -TargetStoragePathId <String>
   -TargetResourceGroupId <String>
   -TargetVMName <String>
   -TargetVirtualSwitchId <String>
   -OSDiskID <String>
   [-TargetVMCPUCore <Int32>]
   [-TargetTestVirtualSwitchId <String>]
   [-IsDynamicMemoryEnabled <String>]
   [-TargetVMRam <Int64>]
   [-SubscriptionId <String>]
   [-DefaultProfile <PSObject>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
New-AzMigrateHCIServerReplication
   -MachineId <String>
   -TargetStoragePathId <String>
   -TargetResourceGroupId <String>
   -TargetVMName <String>
   [-TargetVMCPUCore <Int32>]
   [-IsDynamicMemoryEnabled <String>]
   [-TargetVMRam <Int64>]
   [-SubscriptionId <String>]
   -DiskToInclude <AzStackHCIDiskInput[]>
   -NicToInclude <AzStackHCINicInput[]>
   [-DefaultProfile <PSObject>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]

说明

New-AzMigrateHCIServerReplication cmdlet 将启动 Azure Migrate 项目中特定发现的服务器的复制。

示例

示例 1:仅当只有 OS 磁盘要迁移时

New-AzMigrateHCIServerReplication -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.Api20210216Preview.WorkflowModelCustomPropertiesAffectedObjectDetails
CustomPropertyInstanceType         : WorkflowDetails
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/0ec082d5-6827-457a-bae2-f986e1b94555     
ObjectInternalId                   : a8b5ee68-102c-5aae-9499-c57a475a8fd4
ObjectInternalName                 : test_vm
ObjectName                         : 0ec082d5-6827-457a-bae2-f986e1b94555
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       : 
Tag                                : Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.WorkflowModelTags
TargetFabricProviderId             : 22f00372-a1b7-467f-87ce-d95e17a6e7c7
Task                               : {Creating or updating the protected item, Initializing Protection, Enabling Protection, Starting Replication}
Type                               : Microsoft.DataReplication/replicationVaults/jobs

这种情况适用于这种情况,前提是只有一个磁盘必须受到保护。

示例 2:当有多个磁盘或 NIC 要迁移时

[AzStackHCIDiskInput[]]$DisksToInclude = @()
$OSDisk = New-AzMigrateHCIDiskMappingObject -DiskID "Microsoft:C1A34301-3BFF-4EC6-97F1-6C4BD5ADCDE0\83F8638B-8DCA-4152-9EDA-2CA8B33039B4\0\0\L" -IsOSDisk true -IsDynamic true -Size 42 -Format VHD
$DataDisk = New-AzMigrateHCIDiskMappingObject -DiskID "Microsoft:C1A34301-3BFF-4EC6-97F1-6C4BD5ADCDE0\C92FAB89-DA8B-47E9-92F3-364642ECDF39\0\0\L" -IsOSDisk false -IsDynamic true -Size 5 -Format VHD
$DisksToInclude += $OSDisk
$DisksToInclude += $DataDisk

[AzStackHCINicInput[]]$NicsToInclude = @()
$Nic = New-AzMigrateHCINicMappingObject -NicID "Microsoft:C1A34301-3BFF-4EC6-97F1-6C4BD5ADCDE0\99CDFD2E-D60C-4218-AC2E-E7C2D8253EB9" -TargetVirtualSwitchId "/subscriptions/xxx-xxx-xxx/resourceGroups/hciclus-rg/providers/Microsoft.AzureStackHCI/logicalnetworks/external"
$NicsToInclude += $Nic

New-AzMigrateHCIServerReplication -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 $NicsToInclude

ActivityId                         :  ActivityId: 00000000-0000-0000-0000-000000000000
AllowedAction                      : {}
CustomPropertyAffectedObjectDetail : Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.WorkflowModelCustomPropertiesAffectedObjectDetails
CustomPropertyInstanceType         : WorkflowDetails
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/c1a34301-3bff-4ec6-97f1-6c4bd5adcde0     
ObjectInternalId                   : a40ecd8e-6413-574d-b1f8-2ef925e087fc
ObjectInternalName                 : test_vm
ObjectName                         : c1a34301-3bff-4ec6-97f1-6c4bd5adcde0
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       : 
Tag                                : Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20210216Preview.WorkflowModelTags
TargetFabricProviderId             : 22f00372-a1b7-467f-87ce-d95e17a6e7c7
Task                               : {Creating or updating the protected item, Initializing Protection, Enabling Protection, Starting Replication}
Type                               : Microsoft.DataReplication/replicationVaults/jobs

这种情况适用于需要保护的多个磁盘。

参数

-Confirm

在运行 cmdlet 之前,提示你进行确认。

类型:SwitchParameter
别名:cf
Position:Named
默认值:None
必需:False
接受管道输入:False
接受通配符:False

-DefaultProfile

用于与 Azure 通信的凭据、帐户、租户和订阅。

类型:PSObject
别名:AzureRMContext, AzureCredential
Position:Named
默认值:None
必需:False
接受管道输入:False
接受通配符:False

-DiskToInclude

指定要包含在源服务器上的磁盘进行复制。

类型:AzStackHCIDiskInput[]
Position:Named
默认值:None
必需:True
接受管道输入:False
接受通配符:False

-IsDynamicMemoryEnabled

指定 RAM 是否是动态的。

类型:String
Position:Named
默认值:None
必需:False
接受管道输入:False
接受通配符:False

-MachineId

指定要迁移的已发现服务器的计算机 ARM ID。

类型:String
Position:Named
默认值:None
必需:True
接受管道输入:False
接受通配符:False

-NicToInclude

指定要包含在源服务器上的 NIC 进行复制。

类型:AzStackHCINicInput[]
Position:Named
默认值:None
必需:True
接受管道输入:False
接受通配符:False

-OSDiskID

指定要迁移的源服务器的操作系统磁盘。

类型:String
Position:Named
默认值:None
必需:True
接受管道输入:False
接受通配符:False

-SubscriptionId

Azure 订阅 ID。

类型:String
Position:Named
默认值:(Get-AzContext).Subscription.Id
必需:False
接受管道输入:False
接受通配符:False

-TargetResourceGroupId

指定迁移的 VM 资源所在的目标资源组 ID。

类型:String
Position:Named
默认值:None
必需:True
接受管道输入:False
接受通配符:False

-TargetStoragePathId

指定要在其中存储 VM 的存储路径 ARM ID。

类型:String
Position:Named
默认值:None
必需:True
接受管道输入:False
接受通配符:False

-TargetTestVirtualSwitchId

指定 VM 将使用的测试逻辑网络 ARM ID。

类型:String
Position:Named
默认值:None
必需:False
接受管道输入:False
接受通配符:False

-TargetVirtualSwitchId

指定 VM 将使用的逻辑网络 ARM ID。

类型:String
Position:Named
默认值:None
必需:True
接受管道输入:False
接受通配符:False

-TargetVMCPUCore

指定 CPU 核心数。

类型:Int32
Position:Named
默认值:None
必需:False
接受管道输入:False
接受通配符:False

-TargetVMName

指定要创建的 VM 的名称。

类型:String
Position:Named
默认值:None
必需:True
接受管道输入:False
接受通配符:False

-TargetVMRam

指定目标 RAM 大小(以 MB 为单位)。

类型:Int64
Position:Named
默认值:None
必需:False
接受管道输入:False
接受通配符:False

-WhatIf

显示 cmdlet 运行时会发生什么情况。 cmdlet 未运行。

类型:SwitchParameter
别名:wi
Position:Named
默认值:None
必需:False
接受管道输入:False
接受通配符:False

输出

IWorkflowModel