Replicate Azure virtual machines running Storage Spaces Direct to another region

This article describes how to enable disaster recovery for Azure virtual machines running Storage Spaces Direct.

Note

Only crash-consistent recovery points are supported for Storage Spaces Direct clusters.

Storage Spaces Direct (S2D) is software-defined storage, which provides a way to create guest clusters on Azure. A guest cluster in Azure is a failover cluster comprised of IaaS virtual machines. It allows hosted virtual machine workloads to fail over across guest clusters, achieving higher availability SLA for applications than a single Azure virtual machine can provide. It is useful in scenarios where a virtual machine hosts a critical application like SQL or scale-out file server.

Disaster recovery with Storage Spaces Direct

In a typical scenario, you use virtual machines in a guest cluster on Azure to provide higher resiliency for your application, such as a scale-out file server. While this configuration provides higher availability for your application, you also want to protect these applications by using Site Recovery for any region level failure. 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.

The following diagram shows a two-node Azure virtual machine failover cluster using Storage Spaces Direct.

Screenshot of storage spaces.

  • Two Azure virtual machines in a Windows Failover Cluster and each virtual machine has two or more data disks.
  • S2D synchronizes the data on the data disk and presents the synchronized storage as a storage pool.
  • The storage pool presents as a cluster shared volume (CSV) to the failover cluster.
  • The Failover cluster uses the CSV for the data drives.

Disaster recovery considerations

  1. When you set up a cloud witness for the cluster, keep the witness in the disaster recovery region.
  2. If you fail over the virtual machines to the subnet in the disaster recovery region, which is different from the source region, you need to change the cluster IP address after failover. To change the IP of the cluster, use the Site Recovery recovery plan script.

Enable Site Recovery for S2D cluster

  1. Inside the recovery services vault, select +replicate.

  2. 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.

    Screenshot that shows where to configure replication settings.

  5. Go to replicated items and you can see both the virtual machine status.

  6. Both the virtual machines are getting protected and are also shown as part of multi-VM consistency group.

    Screenshot that shows the virtual machines are protected and a part of a multi-VM consistency group.

Create 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. 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.

Add virtual machines to failover groups

  1. Create a recovery plan by adding the virtual machines.
  2. Select Customize to group the virtual machines. By default, all virtual machines are part of Group 1.

Add scripts to the recovery plan

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. For example, here we are attaching load balancer and changing cluster IP.

Failover of the virtual machines

You need to fail over both nodes of the virtual machines by using the Site Recovery recovery plan.

Screenshot showing storagespacesdirect protection.

Run a test failover

  1. In the Azure portal, select your Recovery Services vault.
  2. Select the recovery plan that you created.
  3. Select Test Failover.
  4. 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.

For more information, see Test failover to Azure in Site Recovery.

Run a failover

  1. In the Azure portal, select your Recovery Services vault.
  2. Select the recovery plan that you created for SAP applications.
  3. Select Failover.
  4. To start the failover process, select the recovery point.

For more information, see Failover in Site Recovery.

Next steps