使用 Azure Site Recovery 保护 Azure Stack HCI VMProtect Azure Stack HCI VMs using Azure Site Recovery

适用于:Windows Server 2019Applies To: Windows Server 2019

Windows Admin Center 简化了在服务器或群集上复制虚拟机 (VM) 的过程,使得你能够从自己的数据中心利用 Azure 的功能。Windows Admin Center streamlines the process of replicating virtual machines (VMs) on your servers or clusters, giving you the power to take advantage of Azure from your own datacenter. 若要自动进行设置,请将 Windows Admin Center 连接到 Azure。To automate setup, you connect Windows Admin Center to Azure.

本文介绍了如何使用 Azure Site Recovery 来配置复制设置,以及如何在 Azure 门户中创建恢复计划。This article shows you how to use Azure Site Recovery to configure replication settings and create a recovery plan in the Azure portal. 完成这些任务后,Windows Admin Center 可以启动 VM 复制来保护 VM。Completing these tasks enables Windows Admin Center to start VM replication to protect your VMs. Azure Site Recovery 还保护物理服务器和群集节点。Azure Site Recovery also protects your physical servers and cluster nodes.

若要了解详细信息,请参阅将 Windows Server 连接到 Azure 混合服务To learn more, see Connecting Windows Server to Azure hybrid services.

Azure Site Recovery 如何与 Windows Admin Center 协同工作How Azure Site Recovery works with Windows Admin Center

Azure Site Recovery 是一项 Azure 服务,用于复制 VM 上运行的工作负荷,以便在发生灾难时保护业务关键基础结构。Azure Site Recovery is an Azure service that replicates workloads running on VMs so that your business-critical infrastructure is protected from a disaster. 若要了解详细信息,请参阅关于 Site RecoveryTo learn more, see About Site Recovery.

Azure Site Recovery 包括以下两个组件:复制和故障转移。Azure Site Recovery consists of two components: replication and failover. 复制部分通过将目标 VM 的 VHD 复制到 Azure 存储帐户,在发生灾难时保护你的 VM。The replication portion protects your VMs from disaster by replicating the target VM's VHD to an Azure storage account. 然后,当发生灾难时,你可以对 VM 进行故障转移并在 Azure 中运行它们。You can then fail over the VMs and run them in Azure in the event of a disaster. 你还可以执行不影响主要 VM 的测试性故障转移,在 Azure 中测试恢复过程。You can also do a test failover without impacting your primary VMs to test the recovery process in Azure.

要在发生灾难时保护你的 VM,单独完成复制组件的设置就足够了。Completing setup for the replication component alone is sufficient to protect your VMs from a disaster. 但是,在配置该过程的故障转移部分之前,无法在 Azure 中启动 VM。However, you can't start the VMs in Azure until you configure the failover portion of the process.

如果要故障转移到 Azure VM,可以设置故障转移部分;初始设置期间不需要进行此设置。You can set up the failover portion when you want to fail over to an Azure VM; it's not required during initial setup. 如果主机服务器发生故障,你可以在那时配置故障转移组件并访问受保护 VM 的工作负荷。If the host server goes down, you can configure the failover component at that time and access the workloads of the protected VM. 但是,我们建议在发生灾难之前配置与故障转移相关的设置。However, we recommend configuring the failover-related settings before a disaster.

先决条件和规划Prerequisites and planning

若要完成本文中的步骤,需要满足以下先决条件:The following is required to complete the steps in this article:

步骤 1:在目标主机上设置 VM 保护Step 1: Set up VM protection on your target host

