为 Hyper-V VM 到 Azure 的灾难恢复准备本地 Hyper-V 服务器Prepare on-premises Hyper-V servers for disaster recovery to Azure

本文介绍如何在要使用 Azure Site Recovery 安排 Hyper-VM 到 Azure 的灾难恢复时准备本地 Hyper-V 基础结构。This article describes how to prepare your on-premises Hyper-V infrastructure when you want to set up disaster recovery of Hyper-VMs to Azure, using Azure Site Recovery.

这是本系列的第二个教程,演示如何安排本地 Hyper-V VM 到 Azure 的灾难恢复。This is the second tutorial in a series that shows you how to set up disaster recovery to Azure for on-premises Hyper-V VMs. 在第一个教程中,我们设置了 Hyper-V 灾难恢复所需的 Azure 组件In the first tutorial, we set up the Azure components needed for Hyper-V disaster recovery.

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

  • 如果 Hyper-V 主机由 System Center VMM 管理,请查看 Hyper-V 要求和 VMM 要求。Review Hyper-V requirements, and VMM requirements if your Hyper-V hosts are managed by System Center VMM.
  • 准备 VMM(如果适用)。Prepare VMM if applicable.
  • 验证对 Azure 位置的 Internet 访问。Verify internet access to Azure locations.
  • 准备 VM,以便可以在故障转移到 Azure 后访问它们。Prepare VMs so that you can access them after failover to Azure.

备注

教程介绍了某个方案的最简单部署路径。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. 有关详细说明,请查看 Site Recovery 目录的“操作指南”部分所列的文章。For detailed instructions, review the article in the How To section of the Site Recovery Table of Contents.

开始之前Before you start

请确保按照本系列中的第一个教程中的说明准备好 Azure。Make sure you've prepared Azure as described in the first tutorial in this series.

审查要求和先决条件Review requirements and prerequisites

确保 Hyper-V 主机和 VM 符合要求。Make sure Hyper-V hosts and VMs comply with requirements.

  1. 验证本地服务器要求。Verify on-premises server requirements.
  2. 检查要复制到 Azure 的 Hyper-V VM 的要求Check the requirements for Hyper-V VMs you want to replicate to Azure.
  3. 检查 Hyper-V 主机网络以及主机和来宾存储是否支持本地 Hyper-V 主机。Check Hyper-V host networking; and host and guest storage support for on-premises Hyper-V hosts.
  4. 故障转移后,检查 Azure 网络存储计算支持的功能。Check what's supported for Azure networking, storage, and compute, after failover.
  5. 复制到 Azure 的本地 VM 必须符合 Azure VM 要求Your on-premises VMs you replicate to Azure must comply with Azure VM requirements.

准备 VMM(可选)Prepare VMM (optional)

如果 Hyper-V 主机由 VMM 管理,则需准备本地 VMM 服务器。If Hyper-V hosts are managed by VMM, you need to prepare the on-premises VMM server.

  • 请确保 VMM 服务器至少有一个云,包含一个或多个主机组。Make sure the VMM server has a least one cloud, with one or more host groups. 运行在虚拟机上的 Hyper-V 主机应位于云中。The Hyper-V host on which VMs are running should be located in the cloud.
  • 为网络映射准备 VMM 服务器。Prepare the VMM server for network mapping.

为网络映射准备 VMMPrepare VMM for network mapping

如果使用 VMM,则网络映射在本地 VMM VM 网络和 Azure 虚拟网络之间进行映射。If you're using VMM, network mapping maps between on-premises VMM VM networks, and Azure virtual networks. 映射将确保在故障转移后创建 Azure VM 时,将其连接到正确的网络。Mapping ensures that Azure VMs are connected to the right network when they're created after failover.

为网络映射准备 VMM,如下所示:Prepare VMM for network mapping as follows:

  1. 确保有与 Hyper-V 主机所在的云相关联的 VMM 逻辑网络Make sure you have a VMM logical network that's associated with the cloud in which the Hyper-V hosts are located.
  2. 确保有链接到逻辑网络的虚拟机网络Ensure you have a VM network linked to the logical network.
  3. 在 VMM 中,将 VM 连接到 VM 网络。In VMM, connect the VMs to the VM network.

验证 Internet 访问Verify internet access

  1. 对于本教程,最简单的配置是让 Hyper-V 主机和 VMM 服务器能够直接访问 Internet 而无需使用代理。For the purposes of the tutorial, the simplest configuration is for the Hyper-V hosts and VMM server to have direct access to the internet without using a proxy.
  2. 请确保该 Hyper-V 主机和 VMM 服务器(如果相关)可以访问以下所需 URL。Make sure that Hyper-V hosts, and the VMM server if relevant, can access the required URLs below.
  3. 如果要通过 IP 地址来控制访问,请确保:If you're controlling access by IP address, make sure that:
    • 基于 IP 地址的防火墙规则可以连接到 Azure 数据中心 IP 范围和 HTTPS (443) 端口。IP address-based firewall rules can connect to Azure Datacenter IP Ranges, and the HTTPS (443) port.
    • 允许订阅的 Azure 区域的 IP 地址范围。Allow IP address ranges for the Azure region of your subscription.

所需 URLRequired URLs

名称Name Azure 中国世纪互联 URLAzure China 21Vianet URL 描述Description
Azure Active DirectoryAzure Active Directory login.partner.microsoftonline.cn 由 Azure Active Directory 用于访问控制和标识管理。Used for access control and identity management by using Azure Active Directory.
备份Backup *.backup.windowsazure.cn 用于复制数据传输和协调Used for replication data transfer and coordination
复制Replication *.hypervrecoverymanager.windowsazure.cn 用于复制管理操作和协调Used for replication management operations and coordination
存储Storage *.blob.core.chinacloudapi.cn 用于访问存储所复制数据的存储帐户Used for access to the storage account that stores replicated data
遥测(可选)Telemetry (optional) dc.services.visualstudio.com 用于遥测Used for telemetry
时间同步Time synchronization time.windows.com 用于检查所有部署中的系统时间与全球时间之间的时间同步。Used to check time synchronization between system and global time in all deployments.

准备在故障转移后连接到 Azure VMPrepare to connect to Azure VMs after failover

在实施故障转移方案期间,可能需要连接到已复制的本地网络。During a failover scenario you may want to connect to your replicated on-premises network.

若要在故障转移后使用 RDP 连接到 Windows VM,请按如下所示允许访问:To connect to Windows VMs using RDP after failover, allow access as follows:

  1. 若要通过 Internet 访问,请在故障转移之前在本地 VM 上启用 RDP。To access over the internet, enable RDP on the on-premises VM before failover. 请确保已针对“公共”配置文件添加了 TCP 和 UDP 规则,并确保在“Windows 防火墙” > “允许的应用”中针对所有配置文件允许 RDP 。Make sure that TCP, and UDP rules are added for the Public profile, and that RDP is allowed in Windows Firewall > Allowed Apps for all profiles.
  2. 若要通过站点到站点 VPN 进行访问,请在本地计算机上启用 RDP。To access over site-to-site VPN, enable RDP on the on-premises machine. 应在“Windows 防火墙” -> “允许的应用和功能”中针对“域和专用”网络允许 RDP 。RDP should be allowed in the Windows Firewall -> Allowed apps and features for Domain and Private networks. 检查操作系统的 SAN 策略是否已设置为 OnlineAll。Check that the operating system's SAN policy is set to OnlineAll. 了解详细信息Learn more. 触发故障转移时,VM 上不应存在待处理的 Windows 更新。There should be no Windows updates pending on the VM when you trigger a failover. 如果存在,则在更新完成之前无法登录到虚拟机。If there are, you won't be able to sign in to the virtual machine until the update completes.
  3. 在 Windows Azure VM 上执行故障转移后,请选中“启动诊断”,查看 VM 的屏幕截图。On the Windows Azure VM after failover, check Boot diagnostics to view a screenshot of the VM. 如果无法连接,请检查 VM 是否正在运行,并查看这些疑难解答提示If you can't connect, check that the VM is running and review these troubleshooting tips.

故障转移后,可以使用与复制的本地 VM 相同的 IP 地址或不同的 IP 地址访问 Azure VM。After failover, you can access Azure VMs using the same IP address as the replicated on-premises VM, or a different IP address. 详细了解如何为故障转移设置 IP 寻址。Learn more about setting up IP addressing for failover.

后续步骤Next steps