管理用于本地到 Azure 灾难恢复的虚拟机网络接口Manage virtual machine network interfaces for on-premises disaster recovery to Azure

Azure 中的虚拟机 (VM) 必须附加有至少一个网络接口。A virtual machine (VM) in Azure must have at least one network interface attached to it. 它可以附加 VM 的大小所能够支持的网络接口数量。It can have as many network interfaces attached to it as the VM size supports.

默认情况下,Azure 虚拟机上附加的第一个网络接口定义为主网络接口。By default, the first network interface attached to an Azure virtual machine is defined as the primary network interface. 虚拟机中的所有其他网络接口为辅助网络接口。All other network interfaces in the virtual machine are secondary network interfaces. 默认情况下,来自虚拟机的所有出站流量都是通过分配给主网络接口的主 IP 配置的 IP 地址发出的。Also by default, all outbound traffic from the virtual machine is sent out the IP address that's assigned to the primary IP configuration of the primary network interface.

在本地环境中,虚拟机或服务器可针对环境中的不同网络具有多个网络接口。In an on-premises environment, virtual machines or servers can have multiple network interfaces for different networks within the environment. 不同的网络通常用于执行特定操作,如升级、维护和访问 internet。Different networks are typically used for performing specific operations such as upgrades, maintenance, and internet access. 当从本地环境迁移或故障转移到 Azure 时,请记住,同一虚拟机中的网络接口必须全部连接到同一虚拟网络。When you're migrating or failing over to Azure from an on-premises environment, keep in mind that network interfaces in the same virtual machine must all be connected to the same virtual network.

默认情况下,Azure Site Recovery 在 Azure 虚拟机上创建的网络接口数量与连接到本地服务器的网络接口数量相同。By default, Azure Site Recovery creates as many network interfaces on an Azure virtual machine as are connected to the on-premises server. 通过编辑复制的虚拟机设置下的网络接口设置,可避免在迁移或故障转移过程中创建冗余网络接口。You can avoid creating redundant network interfaces during migration or failover by editing the network interface settings under the settings for the replicated virtual machine.

选择目标网络Select the target network

对于 VMware 和物理机,以及 Hyper-V(不带 System Center Virtual Machine Manager)虚拟机,可为单个虚拟机指定目标虚拟网络。For VMware and physical machines, and for Hyper-V (without System Center Virtual Machine Manager) virtual machines, you can specify the target virtual network for individual virtual machines. 对于带 Virtual Machine Manager 的 Hyper-V 虚拟机,使用网络映射映射某个源 Virtual Machine Manager 服务器上的 VM 网络,并以 Azure 网络为定向目标。For Hyper-V virtual machines managed with Virtual Machine Manager, use network mapping to map VM networks on a source Virtual Machine Manager server and target Azure networks.

  1. 在恢复服务保管库中的“复制的项” 下,选择任何复制的项以访问其设置。Under Replicated items in a Recovery Services vault, select any replicated item to access the settings for that replicated item.

  2. 选择“计算和网络” 选项卡可访问复制项目的网络设置。Select the Compute and Network tab to access the network settings for the replicated item.

  3. 在“网络属性” 下,从可用网络接口的列表中选择虚拟网络。Under Network properties, choose a virtual network from the list of available network interfaces.

    网络设置

修改目标网络会影响该特定虚拟机的所有网络接口。Modifying the target network affects all network interfaces for that specific virtual machine.

对于 Virtual Machine Manager 云,修改网络映射会影响所有虚拟机及其网络接口。For Virtual Machine Manager clouds, modifying network mapping affects all virtual machines and their network interfaces.

选择目标接口类型Select the target interface type

在“计算和网络”窗格中的“网络接口”部分下,可查看和编辑网络接口设置。Under the Network interfaces section of the Compute and Network pane, you can view and edit network interface settings. 还可指定目标网络接口类型。You can also specify the target network interface type.

  • 故障转移需使用主网络接口 。A Primary network interface is required for failover.
  • 所有其他选定的网络接口(若有)为“辅助” 网络接口。All other selected network interfaces, if any, are Secondary network interfaces.
  • 选择“不使用” 以避免在故障转移时创建某个网络接口。Select Do not use to exclude a network interface from creation at failover.

默认情况下,启用复制时,Site Recovery 会选择本地服务器上所有检测到的网络接口。By default, when you're enabling replication, Site Recovery selects all detected network interfaces on the on-premises server. 它会将其中一个标记为“主要” ,所有其他的标记为“辅助” 。It marks one as Primary and all others as Secondary. 本地服务器上后续添加的任何接口均默认标记为“不使用” 。Any subsequent interfaces added on the on-premises server are marked Do not use by default. 添加更多网络接口时,请确保选择正确的 Azure 虚拟机目标大小,以确保可容纳所有所需的网络接口。When you're adding more network interfaces, ensure that the correct Azure virtual machine target size is selected to accommodate all required network interfaces.

修改网络接口设置Modify network interface settings

可修改复制项网络接口的子网和 IP 地址。You can modify the subnet and IP address for a replicated item's network interfaces. 如果未指定 IP 地址,则 Site Recovery 会在故障转移时将下一个可用 IP 地址从子网分配到网络接口。If an IP address is not specified, Site Recovery will assign the next available IP address from the subnet to the network interface at failover.

  1. 选择任何可用的网络接口以打开网络接口设置。Select any available network interface to open the network interface settings.

  2. 从可用子网的列表中选择所需子网。Choose the desired subnet from the list of available subnets.

  3. 输入所需 IP 地址(根据需要)。Enter the desired IP address (as required).

    网络接口设置

  4. 选择“确定” 以完成编辑,然后返回“计算和网络” 窗格。Select OK to finish editing and return to the Compute and Network pane.

  5. 为其他网络接口重复步骤 1-4。Repeat steps 1-4 for other network interfaces.

  6. 选择“保存” ,保存全部更改。Select Save to save all changes.

后续步骤Next steps

深入了解 Azure 虚拟机的网络接口。Learn more about network interfaces for Azure virtual machines.