在每个主机服务器或群集(其中包含要保护的 VM)上完成以下步骤一次:Complete the following steps once per host server or cluster containing the VMs that you want to target for protection:

  1. 在 Windows Admin Center 中的“所有连接”页面上,连接到承载着你要保护的 VM 的服务器或群集。In Windows Admin Center on the All connections page, connect to the server or cluster hosting the VMs that you want to protect.

  2. 在“工具”下,选择“虚拟机”,然后选择“清单”选项卡。Under Tools, select Virtual machines, and then select the Inventory tab.

  3. 选择任何 VM(不需要是你要保护的 VM)。Select any VM (it doesn't need to be the VM that you want to protect).

  4. 展开“更多”子菜单,然后选择“设置 VM 保护”。Expand the More submenu and then select Set up VM Protection.

    Windows Admin Center 中的“设置 VM 保护”子菜单选项。

  5. 登录到你的 Azure 帐户。Sign in to your Azure Account.

  6. 在“通过 Azure Site Recovery 设置主机”页面上输入所需信息,然后选择“设置”:On the Setting up host with Azure Site Recovery page, enter the required information, and then select Set up:

    • 订阅: 要用于此主机上的 VM 复制的 Azure 订阅。Subscription: The Azure subscription that you want to use for VM replication on this host.
    • 资源组: 一个新资源组名称。Resource Group: A new Resource Group name.
    • 恢复服务保管库: 此主机上受保护 VM 的 Azure Site Recovery 保管库的名称。Recovery Services Vault: A name for the Azure Site Recovery vault for the protected VMs on this host.
    • 位置: 应在其中创建 Azure Site Recovery 资源的 Azure 区域。Location: The Azure region where the Azure Site Recovery resources should be created.

    Windows Admin Center 中的“通过 Azure Site Recovery 设置主机”页面。

  7. 等待,直至看到通知:Site Recovery 设置已完成Wait until you see the notification: Site Recovery Setting Completed.

此过程最长可能需要 10 分钟。This process could take up to 10 minutes. 你可以转到“通知”(Windows Admin Center 右上角的钟形图标)来查看进度。You can watch the progress by going to Notifications (the bell icon at the top right of Windows Admin Center).

备注

此过程会自动在目标服务器或节点上安装 Azure Site Recovery 代理(如果你要配置群集),并使用指定的存储帐户保管库在指定的位置创建资源组This process automatically installs the Azure Site Recovery agent onto the target server or nodes (if you are configuring a cluster), and creates a Resource Group with the specified Storage Account and Vault, in the specified Location. 它还向 Azure Site Recovery 服务注册目标主机并配置默认的复制策略。It also registers the target host with the Azure Site Recovery service and configures a default replication policy.

步骤 2:选择要保护的 VMStep 2: Select VMs to protect

完成以下步骤来保护你的 VM:Complete the following steps to protect your VMs:

  1. 在 Windows Admin Center 中,返回到你在上一个任务中配置的服务器或群集。In Windows Admin Center, return to the server or cluster that you configured in the previous task.

  2. 在“工具”下,选择“虚拟机”,然后选择“清单”选项卡。Under Tools, select Virtual machines, and then select the Inventory tab.

  3. 选择要保护的 VM,展开“更多”子菜单,然后选择“保护 VM”。Select the VM that you want to protect, expand the More submenu, and then select Protect VM.

    Windows Admin Center 中的“保护 VM”设置选项。

  4. 查看保护 VM 时的容量要求。Review capacity requirements for protecting the VM. 有关详细信息,请参阅为 Hyper-V VM 灾难恢复规划容量For more information, see Plan capacity for Hyper-V VM disaster recovery.

    如果要使用高级存储帐户,请在 Azure 门户中创建一个。If you want to use a premium storage account, create one in the Azure portal. 若要了解详细信息,请参阅 Azure 有哪些可用的磁盘类型?中的“高级 SSD”部分To learn more, see the Premium SSD section of What disk types are available in Azure? Windows Admin Center 中提供的“新建”选项将创建一个标准存储帐户。The Create New option provided in Windows Admin Center creates a standard storage account.

  5. 输入要用于此 VM 的复制的存储帐户的名称,然后选择“保护 VM”,为 VM 启用复制。Enter the name of the Storage Account to use for this VM's replication, and then select Protect VM to enable replication for the VM.

    在 Windows Admin Center 中定义 Azure Site Recovery 的存储帐户来保护 VM。

    Azure Site Recovery 启动复制过程。Azure Site Recovery starts the replication process. 如果“虚拟机清单”网格的“受保护”列中的值变为“是”,则 VM 受保护。 The VM is protected when the value in the Protected column of the Virtual Machine Inventory grid changes to Yes. 此过程可能需要几分钟时间。This process could take several minutes.

步骤 3:在 Azure 门户中配置并运行测试性故障转移Step 3: Configure and run a test failover in the Azure portal

在开始 VM 复制之前,不需要完成此步骤。It's not required to complete this step before starting VM replication. VM 仅由复制提供保护。The VM is protected with only replication. 但是,我们建议在设置 Azure Site Recovery 时配置故障转移设置。However, we recommend configuring failover settings when you set up Azure Site Recovery.

请完成以下步骤来准备到 Azure VM 的故障转移:Complete the following steps to prepare failover to an Azure VM:

  1. 设置一个 Azure 网络,以便已进行故障转移的虚拟机将其附加到此 VNET。Set up an Azure network that the failed-over VM will attach to this VNET. 若要了解详细信息,请参阅设置从本地 Hyper-V VM 到 Azure 的灾难恢复To learn more, see Set up disaster recovery of on-premises Hyper-V VMs to Azure.

    备注

    Windows Admin Center 会自动完成此资源中的步骤。Windows Admin Center automatically completes the steps in this resource. 你只需要设置 Azure 网络。You only need to set up the Azure network.

  2. 运行测试性故障转移。Run a test failover. 若要了解详细信息,请参阅运行到 Azure 的灾难恢复演练To learn more, see Run a disaster recovery drill to Azure.

步骤 4:创建恢复计划Step 4: Create recovery plans

Azure Site Recovery 中的恢复计划使你能够对整个应用程序的 VM 集合进行故障转移和恢复。Recovery plans in Azure Site Recovery enable you to fail over and recover an entire application's collection of VMs. 可以单独恢复受保护的 VM。It's possible to recover protected VMs individually. 但更好的方法是将应用程序的 VM 添加到恢复计划中。But a better way is to add the VMs of an application to your recovery plan. 然后,可以通过恢复计划对整个应用程序进行故障转移。You can then fail over the entire application through the recovery plan. 你还可以使用恢复计划的测试性故障转移功能来测试应用程序的恢复。You can also use the test failover feature of a recovery plan to test the recovery of the application.

使用恢复计划,你可以对 VM 进行分组,按顺序排好它们在故障转移期间的启动顺序,以及自动执行其他恢复步骤。Recovery plans let you group VMs, sequence the order in which they should start during a failover, and automate additional recovery steps. 在保护 VM 后,你可以在 Azure 门户中转到 Azure Site Recovery 保管库,为 VM 创建恢复计划。After you've protected your VMs, you can go to the Azure Site Recovery vault in the Azure portal to create recovery plans for them. 若要了解详细信息,请参阅创建和自定义恢复计划To learn more, see Create and customize recovery plans.

步骤 5:监视 Azure 中的已复制 VMStep 5: Monitor replicated VMs in Azure

若要确认在服务器注册过程中没有出现故障,请转到 Azure 门户,依次选择“所有资源”、“恢复服务保管库”、“作业”和“Site Recovery 作业”。To verify no failures in the server registration process, go to the Azure portal, select All resources, select Recovery Services Vault, select Jobs, and then select Site Recovery Jobs. “恢复服务保管库”名称是在本文第一个任务的步骤 6 中指定的名称。The Recovery Services Vault name is the one that you specified in Step 6 of the first task in this article.

若要监视 VM 复制,请转到“恢复服务保管库”,然后转到“复制的项”。To monitor VM replication, go to the Recovery Services Vault, and then Replicated Items.

若要查看已注册到保管库的所有服务器,请转到“恢复服务保管库”、“Site Recovery 基础结构”,然后转到“Hyper-V 主机”(在“Hyper-V 站点”部分下)。To see all servers that are registered to the vault, go to Recovery Services Vault, Site Recovery Infrastructure, and then Hyper-V hosts (under the Hyper-V sites section).

已知问题Known issue

向群集注册 Azure Site Recovery 时,如果节点无法安装 Azure Site Recovery 或无法注册 Azure Site Recovery 服务,则无法保护你的 VM。When you register Azure Site Recovery with a cluster, if a node either fails to install Azure Site Recovery or register the Azure Site Recovery service, your VMs may not be protected. 若要在 Azure 门户中验证是否已注册群集中的所有节点,请依次转到“恢复服务保管库”、“作业”和“Site Recovery 作业”。To verify all nodes in the cluster are registered in the Azure portal, go to the Recovery Services vault, Jobs, and then Site Recovery Jobs.

后续步骤Next steps

有关 Azure Site Recovery 的详细信息,另请参阅:For more information about Azure Site Recovery, see also: