设置 VMM 云中的本地 Hyper-V VM 到 Azure 的灾难恢复Set up disaster recovery of on-premises Hyper-V VMs in VMM clouds to Azure

本教程介绍如何使用 Azure Site Recovery 为 System Center Virtual Machine Manager (VMM) 管理的本地 Hyper-V 虚拟机 (VM) 启用到 Azure 的复制。This tutorial describes how to enable replication for on-premises Hyper-V virtual machines (VM) managed by System Center Virtual Machine Manager (VMM) to Azure using Azure Site Recovery. 如果未使用 VMM,则按照此教程进行操作。If you aren't using VMM, follow this tutorial.

在本教程中,你将了解如何执行以下操作:In this tutorial, you learn how to:

  • 选择复制源和目标。Select your replication source and target.
  • 设置源复制坏境,包括本地 Site Recovery 组件和目标复制环境。Set up the source replication environment, including on-premises Site Recovery components and the target replication environment.
  • 在 VMM VM 网络与 Azure 虚拟网络之间设置网络映射。Set up network mapping between VMM VM networks and Azure virtual networks.
  • 创建复制策略。Create a replication policy.
  • 为 VM 启用复制。Enable replication for a VM.

备注

教程介绍了某个方案的最简单部署路径。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 articles in the How-to Guides section of the Site Recovery documentation.

先决条件Prerequisites

本教程假设你已完成以下教程:This tutorial assumes that you already completed the following tutorials:

  1. 准备 AzurePrepare Azure
  2. 准备本地 Hyper-V 服务器Prepare on-premises Hyper-V servers

选择复制目标Select a replication goal

  1. 在 Azure 门户中转到“恢复服务保管库”,选择在准备 Azure 教程中创建的 ContosoVMVault 保管库。In the Azure portal, go to Recovery Services vaults and select the ContosoVMVault vault that was created in the Prepare Azure tutorial.

  2. 从“开始”中,选择“Site Recovery” > “准备基础结构”并配置以下设置: From Getting Started, select Site Recovery > Prepare Infrastructure and configure the following settings:

    1. 对于“保护目标” > “计算机位于何处?”,请选择“本地”。 Protection goal > Where are your machines located?, select On-premises.
    2. 对于“要将计算机复制到何处?”,请选择“复制到 Azure”。 Where do you want to replicate your machines?, select To Azure.
    3. 对于“计算机是否已虚拟化?”,请选择“是,带有 Hyper-V”。 Are your machines virtualized?, select Yes, with Hyper-V.
    4. 对于“是否使用 System Center VMM 管理 Hyper-V 主机?”,请选择“是”。 Are you using System Center VMM to manage your Hyper-V hosts?, select Yes.
  3. 选择“确定”。Select OK.

    复制目标

确认部署规划Confirm deployment planning

  1. 在“部署规划”中,若要规划大型部署,请通过页面上的链接下载适用于 Hyper-V 的部署规划器。In Deployment planning, if you're planning a large deployment, download the Deployment Planner for Hyper-V from the link on the page. 详细了解 Hyper-V 部署规划。Learn more about Hyper-V deployment planning.
  2. 本教程不需要使用部署规划器。For this tutorial, we don't need the Deployment Planner. 在“是否已完成部署规划?”中选择“我将稍后进行”,然后选择“确定”。In Have you completed deployment planning?, select I will do it later, and then select OK.

设置源环境Set up the source environment

