在区域之间故障转移和重新保护 Azure VMFail over and reprotect Azure VMs between regions

本教程介绍如何使用 Azure Site Recovery 服务将 Azure 虚拟机 (VM) 故障转移到次要 Azure 区域。This tutorial describes how to fail over an Azure virtual machine (VM) to a secondary Azure region with the Azure Site Recovery service. 故障转移后,对 VM 重新进行保护。After you've failed over, you reprotect the VM. 本教程介绍如何执行下列操作:In this tutorial, you learn how to:

  • 故障转移 Azure VMFail over the Azure VM
  • 重新保护辅助 Azure VM,以便它复制到主要区域。Reprotect the secondary Azure VM, so that it replicates to the primary region.

Note

本教程包含的最简单路径带有默认设置和最小自定义项。This tutorial contains the simplest path with default settings and minimum customization. 如需更复杂的方案,请参阅 Azure VM 的“操作指南”下的文章。For more complex scenarios, use the articles under 'How To' for Azure VMs.

先决条件Prerequisites

运行到次要区域的故障转移Run a failover to the secondary region

  1. 在“已复制项” 中,选择要故障转移的 VM >“故障转移” In Replicated items, select the VM that you want to fail over > Failover

    故障转移

  2. 在“故障转移” 中,选择要故障转移到的“恢复点” 。In Failover, select a Recovery Point to fail over to. 可以使用以下选项之一:You can use one of the following options:

    • 最新(默认值):处理 Site Recovery 服务中的所有数据,并提供最低的恢复点目标 (RPO)。Latest (default): Processes all the data in the Site Recovery service and provides the lowest Recovery Point Objective (RPO).
    • 最新处理:将虚拟机还原到已由 Site Recovery 服务处理的最新恢复点。Latest processed: Reverts the virtual machine to the latest recovery point that has been processed by Site Recovery service.
    • 自定义:故障转移到特定的恢复点。Custom: Fails over to a particular recovery point. 此选项可用于执行测试故障转移。This option is useful for performing a test failover.
  3. 如果希望 Site Recovery 在触发故障转移之前尝试关闭源 VM,请选择“在开始故障转移前关闭计算机” 。Select Shut down machine before beginning failover if you want Site Recovery to attempt to do a shutdown of source VMs before triggering the failover. 即使关机失败,故障转移也仍会继续。Failover continues even if shutdown fails. Site Recovery 不在故障转移之后清理源。Site Recovery does not clean up the source after failover.

  4. 在“作业”页上跟踪故障转移进度。 Follow the failover progress on the Jobs page.

  5. 故障转移后,请登录到虚拟机来对它进行验证。After the failover, validate the virtual machine by logging in to it. 如果想要转到虚拟机的另一个恢复点,可以使用“更改恢复点” 选项。If you want to go another recovery point for the virtual machine, then you can use Change recovery point option.

  6. 如果故障转移后的虚拟机符合要求,可以“提交” 故障转移。Once you are satisfied with the failed over virtual machine, you can Commit the failover. 提交会删除该服务提供的所有恢复点。Committing deletes all the recovery points available with the service. 现在无法无法更改恢复点。You won't now be able to change the recovery point.

Note

当你将启用 VM 复制后添加磁盘的 VM 进行故障转移时,复制点会显示可用于恢复的磁盘。When you fail over a VM to which you add a disk after you enabled replication for the VM, replication points will show the disks that are available for recovery. 例如,如果 VM 有一个磁盘,你添加了一个新的磁盘,则在添加磁盘之前创建的复制点会显示复制点包含“1 个磁盘(共 2 个)”。For example, if a VM has a single disk and you add a new one, replication points that were created before you added the disk will show that the replication point consists of "1 of 2 disks".

使用添加的磁盘进行故障转移

重新保护辅助 VMReprotect the secondary VM

故障转移 VM 之后,需要重新保护它,以便它复制回主要区域。After failover of the VM, you need to reprotect it so that it replicates back to the primary region.

  1. 确保 VM 处于“故障转移已提交” 状态,检查主要区域是否可用,并且你是否能够在其中创建和访问新资源。Make sure that the VM is in the Failover committed state, and check that the primary region is available, and you're able to create and access new resources in it.

  2. 在“保管库” > “已复制项”中,右键单击已故障转移的 VM,并选择“重新保护”。 In Vault > Replicated items, right-click the VM that's been failed over, and then select Re-Protect.

    右键单击以重新保护

  3. 验证是否已选择保护方向(从次要区域到主要区域)。Verify that the direction of protection, secondary to primary region, is already selected.

  4. 查看“资源组、网络、存储和可用性集” 信息。Review the Resource group, Network, Storage, and Availability sets information. 任何标记为“新”的资源将在重新保护操作中创建。Any resources marked as new are created as part of the reprotect operation.

  5. 单击“确定” 触发重新保护作业。Click OK to trigger a reprotect job. 此作业使用最新数据植入目标站点。This job seeds the target site with the latest data. 然后,它将增量复制到主要区域。Then, it replicates the deltas to the primary region. 该 VM 现在处于受保护状态。The VM is now in a protected state.

后续步骤Next steps