How to Configure Storage Replica in Windows Server 2019

Last weeks i work with different solution in Storage Replication. Until now for a File Servers we use DFS-R as Disaster Recovery Solution.

But Windows Server 2016 launch a new feature as Storage Replica.

Until now i didn't use it for lot of reasons but it's time to test how is working and which scenarios can replace it with DFSR.

To be honest DFS Replication designed on low bandwidth networks which give a good solution in networks with high latency. However has big disadvantages like:

  • It doesn't replicate in-use or open files.
  • It doesn't replicate synchronously.
  • Its asynchronous replication latency can be many minutes, hours, or even days.
  • It relies on a database that can require lengthy consistency checks after a power interruption. This can be a big issue in specific scenarios
  • Allows changes to flow in both directions that can overwrite data when  you use it to replicate File Servers in multiple branches.

From the other base on Microsoft Docs Storage Replica hasn't any of these disadvantages but maybe it doesn't suitable for any environment.

  • It only allows one-to-one replication between volumes. It's possible to replicate different volumes between multiple servers.
  • While it supports asynchronous replication, it's not designed for low bandwidth, high latency networks.
  • It doesn't allow user access to the protected data on the destination while replication is ongoing

Another one important factor that you must know for the Storage Replica is what replication types support.

  • Synchronous replication mirrors data within a low-latency network site with crash-consistent volumes to ensure zero data loss at the file-system level during a failure.
  • Asynchronous replication mirrors data across sites beyond metropolitan ranges over network links with higher latencies, but without a guarantee that both sites have identical copies of the data at the time of a failure.

Let's practice , test and learn to be sure where can use Storage Replica or where can leave DFS-R

 

Prerequisites

Before start to use Replica Storage you must read very careful all the prerequisites base on Microsoft Docs Storage Replica overview

  • Active Directory Domain Services forest.
  • Storage Spaces with SAS JBODs, Storage Spaces Direct, fibre channel SAN, shared VHDX, iSCSI Target, or local SAS/SCSI/SATA storage. SSD or faster recommended for replication log drives. Microsoft recommends that the log storage be faster than the data storage. Log volumes must never be used for other workloads.
  • At least one ethernet/TCP connection on each server for synchronous replication, but preferably RDMA.
  • At least 2GB of RAM and two cores per server.
  • A network between servers with enough bandwidth to contain your IO write workload and an average of 5ms round trip latency or lower, for synchronous replication. Asynchronous replication does not have a latency recommendation.
  • Windows Server, Datacenter Edition, or Windows Server, Standard Edition. Storage Replica running on Windows Server, Standard Edition, has the following limitations:
    • You must use Windows Server 2019 or later
    • Storage Replica replicates a single volume instead of an unlimited number of volumes.
    • Volumes can have a size of up to 2 TB instead of an unlimited size.

 

Scenario

What i have use to test Storage Replication before apply in a Production Environment

  • 2 x Windows Server 2019 Standard Edition as File Servers
  • 2 Different Data Centers with 100Mbps Fiber Line between them
  • 1 x Windows Server 2016 Std Edition to Manage Storage Replica from Windows Admin Center.

If you don't have already a Windows Admin Center to manage your Servers find out my article Windows Admin Center -  Monitoring and Managing Remote Servers how can do it.

 

How to Install Storage Replica Feature

Now we are ready to proceed with the installation of Storage Replica Feature in both Servers.

So let's start

  • Open Windows Admin Center
  • Connect in the first Server that you would like to install Storage Replica
  • Click Roles & Features
  • From the Features find the Storage Replicate and check it.
  • Click Install.

 

  • Click Yes

 

  • Wait until finish the installation

 

  • Continues with the same steps from the second server.

How to Configure Storage Replica   

Now it's time to Configure Storage Replica in every File Server.

The steps are the below

  • Create the partitions in every Server to meet the requirements for the Storage Replica
  • Perform a test in Powershell from source server to verify that meet all the requirements
  • Create the Partnership
Create the partitions in every Server to meet the requirements for the Storage Replica

Which are the steps that must follow?

  • First of all we must create two partitions in every File Server and must meet the followings
    • Must be initialize as GPT not MBR
    • The first will be include the Data and the second it''s for the Logs. Don't forget that the Servers is in Lab. So you don't have any Disk with Data. In production environment you have already the Volume with Data.
    • The Disks must has the same Size in both Servers.
    • The log Volume it's recommended to use SSD to be faster. It's not required but you will have better performance.
    • The log Volume must be at least 9 GB. The size it's not default but may be larger or smaller base on the log requirements.

When you are ready with the Volumes in your File Servers it's time to run a Test. The results will give us Report if met all the requirements and details for the connection between the Data Centers.

 
Perform a test in Powershell from source server to verify that meet all the requirements

Because Storage replica in Synchronous replication needs low latency to ensure zero data loss if we don't know we can identify from the Test.

  • Create a temp folder
  • Open a Powershell Console as administrator and type the following command

Test-SRTopology -SourceComputerName flsrv3 -SourceVolumeName d: -SourceLogVolumeName e: -DestinationComputerName flsrv04 -DestinationVolumeName d: -DestinationLogVolumeName e: -DurationInMinutes 30 -ResultPath c:\temp

 

  • After finish the test the results will be saved as HTML in the temp folder that you created.

 

Unfortunately because we are in Lab environment the results it's not corresponded with the results in a production environment.

This will be a problem when you will start the implementation in your production environment.

Because its not recommended in any case to start implement Storage Replica in your production environment without test and learn in your Lab you can use any of the following workarounds.

  • Copy files in the data volume while running the test.
  • Download  the DISKSPD to generate IOs. For example the following command run a low write IO for 10 minutes to the data Volume.

Diskspd.exe -c1g -d600 -W5 -C5 -b8k -t2 -o2 -r -w5 -i100 -j100 d:\test

Get a cup of coffee and wait until the test finish.

Examine the results of the Test to identify if you meet all the requirements.

In case that you don't meet all the requirements find the problems , resolve it and run again the test.

If you meet all the requirements it's time to proceed with the creation of Partnership.

 

Create the Partnership

This is the final step to start the Replication

  • If you don't have open Windows Admin Center
  • Click in Storage Replica from the left side
  • Click in New

 

  • Type the name of the Source Server and then will identify the available Volumes.
  • Give a name for a Replication Group
  • Type the name of the Destination Server.
  • Give a name for a Replication Group

 

  • Click in More Options and check any of these base on your requirements:
    • Enable Synchronous replication only if you have low latency. You already have identify from the Test
    • The log size must already knew it from the Test
    • Check the Use blocks already seeded on the target to speed up initial synchronization If you have transferred data in the destination Server
    • Encrypt replication traffic
    • Check the Enable consistency groups when you have to replicate servers with Applications like MS SQL Server and have create different volume for logs and different volume for databases.  Ensure that application which write in multiple volumes the data is written to the destination volume sequential. For example when you use MS SQL Server which write in multiple volumes and for any reason Production Server Failed then the Destination Server must start to use it in Production environment. But all the data must be written in muitple volume at the same point time to work successful. 
  • When you decide how will run the replication click Create.

 

  • You will see a notification that the partnership starting to created.

 

  • When finish you can see the Partnership.

 

  • For now on the replication start running and between the Source and the Destination Server.

Remove the Partnership

If you have decide to remove the partnership it's better to do it from Powershell. 

The reason is if remove the partnersip from Windows Admin Center will not remove the Replication Group.

So open a Powershell as Administrator and proceed with the following commands in both Servers

  • Identify Partnership

Get-SRPartnerShip

 

  • Identify Replication Group

Get-SRGroup

 

  • Delete Partnership and verify the deletion

Get-SRPartnership | Remove-SRPartnership –confirm:$false

Get-SRPartnerShip

 

  • Delete Replication Group and verify the deletion

Remove-SRGroup –Name rg1

Get-SRGroup

 

 

This is the first step. As IT Pro you know that the most important is to support and monitoring what you have setup. 

You must be proactive probably when you have to do with data. Monitoring is the only solution to identify earlier issues and resolve it.

Until next article Have a nice weekend !!!

You can send me an email at info@askme4tech.com  or do your comments in Twitter or Facebook

I invite you to follow me on Twitter or Facebook. If you have any questions, send email to me at info@askme4tech.com.