设置源环境时,将在 VMM 服务器上安装 Azure Site Recovery 提供程序,并在保管库中注册该服务器。When you set up the source environment, you install the Azure Site Recovery Provider on the VMM server and register the server in the vault. 在每台 Hyper-V 主机上安装 Azure 恢复服务代理。You install the Azure Recovery Services agent on each Hyper-V host.

  1. 准备基础结构Prepare Infrastructure. 选择“源”。Select Source.

  2. 准备源Prepare source. 选择“+ VMM”以添加 VMM 服务器。Select + VMM to add a VMM server. 在“添加服务器”中,检查“服务器类型”中是否已显示“System Center VMM 服务器” 。In Add Server, check that System Center VMM server appears in Server type.

  3. 下载 Azure Site Recovery 提供程序的安装程序。Download the installer for the Azure Site Recovery Provider.

  4. 下载保管库注册密钥。Download the vault registration key. 运行提供程序安装程序时需要此密钥。You need this key when you run the Provider setup. 生成的密钥有效期为 5 天。The key is valid for five days after you generate it.

  5. 下载 Azure 恢复服务代理的安装程序。Download the installer for the Azure Recovery Services agent.

    复制目标

安装 VMM 服务器上的提供程序Install the Provider on the VMM server

  1. 在 Azure Site Recovery 提供程序安装向导中,选择“Microsoft 更新”。In the Azure Site Recovery Provider Setup wizard Microsoft Update. 选择使用“Microsoft 更新”来检查提供程序更新。Opt in to use Microsoft Update to check for Provider updates.
  2. 安装Installation. 接受提供程序的默认安装位置,然后选择“安装”。Accept the default installation location for the Provider and select Install.
  3. 安装后,在 Azure Site Recovery 注册向导中依次选择“保管库设置”和“浏览”,然后在“密钥文件”中选择下载的保管库密钥文件 。After installation, in the Azure Site Recovery Registration Wizard select Vault Settings, Browse, and in Key file, select the vault key file that you downloaded.
  4. 指定 Azure Site Recovery 订阅和保管库名称 (ContosoVMVault)。Specify the Azure Site Recovery subscription, and the vault name (ContosoVMVault). 为 VMM 服务器指定友好名称以在保管库中标识此 VMM。Specify a friendly name for the VMM server, to identify it in the vault.
  5. 代理设置Proxy Settings. 选择“在不使用代理的情况下直接连接到 Azure Site Recovery”。Select Connect directly to Azure Site Recovery without a proxy.
  6. 接受用于加密数据的证书的默认位置。Accept the default location for the certificate that's used to encrypt data. 故障转移时,会解密已加密的数据。Encrypted data will be decrypted when you fail over.
  7. 同步云元数据Synchronize cloud metadata. 选择“将云元数据同步到 Site Recovery 门户”。Select Sync cloud meta data to Site Recovery portal. 在每台服务器上只需执行此操作一次。This action needs to happen only once on each server. 然后,选择“注册”。Then, select Register.
  8. 服务器在保管库中注册后,选择“完成”。After the server is registered in the vault, select Finish.

完成注册后,Azure Site Recovery 将检索服务器中的元数据,该 VMM 服务器显示在“Site Recovery 基础结构”中。After registration finishes, metadata from the server is retrieved by Azure Site Recovery and the VMM server is displayed in Site Recovery Infrastructure.

在 Hyper-V 主机上安装恢复服务代理Install the Recovery Services agent on Hyper-V hosts

在包含要复制的 VM 的每台 Hyper-V 主机上安装代理。Install the agent on each Hyper-V host containing VMs that you want to replicate.

在 Microsoft Azure 恢复服务代理安装程序向导中配置以下设置:In the Microsoft Azure Recovery Services Agent Setup Wizard, configure these settings:

  1. 先决条件检查Prerequisites Check. 选择“下一页”。Select Next. 系统会自动安装任何缺少的必备组件。Any missing prerequisites will be installed automatically.

  2. 安装设置Installation Settings. 接受安装位置。Accept the installation location. 然后,选择“安装”。Then, select Install.

    备注

    对于 Azure Site Recovery,不需要缓存位置。For Azure Site Recovery, Cache Location is not required.

  3. 安装Installation. 安装完成后,选择“关闭”以完成向导。When the installation finishes, select Close to finish the wizard.

    复制目标

