故障转移和故障回复 VMware VMFail over and fail back VMware VMs

本文介绍如何将本地 VMware VM 故障转移到 Azure Site Recovery 服务。This article describes how to fail over an on-premises VMware VM to Azure Azure Site Recovery service.

本文是系列教程的第四篇文章,介绍如何为本地计算机设置到 Azure 的灾难恢复。This is the fifth tutorial in a series that shows you how to set up disaster recovery to Azure for on-premises machines.

本教程介绍如何执行下列操作:In this tutorial, you learn how to:

  • 验证 VMware VM 属性以检查是否符合 Azure 要求Verify the VMware VM properties to check conform with Azure requirements
  • 运行到 Azure 的故障转移Run a failover to Azure

Note

教程中介绍了某个方案的最简单部署路径。Tutorials show you the simplest deployment path for a scenario. 它们尽可能使用默认选项,并且不显示所有可能的设置和路径。They use default options where possible, and don't show all possible settings and paths. 若要详细了解故障转移,请查看此文If you want to learn about failover in detail, review this article.

开始之前Before you start

完成前一篇教程:Complete the previous tutorials:

  1. 确保已设置 Azure,以便能够将本地 VMware VM、Hyper-V VM 和物理计算机灾难恢复到 Azure。Make sure you've set up Azure for on-premises disaster recovery of VMware VMs, Hyper-V VMs, and physical machines to Azure.
  2. 准备本地 VMwareHyper-V 环境,以实现灾难恢复。Prepare your on-premises VMware or Hyper-V environment for disaster recovery. 若要为物理服务器设置灾难恢复,请查看支持矩阵If you're setting up disaster recovery for physical servers, review the support matrix.
  3. VMware VMHyper-V VM物理机设置灾难恢复。Set up disaster recovery for VMware VMs, Hyper-V VMs, or physical machines.
  4. 运行灾难恢复演练,以确保一切按预期方式进行。Run a disaster recovery drill to make sure that everything's working as expected.

故障转移和故障回复Failover and failback

故障转移和故障回复有四个阶段:Failover and failback have four stages:

  1. 故障转移到 Azure:当本地主站点出现故障时,可将计算机故障转移到 Azure。Fail over to Azure: When your on-premises primary site goes down, fail machines over to Azure. 故障转移后,将会基于复制的数据创建 Azure VM。After failover, Azure VMs are created from replicated data.
  2. 重新保护 Azure VM:在 Azure 中重新保护 Azure VM,使之开始复制回到本地 VMware VM。Reprotect Azure VMs: In Azure, reprotect the Azure VMs, so that they start replicating back to on-premises VMware VMs. 重新保护期间,为确保数据一致性,本地 VM 会关闭。The on-premises VM is turned off during reprotection, to help ensure data consistency.
  3. 故障转移到本地:本地站点正常运行后,可运行故障转移以便从 Azure 故障回复。Fail over to on-premises: When your on-premises site is up and running, run a failover to fail back from Azure.
  4. 重新保护本地 VM:故障回复数据后,重新保护故障回复到的本地 VM,使之开始复制到 Azure。Reprotect on-premises VMs: After data has failed back, reprotect the on-premises VMs to which you failed back, so that they start replicating to Azure.

验证 VM 属性Verify VM properties

运行故障转移之前,请检查 VM 属性,确保其符合 Azure 要求Before you run a failover, verify VM properties, and make sure that VMs comply with Azure requirements.

按如下所述检查属性:Verify properties as follows:

  1. 在“受保护的项” 中,单击“复制的项” >“虚拟机”。In Protected Items, click Replicated Items > VM.

  2. “复制的项”窗格中具有 VM 信息、运行状况状态和最新可用恢复点的摘要 。In the Replicated item pane, there's a summary of VM information, health status, and the latest available recovery points. 单击“属性” ,查看详细信息。Click Properties to view more details.

  3. 在“计算和网络” 中,可以修改 Azure 名称、资源组、目标大小、可用性集和托管磁盘设置In Compute and Network, you can modify the Azure name, resource group, target size, availability set, and managed disk settings

  4. 可查看和修改网络设置,包括在运行故障转移后 Azure VM 所在的网络/子网,以及将分配给它的 IP 地址。You can view and modify network settings, including the network/subnet in which the Azure VM will be located after failover, and the IP address that will be assigned to it.

  5. 在“磁盘” 中,可以看到关于 VM 上的操作系统和数据磁盘的信息。In Disks, you can see information about the operating system and data disks on the VM.

运行到 Azure 的故障转移Run a failover to Azure

  1. 在“设置” > “复制的项”中,单击“VM”>“故障转移” 。In Settings > Replicated items, click the VM > Failover.

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

    • 最新:此选项会首先处理发送到 Site Recovery 的所有数据。Latest: This option first processes all the data sent to Site Recovery. 它提供最低的 RPO(恢复点对象),因为故障转移后创建的 Azure VM 具有触发故障转移时复制到 Site Recovery 的所有数据。It provides the lowest RPO (Recovery Point Objective) because the Azure VM created after failover has all the data that was replicated to Site Recovery when the failover was triggered.
    • 最新处理:此选项将 VM 故障转移到由 Site Recovery 处理的最新恢复点。Latest processed: This option fails the VM over to the latest recovery point processed by Site Recovery. 此选项提供低 RTO(恢复时间目标),因为无需费时处理未经处理的数据。This option provides a low RTO (Recovery Time Objective), because no time is spent processing unprocessed data.
    • 最新的应用一致:此选项将 VM 故障转移到由 Site Recovery 处理的最新应用一致恢复点。Latest app-consistent: This option fails over the VM to the latest app-consistent recovery point processed by Site Recovery.
    • 自定义:指定一个恢复点。Custom: Specify a recovery point.
  3. 选择“在开始故障转移之前关闭计算机”,在触发故障转移之前尝试关闭源 VM 。Select Shut down machine before beginning failover to attempt to do a shutdown of source VMs before triggering the failover. 即使关机失败,故障转移也仍会继续。Failover continues even if shutdown fails. 可以在“作业” 页上跟踪故障转移进度。You can follow the failover progress on the Jobs page.

在某些情况下,故障转移需要大约八到十分钟的时间完成其他进程。In some scenarios, failover requires additional processing that takes around eight to ten minutes to complete. 对于以下情况,你可能会发现测试故障转移会持续较长时间:You might notice longer test failover times for:

  • VMware VM 运行的移动服务版本低于 9.8VMware VMs running a Mobility service version older than 9.8
  • 物理服务器Physical servers
  • VMware Linux VMVMware Linux VMs
  • Hyper-V VM 作为物理服务器受到保护Hyper-V VMs protected as physical servers
  • VMware VM 未启用 DHCP 服务VMware VMs that don't have the DHCP service enabled
  • VMware VM 不包含以下启动驱动程序:storvsc、vmbus、storflt、intelide、atapi。VMware VMs that don't have the following boot drivers: storvsc, vmbus, storflt, intelide, atapi.

Warning

请勿取消正在进行的故障转移:在故障转移开始前,VM 复制已停止。Don't cancel a failover in progress: Before failover is started, VM replication is stopped. 如果取消正在进行的故障转移,故障转移会停止,但 VM 将不再进行复制。If you cancel a failover in progress, failover stops, but the VM won't replicate again.

连接到故障转移的 VMConnect to failed over VM

  1. 若要在故障转移后使用 RDP/SSH 连接到 Azure VM,请检查这些要求If you want to connect to Azure VMs using RDP/SSH after failover, verify these requirements.
  2. 故障转移后,请转到该 VM,并通过与它建立连接来进行验证。After failover, go to the VM and validate by connecting to it.
  3. 若要在故障转移后使用不同的恢复点,请使用“更改恢复点”。 Use Change recovery point if you want to use a different recovery point after failover. 在下一步骤中提交故障转移后,此选项不再可用。After you commit the failover in the next step, this option will no longer be available.
  4. 验证后,单击“提交”以确认故障转移后的 VM 恢复点。 After validation, click on Commit to finalize the recovery point of the VM after failover.
  5. 提交后,系统会删除其他所有可用的恢复点。After commit, all the other available recovery points are deleted. 故障转移到此完成。This completes failover.

Tip

如果故障转移后遇到任何连接问题,请遵循此故障排除指南予以解决。If you encounter any connectivity issues after failover, follow this troubleshooting guide.

后续步骤Next steps

故障转移后,在本地重新保护 Azure VM。After failover, reprotect the Azure VMs to on-premises. 重新保护 VM 并将其复制到本地站点后,如果已做好准备,请从 Azure 故障回复。Then, after the VMs are reprotected and replicating to the on-premises site, fail back from Azure when you're ready.