将 Azure VM 复制到另一个 Azure 区域Replicate Azure VMs to another Azure region

本文介绍如何启用从一个 Azure 区域到另一个区域的 Azure VM 复制。This article describes how to enable replication of Azure VMs, from one Azure region to another.

开始之前Before you start

本文假设你已根据 Azure 到 Azure 灾难恢复教程中所述进行了 Site Recovery 部署准备。This article assumes that you've prepared for Site Recovery deployment, as described in the Azure to Azure disaster recovery tutorial.

必备组件应已到位,并且你应该已创建恢复服务保管库。Prerequisites should be in place, and you should have created a Recovery Services vault.

启用复制Enable replication

启用复制。Enable replication. 此过程假设主要 Azure 区域是中国东部,次要区域是中国北部。This procedure assumes that the primary Azure region is China East, and the secondary region is China North.

  1. 在保管库中,单击“+复制” 。In the vault, click +Replicate.

  2. 指定以下字段:Note the following fields:

    • :VM 的起始点,在本例中为 AzureSource: The point of origin of the VMs, which in this case is Azure.

    • 源位置:要在其中保护 VM 的 Azure 区域。Source location: The Azure region from where you want to protect your VMs. 在本演示中,源位置为“中国东部”For this illustration, the source location is 'China East'

    • 部署模型:源计算机的 Azure 部署模型。Deployment model: Azure deployment model of the source machines.

    • 源订阅:源 VM 所属的订阅。Source subscription: The subscription to which your source VMs belong. 这可以是存在恢复服务保管库的同一 Azure Active Directory 租户中的任何订阅。This can be any subscription within the same Azure Active Directory tenant where your recovery services vault exists.

    • 资源组:源虚拟机所属的资源组。Resource Group: The resource group to which your source virtual machines belong. 所选资源组下的所有 VM 都会在下一步中列出,以供保护。All the VMs under the selected resource group are listed for protection in the next step.

      屏幕截图突出显示了配置复制所需的字段。

  3. 在“虚拟机”>“选择虚拟机” 中,单击并选择要复制的每个 VM。In Virtual Machines > Select virtual machines, click and select each VM that you want to replicate. 只能选择可以启用复制的计算机。You can only select machines for which replication can be enabled. Then click OK. 屏幕截图突出显示了选择虚拟机的位置。Screenshot that highlights where you select virtual machines.

  4. 在“设置”中,可以选择性地配置目标站点设置: In Settings, you can optionally configure target site settings:

    • 目标位置:要在其中复制源虚拟机数据的位置。Target Location: The location where your source virtual machine data will be replicated. 根据所选的计算机位置,Site Recovery 会提供合适目标区域的列表。Depending upon your selected machines location, Site Recovery will provide you the list of suitable target regions. 我们建议将目标位置与恢复服务保管库位置保持相同。We recommend that you keep the target location the same as the Recovery Services vault location.

    • 目标订阅:用于灾难恢复的目标订阅。Target subscription: The target subscription used for disaster recovery. 默认情况下,目标订阅将与源订阅相同。By default, the target subscription will be same as the source subscription.

    • 目标资源组:复制的虚拟机所属的资源组。Target resource group: The resource group to which all your replicated virtual machines belong.

      • 默认情况下,Site Recovery 会在目标位置中创建一个名称带“asr”后缀的新资源组。By default Site Recovery creates a new resource group in the target region with an "asr" suffix in the name.
      • 如果 Site recovery 创建的资源组已存在,则会重复使用。If the resource group created by Site Recovery already exists, it is reused.
      • 可以自定义资源组设置。You can customize the resource group settings.
      • 目标资源组的位置可以是除托管源 VM 区域以外的任何 Azure 区域。The location of the target resource group can be any Azure region, except the region in which the source VMs are hosted.
    • 目标虚拟网络:默认情况下,Site Recovery 会在目标位置中创建一个名称带“asr”后缀的新虚拟网络。Target virtual network: By default, Site Recovery creates a new virtual network in the target region with an "asr" suffix in the name. 这会映射到源网络并会用于任何将来的保护。This is mapped to your source network, and used for any future protection. 详细了解网络映射。Learn more about network mapping.

    • 目标存储帐户(源 VM 不使用托管磁盘) :默认情况下,Site Recovery 会创建模拟源 VM 存储配置的新目标存储帐户。Target storage accounts (source VM doesn't use managed disks): By default, Site Recovery creates a new target storage account mimicking your source VM storage configuration. 如果存储帐户已存在,则重复使用。In case storage account already exists, it is reused.

    • 副本托管磁盘(源 VM 使用托管磁盘) :Site Recovery 在目标区域新建托管磁盘副本,以生成和源 VM 的托管磁盘存储类型一致(标准或高级)的镜像磁盘。Replica-managed disks (source VM uses managed disks): Site Recovery creates new replica-managed disks in the target region to mirror the source VM's managed disks with the same storage type (Standard or premium) as the source VM's managed disk.

    • 缓存存储帐户:Site Recovery 需要源区域中称为“缓存存储”的额外存储帐户。Cache Storage accounts: Site Recovery needs extra storage account called cache storage in the source region. 在复制到目标位置前,系统会跟踪源 VM 上发生的所有更改并发送到缓存存储帐户。All the changes happening on the source VMs are tracked and sent to cache storage account before replicating those to the target location. 此存储帐户应是标准存储帐户。This storage account should be Standard.

    • 目标可用性集:默认情况下,Site Recovery 会在目标区域中创建一个名称带“asr”后缀(针对源区域中属于可用性集的 VM)的新可用性集。Target availability sets: By default, Site Recovery creates a new availability set in the target region with the "asr" suffix in the name, for VMs that are part of an availability set in the source region. 如果 Site recovery 创建的可用性集已存在,则重复使用它。If the availability set created by Site Recovery already exists, it is reused.

      默认将目标 VM 配置为单一实例。The target VMs are configured as single instances by default. 如果需要,可以单击“自定义”,以便在目标区域中将此类 VM 配置为可用性集的一部分。If required, you can configure such VMs to be part of availability sets in target region by clicking 'Customize'.

      备注

      在启用复制以后,不能更改可用性类型 - 单一实例、可用性集。You cannot change the availability type - single instance, availability set , after you enable replication. 若要更改可用性类型,需要先禁用复制,然后再启用复制。You need to disable and enable replication to change the availability type.

    • 复制策略:定义恢复点保留期历史记录和应用一致性快照频率的设置。Replication Policy: It defines the settings for recovery point retention history and app consistent snapshot frequency. 默认情况下,Azure Site Recovery 使用恢复点保留期为“24 小时”、应用一致性快照频率为“4 小时”的默认设置创建新的复制策略。By default, Azure Site Recovery creates a new replication policy with default settings of '24 hours' for recovery point retention and '4 hours' for app consistent snapshot frequency.

    启用复制

为添加的磁盘启用复制Enable replication for added disks

将磁盘添加到支持复制的 Azure VM 时,会发生以下情况:If you add disks to an Azure VM for which replication is enabled, the following occurs:

  • VM 的复制运行状况会显示一条警告,并且会通过备注告知你需要对一个或多个磁盘进行保护。Replication health for the VM shows a warning, and a note informs telling you that one or more disks are available for protection.

  • 如果为添加的磁盘启用保护,此警告会在初始复制磁盘后消失。If you enable protection for the added disks, the warning will disappear after the initial replication of the disk.

  • 如果选择不为磁盘启用复制,则可选择关闭此警告。If you choose not to enable replication for the disk, you can select to dismiss the warning.

    添加的新磁盘

若要为添加的磁盘启用复制,请执行以下操作:To enable replication for an added disk, do the following:

  1. 在保管库 >“复制的项”中,单击已向其添加磁盘的 VM。In the vault > Replicated Items, click the VM to which you added the disk.

  2. 单击“磁盘”,然后选择要为其启用复制的数据磁盘(这些磁盘具有“未受保护”状态)。Click Disks, and then select the data disk for which you want to enable replication (these disks have a Not protected status).

  3. 在“磁盘详细信息”中,单击“启用复制”。In Disk Details, click Enable replication.

    为添加的磁盘启用复制

在启用复制作业运行且初始复制完成后,将删除针对磁盘问题的复制运行状况警告。After the enable replication job runs, and the initial replication finishes, the replication health warning for the disk issue is removed.

自定义目标资源Customize target resources

可以修改 Site Recovery 使用的默认目标设置。You can modify the default target settings used by Site Recovery.

  1. 单击“目标订阅”旁边的“自定义:”,修改默认目标订阅。Click Customize: next to 'Target subscription' to modify the default target subscription. 从同一 Azure Active Directory (AAD) 租户中可用的所有订阅列表中选择订阅。Select the subscription from the list of all the subscriptions available in the same Azure Active Directory (AAD) tenant.

  2. 单击“自定义:”修改默认设置:Click Customize: to modify default settings:

    • 在“目标资源组”中,从订阅内目标位置中的所有资源组列表中选择资源组。In Target resource group, select the resource group from the list of all the resource groups in the target location of the subscription.
    • 在“目标虚拟网络”中,从目标位置中所有虚拟网络列表中选择网络。In Target virtual network, select the network from a list of all the virtual network in the target location.
    • 在“可用性集”中,可将可用性集设置添加到 VM(如果它们是源区域中可用性集的一部分)。In Availability set, you can add availability set settings to the VM, if they're part of an availability set in the source region.
    • 在“目标存储帐户”中,选择要使用的帐户。In Target Storage accounts, select the account you want to use. 屏幕截图显示了如何自定义目标订阅设置。
  3. 单击“自定义:”以修改默认设置。Click Customize: to modify replication settings.

  4. 在“多 VM 一致性”中,选择要一起复制的 VM。In Multi-VM consistency, select the VMs that you want to replicate together.

    • 故障转移时,复制组中的所有计算机将具有共享的崩溃一致性恢复点和应用程序一致性恢复点。All the machines in a replication group will have shared crash consistent and app-consistent recovery points when failed over.
    • 启用多 VM 一致性会影响工作负荷的性能(因为它是 CPU 密集型的)。Enabling multi-VM consistency can impact workload performance (as it is CPU intensive). 仅当计算机运行相同的工作负荷并且你需要在多个计算机之间保持一致时,才应启用此功能。It should only be enabled if machines are running the same workload, and you need consistency across multiple machines.
    • 例如,如果应用程序有 2 个 SQL Server 虚拟机和 2 个 Web 服务器,则只应将 SQL Server VM 添加到复制组。For example, if an application has 2 SQL Server virtual machines and two web servers, then you should add only the SQL Server VMs to a replication group.
    • 在一个复制组中最多可以选择包含 16 个 VM。You can choose to have a maximum of 16 VMs in a replication group.
    • 如果启用了多 VM 一致性,则复制组中的计算机将通过端口 20004 相互通信。If you enable multi-VM consistency, machines in the replication group communicate with each other over port 20004.
    • 确保防火墙设备没有阻止 VM 之间通过端口 20004 进行的内部通信。Ensure there's no firewall appliance blocking the internal communication between the VMs over port 20004.
    • 如果想要 Linux VM 成为复制组的一部分,请确保按照特定 Linux 版本的指南手动打开端口 20004 上的出站流量。If you want Linux VMs to be part of a replication group, ensure the outbound traffic on port 20004 is manually opened according to guidance for the specific Linux version. 屏幕截图显示了多 VM 一致性设置。
  5. 单击“创建目标资源” > “启用复制”。 Click Create target resource > Enable Replication.

  6. 为 VM 启用复制后,可以在“复制的项”下检查 VM 的运行状况After the VMs are enabled for replication, you can check the status of VM health under Replicated items

备注

  • 在初始复制期间,VM 状态刷新可能需要一段时间,但不显示进度。During initial replication the status might take some time to refresh, without progress. 单击“刷新”按钮可获取最新状态。Click the Refresh button, to get the latest status.
  • 如果过去 60 分钟内未生成恢复点,则虚拟机的复制运行状况将变为“严重”。If a recovery point has not been generated in last 60 minutes, the replication health of the virtual machine will become critical.

后续步骤Next steps

详细了解如何运行测试故障转移。Learn more about running a test failover.