设置目标环境Set up the target environment

  1. 选择“准备基础结构” > “目标”。 Select Prepare infrastructure > Target.
  2. 选择在故障转移后要在其中创建 Azure VM 的订阅和资源组 (ContosoRG)。Select the subscription and the resource group (ContosoRG) in which the Azure VMs will be created after failover.
  3. 选择“资源管理器”部署模型。Select the Resource Manager deployment model.

Site Recovery 会检查是否有一个或多个兼容的 Azure 存储帐户和网络。Site Recovery checks that there's one or more compatible Azure storage accounts and networks.

配置网络映射Configure network mapping

  1. Site Recovery 基础结构 > 网络映射 > 网络映射Site Recovery Infrastructure > Network mappings > Network Mapping. 选择“+网络映射”图标。Select the +Network Mapping icon.

  2. 添加网络映射Add network mapping. 选择“源 System Center VMM”服务器。Select the Source System Center VMM server. 对于“区域”,请选择“Azure”。For the Target, select Azure.

  3. 在故障转移后,验证订阅和部署模型。Verify the subscription and the deployment model after failover.

  4. 源网络Source network. 选择源本地 VM 网络。Select the source on-premises VM network.

  5. 目标网络Target network. 选择在故障转移后创建副本 Azure VM 时,这些 VM 所在的 Azure 网络。Select the Azure network in which replica Azure VMs will be located when they're created after failover. 选择“确定”。Then, select OK.

    复制目标

设置复制策略Set up a replication policy

  1. 选择“准备基础结构” > “复制设置” > “+创建和关联”。Select Prepare infrastructure > Replication Settings > +Create and associate.
  2. 在“创建和关联策略”中指定策略名称。In Create and associate policy, specify a policy name. 我们将使用 ContosoReplicationPolicyWe're using ContosoReplicationPolicy.
  3. 接受默认设置,然后选择“确定”。Accept the default settings and select OK:
    • “复制频率”指示在完成初始复制后,将每隔五分钟复制一次增量数据。Copy frequency indicates that, after initial replication, delta data will replicate every five minutes.
    • “恢复点保留期”指示每个恢复点将保留两小时。Recovery point retention indicates that each recovery point will be retained for two hours.
    • 应用一致性快照频率指示每小时创建一次包含应用一致性快照的恢复点。App-consistent snapshot frequency indicates that recovery points containing app-consistent snapshots will be created every hour.
    • “初始复制开始时间”指示初始复制会立即开始。Initial replication start time indicates that initial replication will start immediately.
    • “加密 Azure 上存储的数据”设置为默认值(“关闭”),指示不会加密 Azure 中的静态数据。 Encrypt data stored on Azure is set to the default (Off) and indicates that at-rest data in Azure isn't encrypted.
  4. 创建策略后,选择“确定”。After the policy is created, select OK. 创建新策略时,该策略将自动关联到 VMM 云。When you create a new policy, it's automatically associated with the VMM cloud.

启用复制Enable replication

  1. 复制应用程序Replicate application. 选择“源”。Select Source.

  2. Source. 选择 VMM 云。Select the VMM cloud. 选择“确定”。Then, select OK.

  3. 目标Target. 验证目标 (Azure) 和保管库订阅,然后选择“资源管理器”模型。Verify the target (Azure), the vault subscription, and select the Resource Manager model.

  4. 选择“contosovmsacct1910171607”存储帐户和“ContosoASRnet”Azure 网络。 Select the contosovmsacct1910171607 storage account and the ContosoASRnet Azure network.

  5. 虚拟机 > 选择Virtual machines > Select. 选择要复制的 VM。Select the VM that you want to replicate. 选择“确定”。Then, select OK.

    可以在“作业” > “Site Recovery 作业”中,跟踪“启用保护”操作的进度。You can track progress of the Enable Protection action in Jobs > Site Recovery jobs. “最后完成保护”作业完成后,初始复制即已完成,VM 可执行故障转移。After the Finalize Protection job finishes, the initial replication is complete, and the VM is ready for failover.

后续步骤Next steps