您现在访问的是微软AZURE全球版技术文档网站,若需要访问由世纪互联运营的MICROSOFT AZURE中国区技术文档网站,请访问 https://docs.azure.cn.

Hyper-v 复制的工作原理How does Hyper-V replication work?

本文概述了使用 Azure Migrate Server 迁移工具迁移 Hyper-v Vm 时使用的体系结构和过程。This article provides an overview of the architecture and processes used when you migrate Hyper-V VMs with the Azure Migrate Server Migration tool.

Azure Migrate 提供一个中心用于跟踪本地应用、工作负荷与私有云/公有云 VM 的发现、评估及其到 Azure 的迁移。Azure Migrate provides a central hub to track discovery, assessment, and migration of your on-premises apps and workloads, and private/public cloud VMs, to Azure. 该中心提供用于评估和迁移的 Azure Migrate 工具,以及第三方独立软件供应商 (ISV) 产品。The hub provides Azure Migrate tools for assessment and migration, as well as third-party independent software vendor (ISV) offerings.

无代理迁移Agentless migration

Azure Migrate Server 迁移工具使用为 Hyper-v 优化的迁移工作流为本地 Hyper-v Vm 提供无代理复制。The Azure Migrate Server Migration tool provides agentless replication for on-premises Hyper-V VMs, using a migration workflow that's optimized for Hyper-V. 仅在 Hyper-v 主机或群集节点上安装软件代理。You install a software agent only on Hyper-V hosts or cluster nodes. Hyper-v Vm 上无需安装任何内容。Nothing needs to be installed on Hyper-V VMs.

服务器迁移和 Azure Site RecoveryServer Migration and Azure Site Recovery

Azure Migrate Server 迁移是一种用于将本地工作负荷和基于云的 Vm 迁移到 Azure 的工具。Azure Migrate Server Migration is a tool for migrating on-premises workloads, and cloud-based VMs, to Azure. Site Recovery 是一种灾难恢复工具。Site Recovery is a disaster recovery tool. 这些工具共享一些用于数据复制的常见技术组件,但其用途不同。The tools share some common technology components used for data replication, but serve different purposes.

体系结构组件Architectural components

关系图显示了一个源 Hyper-v 网络,其中包含一个用于 Microsoft Azure 的 H T T P S 数据通道,其中详细说明了表中的详细信息。

组件 Component 部署Deployment
复制提供程序Replication provider Microsoft Azure Site Recovery 提供程序安装在 Hyper-v 主机上,并已注册到 Azure 迁移服务器迁移。The Microsoft Azure Site Recovery provider is installed on Hyper-V hosts, and registered with Azure Migration Server Migration.
提供程序会协调 Hyper-v Vm 的复制。The provider orchestrates replication for Hyper-V VMs.
恢复服务代理Recovery Services agent Microsoft Azure 恢复服务代理处理数据复制。The Microsoft Azure Recovery Service agent handles data replication. 它与提供程序协同工作,以将数据从 Hyper-v Vm 复制到 Azure。It works with the provider to replicate data from Hyper-V VMs to Azure.
复制的数据将上传到 Azure 订阅中的存储帐户。The replicated data is uploaded to a storage account in your Azure subscription. 服务器迁移工具处理复制的数据,并将其应用于订阅中的副本磁盘。The Server Migration tool the processes the replicated data, and applies it to replica disks in the subscription. 在迁移时,将使用副本磁盘创建 Azure Vm。The replica disks are used to create the Azure VMs when you migrate.
  • 组件由单个安装程序文件进行安装,该文件从门户中的 Azure Migrate Server 迁移下载。Components are installed by a single setup file, downloaded from Azure Migrate Server Migration in the portal.
  • 提供程序和设备使用出站 HTTPS 端口443连接与 Azure Migrate 服务器迁移通信。The provider and appliance use outbound HTTPS port 443 connections to communicate with Azure Migrate Server Migration.
  • 来自提供程序和代理的通信是安全的和加密的。Communications from the provider and agent are secure and encrypted.

复制过程Replication process

  1. 为 Hyper-v VM 启用复制后,初始复制开始。When you enable replication for a Hyper-V VM, initial replication begins.
  2. 将创建一个 Hyper-v VM 快照。A Hyper-V VM snapshot is taken.
  3. VM 上的 Vhd 逐个复制,直到它们都复制到 Azure。VHDs on the VM are replicated one-by-one, until they're all copied to Azure. 初始复制时间取决于 VM 大小和网络带宽。Initial replication time depends on the VM size, and network bandwidth.
  4. 使用 Hyper-v 副本跟踪在初始复制期间发生的磁盘更改,并将其存储在日志文件中 (hrl files) 。Disk changes that occur during initial replication are tracked using Hyper-V Replica, and stored in log files (hrl files).
    • 日志文件位于与磁盘相同的文件夹中。Log files are in the same folder as the disks.
    • 每个磁盘都有一个关联的 hrl 文件,该文件将发送到辅助存储。Each disk has an associated hrl file that's sent to secondary storage.
    • 当初始复制正在进行时,快照和日志将占用磁盘资源。The snapshot and log files consume disk resources while initial replication is in progress.
  5. 初始复制完成后,将删除 VM 快照,并开始增量复制。After initial replication finishes, the VM snapshot is deleted, and delta replication begins.
  6. 增量磁盘更改将在 hrl 文件中进行跟踪。Incremental disk changes are tracked in hrl files. 恢复服务代理定期将复制日志上传到 Azure 存储帐户。Replication logs are periodically uploaded to an Azure storage account by the Recovery Services agent.

性能和缩放Performance and scaling

Hyper-v 的复制性能受到各种因素的影响,这些因素包括: VM 大小、数据更改率 (变动) ,Hyper-v 主机上用于日志文件存储的可用空间,上传复制数据的带宽,以及 Azure 中的目标存储。Replication performance for Hyper-V is influenced by factors that include VM size, the data change rate (churn) of the VMs, available space on the Hyper-V host for log file storage, upload bandwidth for replication data, and target storage in Azure.

  • 如果要同时复制多台计算机,请使用适用于 Hyper-v 的 Azure Site Recovery 部署规划器 来帮助优化复制。If you're replicating multiple machines at the same time, use the Azure Site Recovery Deployment Planner for Hyper-V, to help optimize replication.
  • 按照容量规划 Hyper-v 复制,并在 Azure 存储帐户上分配复制。Plan your Hyper-V replication, and distribute replication over Azure storage accounts, in accordance with capacity.

控制上传吞吐量Control upload throughput

可以在每个 Hyper-v 主机上限制用于将数据上传到 Azure 的带宽量。You can limit the amount of bandwidth used to upload data to Azure on each Hyper-V host. 小心。Be careful. 如果将值设置得过低,则会对复制产生不利影响,并延迟迁移。If you set the values too low it will adversely impact replication, and delay migration.

  1. 登录到 Hyper-v 主机或群集节点。Sign in to the Hyper-V host or cluster node.
  2. 运行 C:\Program Files\Microsoft Azure Recovery Services Agent\bin\wabadmin.msc,以打开 Microsoft AZURE Backup mmc 管理单元。Run C:\Program Files\Microsoft Azure Recovery Services Agent\bin\wabadmin.msc, to open the Windows Azure Backup MMC snap-in.
  3. 在该管理单元中,选择“更改属性”。 In the snap-in, select Change Properties.
  4. 在 " 限制" 中,选择 " 为备份操作启用 internet 带宽使用限制"。In Throttling, select Enable internet bandwidth usage throttling for backup operations. 设置工作和非工作小时数限制。Set the limits for work and non-work hours. 有效范围为 512 Kbps 到 1,023 Mbps。Valid ranges are from 512 Kbps to 1,023 Mbps. II

影响上传效率Influence upload efficiency

如果有用于复制的备用带宽,并且想要增加上载,则可以增加为上载任务分配的线程数,如下所示:If you have spare bandwidth for replication, and want to increase uploads, you can increase the number of threads allocated for the upload task, as follows:

  1. 用 Regedit 打开注册表。Open the registry with Regedit.
  2. 导航到密钥 HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Azure Backup\Replication\UploadThreadsPerVMNavigate to key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Azure Backup\Replication\UploadThreadsPerVM
  3. 增加每个复制 VM 用于数据上载的线程数的值。Increase the value for the number of threads used for data upload for each replicating VM. 默认值为4,最大值为32。The default value is 4 and the max value is 32.

后续步骤Next steps

使用 Azure Migrate Server 迁移尝试 hyper-v 迁移Try out Hyper-V migration using Azure Migrate Server Migration.