将运行存储空间直通的 Azure VM 复制到另一区域Replicate Azure VMs running Storage Spaces Direct to another region

本文介绍了如何为运行存储空间直通的 Azure VM 启用灾难恢复。This article describes how to enable disaster recovery of Azure VMs running storage spaces direct.

备注

存储空间直通群集仅支持故障一致恢复点。Only crash consistent recovery points are supported for storage spaces direct clusters.

存储空间直通 (S2D) 是软件定义的存储,可便于在 Azure 上创建来宾群集Storage spaces direct (S2D) is software-defined storage, which provides a way to create guest clusters on Azure. Azure 中的来宾群集是由 IaaS VM 组成的故障转移群集。A guest cluster in Azure is a failover cluster comprised of IaaS VMs. 这样一来,托管的 VM 工作负载可以跨来宾群集进行故障转移,从而实现更高的应用程序可用性 SLA(与单一 Azure VM 相比)。It allows hosted VM workloads to fail over across guest clusters, achieving higher availability SLA for applications, than a single Azure VM can provide. 它适用于 VM 托管关键应用程序(如 SQL 或横向扩展文件服务器)的方案。It is useful in scenarios where a VM hosts a critical application like SQL or scale-out file server.

利用存储空间直通进行灾难恢复Disaster recovery with storage spaces direct

在典型方案中,为了提高横向扩展文件服务器等应用程序的复原能力,可能会在 Azure 上使用虚拟机来宾群集。In a typical scenario, you may have virtual machines guest cluster on Azure for higher resiliency of your application like Scale out file server. 虽然这样可以提高应用程序可用性,但仍希望使用 Site Recovery 保护这些应用程序免受任何区域级别故障。While this can provide your application higher availability, you would like to protect these applications using Site Recovery for any region level failure. 发生故障转移时,Site Recovery 将数据从一个 Azure 区域复制到另一个 Azure 区域,并调出灾难恢复区域中的群集。Site Recovery replicates the data from one region to another Azure region and brings up the cluster in disaster recovery region in an event of failover.

下图展示了一个使用存储空间直通的双节点 Azure VM 故障转移群集。Below diagram shows a two-node Azure VM failover cluster using storage spaces direct.

storagespacesdirect

  • Windows 故障转移群集中有两个 Azure 虚拟机,每个虚拟机都有两个或多个数据磁盘。Two Azure virtual machines in a Windows Failover Cluster and each virtual machine have two or more data disks.
  • S2D 同步数据磁盘上的数据,并以存储池的形式提供同步的存储。S2D synchronizes the data on the data disk and presents the synchronized storage as a storage pool.
  • 存储池作为群集共享卷 (CSV) 提供给故障转移群集。The storage pool presents as a cluster shared volume (CSV) to the failover cluster.
  • 故障转移群集对数据驱动器使用 CSV。The Failover cluster uses the CSV for the data drives.

灾难恢复注意事项Disaster Recovery Considerations

  1. 为群集设置云见证时,请让见证一直位于灾难恢复区域中。When you are setting up cloud witness for the cluster, keep witness in the Disaster Recovery region.
  2. 若要将虚拟机故障转移到与源区域不同的 DR 区域上的子网,那么需要在执行故障转移后更改群集 IP 地址。If you are going to fail over the virtual machines to the subnet on the DR region which is different from the source region then cluster IP address needs to be change after failover. 必须使用 Site Recovery 恢复计划脚本,才能更改群集 IP。To change IP of the cluster you need to use the Site Recovery recovery plan script.
    示例脚本使用自定义脚本扩展在 VM 中执行命令Sample script to execute command inside VM using custom script extension

为 S2D 群集启用 Site Recovery:Enabling Site Recovery for S2D cluster:

  1. 在恢复服务保管库中,单击“+复制”Inside the recovery services vault, click "+replicate"

  2. 选择群集中的所有节点,并将它们归入多 VM 一致性组Select all the nodes in the cluster and make them part of a Multi-VM consistency group

  3. 选择复制策略,同时禁用应用程序一致性*(仅支持故障一致性)Select replication policy with application consistency off* (only crash consistency support is available)

  4. 启用复制Enable the replication

    storagespacesdirect 保护

  5. 转到已复制的项,可以看到两个虚拟机的状态。Go to replicated items and you can see both the virtual machine status.

  6. 两个虚拟机均受到保护,并显示为属于多 VM 一致性组。Both the virtual machines are getting protected and are also shown as part of multi-VM consistency group.

    storagespacesdirect 保护

创建恢复计划Creating a recovery plan

恢复计划支持在故障转移期间将多层应用程序中的各个层排序。A recovery plan supports the sequencing of various tiers in a multi-tier application during a failover. 排序有助于保持应用程序一致性。Sequencing helps maintain application consistency. 为多层 Web 应用程序创建恢复计划时,请完成使用 Site Recovery 创建恢复计划中所述的步骤。When you create a recovery plan for a multi-tier web application, complete the steps described in Create a recovery plan by using Site Recovery.

将虚拟机添加到故障转移组Adding virtual machines to failover groups

  1. 通过添加虚拟机来创建恢复计划。Create a recovery plan by adding the virtual machines.
  2. 单击“自定义”将 VM 分组。Click on 'Customize' to group the VMs. 默认情况下,所有 VM 属于“组 1”。By default, all VMs are part of 'Group 1'.

将脚本添加到恢复计划Add scripts to the recovery plan

在故障转移后或测试故障转移期间,可能需要在 Azure 虚拟机上执行一些操作才能让应用程序正常工作。For your applications to function correctly, you might need to do some operations on the Azure virtual machines after the failover or during a test failover. 可将某些故障转移后的操作自动化。You can automate some post-failover operations. 例如,此时将附加负载均衡器,并更改群集 IP。For example, here we are attaching load balancer and changing cluster IP.

虚拟机故障转移Failover of the virtual machines

VM 的两个节点都需要使用 Site Recovery 恢复计划进行故障转移Both the nodes of the VMs need to be fail over using the Site Recovery recovery plan

storagespacesdirect 保护

运行测试故障转移Run a test failover

  1. 在 Azure 门户中,选择恢复服务保管库。In the Azure portal, select your Recovery Services vault.
  2. 选择已创建的恢复计划。Select the recovery plan that you created.
  3. 选择“测试故障转移” 。Select Test Failover.
  4. 若要启动测试故障转移过程,请选择恢复点和 Azure 虚拟网络。To start the test failover process, select the recovery point and the Azure virtual network.
  5. 当辅助环境启动时,执行验证。When the secondary environment is up, perform validations.
  6. 完成验证后,选择“清理测试故障转移”清理测试故障转移环境。 When validations are complete, to clean the failover environment, select Cleanup test failover.

有关详细信息,请参阅在 Site Recovery 中执行到 Azure 的测试故障转移For more information, see Test failover to Azure in Site Recovery.

运行故障转移Run a failover

  1. 在 Azure 门户中,选择恢复服务保管库。In the Azure portal, select your Recovery Services vault.
  2. 选择针对 SAP 应用程序创建的恢复计划。Select the recovery plan that you created for SAP applications.
  3. 选择“故障转移”。 Select Failover.
  4. 若要启动故障转移过程,请选择恢复点。To start the failover process, select the recovery point.

有关详细信息,请参阅 Site Recovery 中的故障转移For more information, see Failover in Site Recovery.

后续步骤Next steps

详细了解如何运行故障回复。Learn more about running failback.