为 Hyper-V VM 灾难恢复到 Azure 准备网络映射Prepare network mapping for Hyper-V VM disaster recovery to Azure

本文有助于理解及准备使用 Azure Site Recovery 服务将 System Center Virtual Machine Manager (VMM) 云中的 Hyper-V VM 复制到 Azure 或辅助站点时的网络映射。This article helps you to understand and prepare for network mapping when you replicate Hyper-V VMs in System Center Virtual Machine Manager (VMM) clouds to Azure, or to a secondary site, using the Azure Site Recovery service.

为复制到 Azure 准备网络映射Prepare network mapping for replication to Azure

复制到 Azure 时,网络映射在源 VMM 服务器上的 VM 网络与目标 Azure 虚拟网络之间进行映射。When you're replicating to Azure, network mapping maps between VM networks on a source VMM server, and target Azure virtual networks. 映射可执行以下操作:Mapping does the following:

  • 网络连接:确保复制的 Azure VM 连接到映射的网络。Network connection—Ensures that replicated Azure VMs are connected to the mapped network. 在同一网络上进行故障转移的所有计算机都可互相连接,即使这些计算机在不同的恢复计划中进行故障转移。All machines which fail over on the same network can connect to each other, even if they failed over in different recovery plans.
  • 网络网关:如果在目标 Azure 网络上设置了网络网关,VM 可连接到其他本地虚拟机。Network gateway—If a network gateway is set up on the target Azure network, VMs can connect to other on-premises virtual machines.

网络映射的工作原理如下所述:Network mapping works as follows:

  • 源 VMM VM 网络会映射到 Azure 虚拟网络。You map a source VMM VM network to an Azure virtual network.
  • 故障转移后,源网络中的 Azure VM 会连接到映射的目标虚拟网络。After failover Azure VMs in the source network will be connected to the mapped target virtual network.
  • 执行复制时,添加到源 VM 网络的新 VM 会连接到映射的 Azure 网络。New VMs added to the source VM network are connected to the mapped Azure network when replication occurs.
  • 如果目标网络具有多个子网,并且其中一个子网与源虚拟机所在的子网同名,则在故障转移后副本虚拟机将连接到该目标子网。If the target network has multiple subnets, and one of those subnets has the same name as subnet on which the source virtual machine is located, then the replica virtual machine connects to that target subnet after failover.
  • 如果没有具有匹配名称的目标子网,则虚拟机连接到网络中的第一个子网。If there's no target subnet with a matching name, the virtual machine connects to the first subnet in the network.

为复制到辅助站点准备网络映射Prepare network mapping for replication to a secondary site

复制到辅助站点时,网络映射在源 VMM 服务器上的 VM 网络与目标 VMM 服务器上的 VM 网络之间进行映射。When you're replicating to a secondary site, network mapping maps between VM networks on a source VMM server, and VM networks on a target VMM server. 映射可执行以下操作:Mapping does the following:

  • 网络连接:在故障转移后将 VM 连接到适当的网络。Network connection—Connects VMs to appropriate networks after failover. 副本 VM 会连接到已映射到源网络的目标网络。The replica VM will be connected to the target network that's mapped to the source network.
  • 最佳 VM 放置:以最佳方式在 Hyper-V 主机服务器上放置副本 VM。Optimal VM placement—Optimally places the replica VMs on Hyper-V host servers. 副本 VM 放在可访问映射的 VM 网络的主机上。Replica VMs are placed on hosts that can access the mapped VM networks.
  • 无网络映射 - 如果未配置网络映射,则在故障转移后副本 VM 将不会连接到任何 VM 网络。No network mapping—If you don't configure network mapping, replica VMs won't be connected to any VM networks after failover.

网络映射的工作原理如下所述:Network mapping works as follows:

  • 可以在两个 VMM 服务器上的 VM 网络之间配置网络映射;如果两个站点由同一个服务器管理,则在可以在单个 VMM 服务器上的两个对应 VM 网络之间配置网络映射。Network mapping can be configured between VM networks on two VMM servers, or on a single VMM server if two sites are managed by the same server.
  • 在适当配置映射且启用复制后,主位置上的 VM 将连接到网络,目标位置上的副本将连接到其映射网络。When mapping is configured correctly and replication is enabled, a VM at the primary location will be connected to a network, and its replica at the target location will be connected to its mapped network.
  • 在 Site Recovery 中进行网络映射期间选择目标 VM 网络时,会显示使用源 VM 网络的 VMM 源云以及用于保护的目标云上的可用目标 VM 网络。When you select a target VM network during network mapping in Site Recovery, the VMM source clouds that use the source VM network will be displayed, along with the available target VM networks on the target clouds that are used for protection.
  • 如果目标网络具有多个子网,并且其中一个子网与源虚拟机所在的子网同名,则在故障转移后副本 VM 将连接到该目标子网。If the target network has multiple subnets and one of those subnets has the same name as the subnet on which the source virtual machine is located, then the replica VM will be connected to that target subnet after failover. 如果没有具有匹配名称的目标子网,则 VM 会连接到网络中的第一个子网。If there's no target subnet with a matching name, the VM will be connected to the first subnet in the network.

示例Example

以下示例演示了此机制。Here's an example to illustrate this mechanism. 我们来考察一个具有两个位置(北京和上海)的组织。Let's take an organization with two locations in Beijing and Shanghai.

