运行 Azure 灾难恢复演练Run a disaster recovery drill to Azure

本文介绍如何使用 Azure Site Recovery 服务对本地计算机运行到 Azure 的灾难恢复演练。This article describes how to run a disaster recovery drill for an on-premises machine to Azure using the Azure Site Recovery service. 演练在不丢失数据的情况下验证你的复制策略。A drill validates your replication strategy without data loss.

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

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

  • 设置隔离式网络以用于测试故障转移Set up an isolated network for the test failover
  • 准备在故障转移后连接到 Azure VMPrepare to connect to the Azure VM after failover
  • 为单一计算机运行测试故障转移。Run a test failover for a single machine.

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 the disaster recovery drill steps in more 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.

验证 VM 属性Verify VM properties

在运行测试故障转移前,请验证 VM 属性,确保 Hyper-V VMVMware VM 符合 Azure 要求。Before you run a test failover, verify the VM properties, and make sure that the Hyper-V VM, or VMware VM complies with Azure requirements.

  1. 在“受保护的项” 中,单击“复制的项” ,然后单击 VM。In Protected Items, click Replicated Items > and the 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.

创建用于测试故障转移的网络Create a network for test failover

对于测试故障转移,我们建议选择与每个 VM 的“计算和网络”设置中指定的生产恢复站点网络相互独立的网络。 We recommended that for test failover, you choose a network that's isolated from the production recovery site network specific in the Compute and Network settings for each VM. 默认情况下,创建 Azure 虚拟网络时,该网络独立于其他网络。By default, when you create an Azure virtual network, it is isolated from other networks. 测试网络应模拟生产网络:The test network should mimic your production network:

  • 测试网络中的子网数目应与生产网络中的子网数目相同。The test network should have same number of subnets as your production network. 这些子网的名称应该相同。Subnets should have the same names.
  • 测试网络应使用相同的 IP 地址范围。The test network should use the same IP address range.
  • 使用“计算和网络”设置中为 DNS VM 指定的 IP 地址更新测试网络的 DNS。 Update the DNS of the test network with the IP address specified for the DNS VM in Compute and Network settings. 有关更多详细信息,请参阅 Active Directory 的测试性故障转移注意事项Read test failover considerations for Active Directory for more details.

为单个 VM 运行测试故障转移Run a test failover for a single VM

运行测试故障转移时需执行下列操作:When you run a test failover, the following happens:

  1. 运行必备项检查,确保故障转移所需的所有条件都已就绪。A prerequisites check runs to make sure all of the conditions required for failover are in place.
  2. 故障转移处理数据,以便创建 Azure VM。Failover processes the data, so that an Azure VM can be created. 如果选择最新恢复点,则根据该数据创建恢复点。If you select the latest recovery point, a recovery point is created from the data.
  3. 使用上一步中处理的数据创建 Azure VM。An Azure VM is created using the data processed in the previous step.

按如下所述运行测试故障转移:Run the test failover as follows:

  1. 在“设置” > “复制的项” 中,单击“VM”>“+测试故障转移” 。In Settings > Replicated Items, click the VM > +Test Failover.
  2. 为本教程选择最近处理的恢复点。 Select the Latest processed recovery point for this tutorial. 这会将 VM 故障转移到最近的可用时间点上。This fails over the VM to the latest available point in time. 将显示时间戳。The time stamp is shown. 使用此选项时,无需费时处理数据,因此 RTO(恢复时间目标)会较低。With this option, no time is spent processing data, so it provides a low RTO (recovery time objective).
  3. 在“测试故障转移” 中,选择 Azure VM 在故障转移之后要连接到的目标 Azure 网络。In Test Failover, select the target Azure network to which Azure VMs will be connected after failover occurs.
  4. 单击“确定” 开始故障转移。Click OK to begin the failover. 可以通过单击 VM 打开其属性来跟踪进度。You can track progress by clicking on the VM to open its properties. 或者,可以在保管库名称 > 设置 > 作业 > Site Recovery 作业 中,单击“测试故障转移” 作业。Or you can click the Test Failover job in vault name > Settings > Jobs > Site Recovery jobs.
  5. 故障转移完成后,副本 Azure VM 会显示在 Azure 门户 >“虚拟机”中。 After the failover finishes, the replica Azure VM appears in the Azure portal > Virtual Machines. 请确保虚拟机的大小适当、已连接到正确的网络,并且正在运行。Check that the VM is the appropriate size, that it's connected to the right network, and that it's running.
  6. 现在应该能够连接到 Azure 中复制的 VM。You should now be able to connect to the replicated VM in Azure.
  7. 若要删除在测试故障转移期间创建的 Azure VM,请在 VM 上单击“清理测试故障转移” 。To delete Azure VMs created during the test failover, click Cleanup test failover on the VM. 在“说明”中,记录并保存与测试性故障转移相关联的任何观测结果。 In Notes, record and save any observations associated with the test failover.

在某些情况下,故障转移需要大约八到十分钟的时间完成其他进程。In some scenarios, failover requires additional processing that takes around eight to ten minutes to complete. 你可能注意到,VMware Linux 计算机、未启用 DHCP 服务的 VMware VM,以及未安装启动驱动程序(storvsc、vmbus、storflt、intelide、atapi)的 VMware VM 需要更长的测试故障转移时间。You might notice longer test failover times for VMware Linux machines, VMware VMs that don't have the DHCP service enables, and VMware VMs that don't have the following boot drivers: storvsc, vmbus, storflt, intelide, atapi.

在故障转移后连接Connect after failover

如果要在故障转移后使用 RDP/SSH 连接到 Azure VM,请准备连接If you want to connect to Azure VMs using RDP/SSH after failover, prepare to connect. 如果故障转移后遇到任何连接问题,请遵循故障排除指南予以解决。If you encounter any connectivity issues after failover, follow the troubleshooting guide.

后续步骤Next steps