位置Location VMM 服务器VMM server VM 网络VM networks 映射到Mapped to
北京Beijing VMM-BeijingVMM-Beijing VMNetwork1-BeijingVMNetwork1-Beijing 映射到 VMNetwork1-ShanghaiMapped to VMNetwork1-Shanghai
VMNetwork2-BeijingVMNetwork2-Beijing 未映射Not mapped
上海Shanghai VMM-ShanghaiVMM-Shanghai VMNetwork1-ShanghaiVMNetwork1-Shanghai 映射到 VMNetwork1-BeijingMapped to VMNetwork1-Beijing
VMNetwork2-ShanghaiVMNetwork2-Shanghai 未映射Not mapped

在本示例中:In this example:

  • 为连接到 VMNetwork1-Beijing 的任意 VM 创建的副本 VM 将连接到 VMNetwork1-Shanghai。When a replica VM is created for any VM that's connected to VMNetwork1-Beijing, it will be connected to VMNetwork1-Shanghai.
  • 为 VMNetwork2-Beijing 或 VMNetwork2-Shanghai 创建的副本 VM 不会连接到任何网络。When a replica VM is created for VMNetwork2-Beijing or VMNetwork2-Shanghai, it won't be connected to any network.

这是本示例组织中 VMM 云的设置方式,以及逻辑网络与云关联的方式。Here's how VMM clouds are set up in our example organization, and the logical networks associated with the clouds.

云保护设置Cloud protection settings

受保护的云Protected cloud 提供保护的云Protecting cloud 逻辑网络(北京) Logical network (Beijing)
GoldCloud1GoldCloud1 GoldCloud2GoldCloud2
SilverCloud1SilverCloud1 SilverCloud2SilverCloud2
GoldCloud2GoldCloud2

NANA

LogicalNetwork1-BeijingLogicalNetwork1-Beijing

LogicalNetwork1-ShanghaiLogicalNetwork1-Shanghai

SilverCloud2SilverCloud2

NANA

LogicalNetwork1-BeijingLogicalNetwork1-Beijing

LogicalNetwork1-ShanghaiLogicalNetwork1-Shanghai

逻辑和 VM 网络设置Logical and VM network settings

位置Location 逻辑网络Logical network 关联的 VM 网络Associated VM network
北京Beijing LogicalNetwork1-BeijingLogicalNetwork1-Beijing VMNetwork1-BeijingVMNetwork1-Beijing
上海Shanghai LogicalNetwork1-ShanghaiLogicalNetwork1-Shanghai VMNetwork1-ShanghaiVMNetwork1-Shanghai
LogicalNetwork2ShanghaiLogicalNetwork2Shanghai VMNetwork2-ShanghaiVMNetwork2-Shanghai

目标网络设置Target network settings

根据这些设置,选择目标 VM 网络时,下表显示将可用的选项。Based on these settings, when you select the target VM network, the following table shows the choices that will be available.

SelectSelect 受保护的云Protected cloud 提供保护的云Protecting cloud 可用目标网络Target network available
VMNetwork1-ShanghaiVMNetwork1-Shanghai SilverCloud1SilverCloud1 SilverCloud2SilverCloud2 可用Available
GoldCloud1GoldCloud1 GoldCloud2GoldCloud2 可用Available
VMNetwork2-ShanghaiVMNetwork2-Shanghai SilverCloud1SilverCloud1 SilverCloud2SilverCloud2 不可用Not available
GoldCloud1GoldCloud1 GoldCloud2GoldCloud2 可用Available

如果目标网络具有多个子网,并且其中一个子网与源虚拟机所在的子网同名,则在故障转移后副本虚拟机将连接到该目标子网。If the target network has multiple subnets and one of those subnets has the same name as the subnet on which the source virtual machine is located, then the replica virtual machine will be connected to that target subnet after failover. 如果没有具有匹配名称的目标子网,虚拟机将连接到网络中的第一个子网。If there's no target subnet with a matching name, the virtual machine will be connected to the first subnet in the network.

故障回复行为Failback behavior

若要了解在故障回复(反向复制)情况下会发生什么,让我们假设 VMNetwork1-Beijing 已映射到VMNetwork1-Shanghai,设置如下。To see what happens in the case of failback (reverse replication), let's assume that VMNetwork1-Beijing is mapped to VMNetwork1-Shanghai, with the following settings.

VMVM 连接 VM 网络Connected to VM network
VM1VM1 VMNetwork1-NetworkVMNetwork1-Network
VM2(VM1 的副本)VM2 (replica of VM1) VMNetwork1-ShanghaiVMNetwork1-Shanghai

在采用这些设置的条件下,我们看看在一些可能的方案中会发生什么情况。With these settings, let's review what happens in a couple of possible scenarios.

方案Scenario 结果Outcome
在故障转移后,VM-2 的网络属性没有发生任何变化。No change in the network properties of VM-2 after failover. VM-1 保持连接到源网络。VM-1 remains connected to the source network.
在故障转移后,VM-2 的网络属性发生变化,且连接断开。Network properties of VM-2 are changed after failover and is disconnected. VM-1 断开连接。VM-1 is disconnected.
VM-2 的网络属性在故障转移后发生更改并连接到 VMNetwork2-Shanghai。Network properties of VM-2 are changed after failover and is connected to VMNetwork2-Shanghai. 如果未映射 VMNetwork2-Shanghai,则 VM-1 将断开连接。If VMNetwork2-Shanghai isn't mapped, VM-1 will be disconnected.
VMNetwork1-Shanghai 的网络映射已更改。Network mapping of VMNetwork1-Shanghai is changed. VM-1 将连接到现已映射到 VMNetwork1-Shanghai 的网络。VM-1 will be connected to the network now mapped to VMNetwork1-Shanghai.

后续步骤Next steps

  • 了解在故障转移到辅助 VMM 站点后的 IP 寻址。Learn about IP addressing after failover to a secondary VMM site.
  • 了解在故障转移到 Azure 后的 IP 寻址。Learn about IP addressing after failover to Azure.