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.
In the old days all File servers where on one place, and if you want to replicate data you needed a extra tool to do this. Now days its already build in into Windows server. Storage replica can be used in several ways, replicate data from one Cluster to another or to Azure. but in this case I do a server to server replication as not everyone has a cluster.
For moving data to the Cloud there are currently several other applications like Azure file sync or Azure Migrate https://docs.microsoft.com/en-us/azure/migrate/migrate-overview Blog about Azure File Sync https://robertsmit.wordpress.com/2017/09/28/step-by-step-azure-file-sync-on-premises-file-servers-to-azure-files-storage-sync-service-afs-cloud-msignite/
Storage Replica is Windows Server technology that enables replication of volumes between servers or clusters for disaster recovery. It also enables you to create stretch failover clusters that span two sites, with all nodes staying in sync.
Storage Replica supports synchronous and asynchronous replication:
-
- 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.
Storage Replica allows more efficient use of multiple datacenters. By stretching clusters or replicating clusters, workloads can be run in multiple datacenters for quicker data access by local proximity users and applications, as well as better load distribution and use of compute resources. If a disaster takes one datacenter offline, you can move its typical workloads to the other site temporarily.
Storage Replica may allow you to decommission existing file replication systems such as DFS Replication that were pressed into duty as low-end disaster recovery solutions. While DFS Replication works well over extremely low bandwidth networks, its latency is very high – often measured in hours or days. This is caused by its requirement for files to close and its artificial throttles meant to prevent network congestion. With those design characteristics, the newest and hottest files in a DFS Replication replica are the least likely to replicate. Storage Replica operates below the file level and has none of these restrictions.
Storage Replica also supports asynchronous replication for longer ranges and higher latency networks. Because it is not checkpoint-based, and instead continuously replicates, the delta of changes will tend to be far lower than snapshot-based products. Furthermore, Storage Replica operates at the partition layer and therefore replicates all VSS snapshots created by Windows Server or backup software; this allows use of application-consistent data snapshots for point in time recovery, especially unstructured user data replicated asynchronously.
The Setup I used two servers both domain joined, And there are different ways to configure the Storage Replica, the easy way and the 10 second way.
First we are installing the Storage replica feature and the File server Role. The Storage replica feature needs a reboot.
Or use Powershell
install-WindowsFeature “Storage-Replica” –IncludeAllSubFeature
If you don’t know the module name you can find it easily
A reboot is needed.
Doing this server by server is not handy, So placing this together saves us some time.
$Servers = “Building-5”,”Building-9”
$Servers | ForEach { Install-WindowsFeature -ComputerName $_ -Name Storage-Replica,FS-FileServer -IncludeManagementTools -restart }
The –restart does an automatic restart if this is needed.
Storage Replica prerequisites
-
- 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. (with less memory the replication won’t start)
- 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.
As there is no Gui on the replica part we need to configure this by PowerShell or with the new Windows Admin Center
-
- Download and install Windows Admin Center.
Both our servers had Two extra disks. One log and Data Disk.
-
- You must create two volumes on each enclosure: one for data and one for logs.
- Log and data disks must be initialized as GPT, not MBR.
- The two data volumes must be of identical size.
- The two log volumes should be of identical size.
- All replicated data disks must have the same sector sizes.
- All log disks must have the same sector sizes.
- The log volumes should use flash-based storage, such as SSD. Microsoft recommends that the log storage be faster than the data storage. Log volumes must never be used for other workloads.
- The data disks can use HDD, SSD, or a tiered combination and can use either mirrored or parity spaces or RAID 1 or 10, or RAID 5 or RAID 50.
- The log volume must be at least 9GB by default and may be larger or smaller based on log requirements.
- The File Server role is only necessary for Test-SRTopology to operate, as it opens the necessary firewall ports for testing.
As you can see there are some needs for the Replication As I show you below with the performance test why you need this.
First we are configuring the Disks on both servers. with some PowerShell commands but this can also be done with Disk manager.
Get-Disk | Where FriendlyName -eq ‘Msft Virtual Disk’
Get-Disk | Where FriendlyName -eq ‘Msft Virtual Disk’|Initialize-Disk -PartitionStyle GPT –PassThru
1..2 | % { Get-Disk $_ }| Where FriendlyName -eq ‘Msft Virtual Disk’|New-Partition -AssignDriveLetter -UseMaximumSize | Format-Volume -FileSystem ReFS -NewFileSystemLabel “SR01-disk” -Confirm:$false
I formatted the disk with ReFS and not with NTFS.
Now that the disks are in place we can start but before we start building the replica I want to make sure the connection and the network is fast and the server can deliver the performance we need.
Therefor I download a test tool Diskspd. https://aka.ms/diskspd
Important is that the network speed between the server is good as this is the life line for the storage replica. We can test the replication before the build things for real.
With this test tool we bring up a small load to test the server.
Using the Diskspd with the line below.
Diskspd.exe -c1g -d600 -W5 -C5 -b8k -t2 -o2 -r -w5 –i100 –j2 E:test
Storage replica has a great test tool report. So with this we configure the test. Using Powershell
MD c:temp
Test-SRTopology -SourceComputerName “Building-5” -SourceVolumeName “e:” -SourceLogVolumeName “f:” -DestinationComputerName “Building-9” -DestinationVolumeName “e:” -DestinationLogVolumeName “f:” -DurationInMinutes 30 -ResultPath c:Temp
#set output file
$outputfile=”$Env:TEMP”
Test-SRTopology -SourceComputerName “Building-5” -SourceVolumeName “e:” -SourceLogVolumeName “f:” -DestinationComputerName “Building-9” -DestinationVolumeName “e:” -DestinationLogVolumeName “f:” -IntervalInSeconds 5 -DurationInMinutes 30 -ResultPath $outputfile
#open output file
If (Test-Path $outputFile) { Invoke-Item $outputFileTestSrTopologyReport.html } Else { Write-Host “FAILED: Output file not found: $url” -fore red }
Write-Host “Done” -ForegroundColor Cyan
while running the Test-SRTopology with the -DurationInMinutes 30 option we also run Diskspd.
Diskspd.exe -c1g -d600 -W5 -C5 -b8k -t2 -o2 -r -w5 –i100 –j2 E:test
It is a 1 Gb file placed on our E drive that is our Data disk for replication.
As you can see I have just one network adapter and no RDMA and in this config I hit the limit of the CPU and the network card max 4.4 Gbps not bad for a test config. (if you use a better machine in Azure Pick a Azure H-series those have RDMA
One CPU with 99% usage.
When the test is done the is a log file created in -ResultPath c:Temp
Open the log file and detailed information is there about the test. this is why I choose 30 min duration.
Nice graph about the Data throughput, in this case not bad.
the Latency is always a issue this could change you from sync to async or more network adapters or better disks. But for now it is good.
Log Volume Free Disk Space Test: The log volume F: in Building-5 has enough free space to hold the recommended log volume size of 8GB
Log Volume Free Disk Space Test: The log volume F: in Building-9 has enough free space to hold the recommended log volume size of 8GB
Storage replica has not that much PowerShell commands
#list all the commands
get-command *sr*
Setting up the actual replica is done with a long PowerShell command
The default log size is 8GB. Depending on the results of the Test-SRTopology
cmdlet, you may decide to use -LogSizeInBytes with a higher or lower value.
New-SRPartnership -SourceComputerName “Building-5” –SourceRGName rg01 -SourceVolumeName “e:” -SourceLogVolumeName “f:” -DestinationComputerName “Building-9” –DestinationRGName rg02 -DestinationVolumeName “e:” -DestinationLogVolumeName “f:”
The default log size is 8GB. Depending on the results of the Test-SRTopology
cmdlet, you may decide to use -LogSizeInBytes with a higher or lower value.
New-SRPartnership -SourceComputerName “Building-5” –SourceRGName rg01 -SourceVolumeName “e:” -SourceLogVolumeName “f:” -DestinationComputerName “Building-9” –DestinationRGName rg02 -DestinationVolumeName “e:” -DestinationLogVolumeName “f:” -LogSizeInBytes 1gb
here you can see the disk setup between both servers, the active side you can access the data disk, on the passive side the disk is not accessible.
Don’t place files on the Log disk.
To get replication source and destination state, use Get-SRGroup
and Get-SRPartnership
Get-SRGroup
Get-SRGroup |fl *
Get-SRPartnership
(Get-SRGroup).replicas
This is just after the creation so no data yet for the last time in sync.
New-SRPartnership -SourceComputerName “Building-5” –SourceRGName rg01 -SourceVolumeName “e:” -SourceLogVolumeName “f:” -DestinationComputerName “Building-9” –DestinationRGName rg02 -DestinationVolumeName “e:” -DestinationLogVolumeName “f:”
For troubleshooting there are some events that you can check, go to the event viewer and check for the Storage replica events.
Or check the events with PowerShell
Get-WinEvent -ProviderName Microsoft-Windows-StorageReplica -max 20
On the destination server, we can do the same or look for the events in the eventlog.
Get-WinEvent -ProviderName Microsoft-Windows-StorageReplica | Where-Object {$_.ID -eq “1215”} | fl
(Get-SRGroup).Replicas | Select-Object numofbytesremaining
There are also a lot of performance counters that can be viewed with PowerShell
Get-Counter -Counter “Storage Replica Statistics(*)Total Bytes Received”
Get-Counter -Counter “Storage Replica Statistics(*)Total Bytes Sent”
Get-Counter -Counter “Storage Replica Statistics(*)Avg. Network Send Latency”
Get-Counter -Counter “Storage Replica Statistics(*)Replication State”
Get-Counter -Counter “Storage Replica Statistics(*)Last Recovery Elapsed Time”
Get-Counter -Counter “Storage Replica Partition I/O Statistics(*)Number of times flush paused”
Get-Counter -Counter “Storage Replica Statistics(*)Number of Flushed Recovery Transactions”
Get-Counter -Counter “Storage Replica Statistics(*)Number of Recovery Transactions”
Get-Counter -Counter “Storage Replica Statistics(*)Number of Flushed Replication Transactions”
Get-Counter -Counter “Storage Replica Statistics(*)Number of Replication Transactions”
Get-Counter -Counter “Storage Replica Statistics(*)Number of Messages Received”
Get-Counter -Counter “Storage Replica Statistics(*)Number of Messages Sent”
Get-Counter -Counter “Storage Replica Partition I/O Statistics(*)Avg. App Write Latency”
Get-Counter -Counter “Storage Replica Partition I/O Statistics(*)Avg. App Read Latency”
Get-Counter -Counter “Storage Replica Statistics(*)Target RPO”
Get-Counter -Counter “Storage Replica Statistics(*)Current RPO”
Get-Counter -Counter “Storage Replica Statistics(*)Avg. Log Queue Length”
Get-Counter -Counter “Storage Replica Statistics(*)Current Log Queue Length”
Get-Counter -Counter “Storage Replica Statistics(*)Total Bytes Received”
Get-Counter -Counter “Storage Replica Statistics(*)Total Bytes Sent”
Get-Counter -Counter “Storage Replica Statistics(*)Avg. Network Send Latency”
Get-Counter -Counter “Storage Replica Statistics(*)Replication State”
Get-Counter -Counter “Storage Replica Statistics(*)Avg. Message Round Trip Latency”
Get-Counter -Counter “Storage Replica Statistics(*)Last Recovery Elapsed Time”
Get-Counter -Counter “Storage Replica Statistics(*)Number of Flushed Recovery Transactions”
Get-Counter -Counter “Storage Replica Statistics(*)Number of Recovery Transactions”
Get-Counter -Counter “Storage Replica Statistics(*)Number of Flushed Replication Transactions”
Get-Counter -Counter “Storage Replica Statistics(*)Number of Replication Transactions”
Get-Counter -Counter “Storage Replica Statistics(*)Max Log Sequence Number”
Get-Counter -Counter “Storage Replica Statistics(*)Number of Messages Received”
Get-Counter -Counter “Storage Replica Statistics(*)Number of Messages Sent”
these counters look like this
To remove the Replication we run the following command :
Get-SRPartnership Get-SRPartnership | Remove-SRPartnership Get-SRGroup | Remove-SRGroup
Or change the direction of the replication just run the PowerShell command
#move the replication direction from one site, use the
Set-SRPartnership -NewSourceComputerName “Building-9” -SourceRGName rg02 -DestinationComputerName “Building-5” -DestinationRGName rg01
Why not use Windows Admin Center ?
But all this PowerShell my fear you on using this. Good news than when using Windows Admin Center
Windows Admin Center is a locally deployed, browser-based app for managing servers, clusters, hyper-converged infrastructure, and Windows 10 PCs. It comes at no additional cost beyond Windows and is ready to use in production.
Get it here
When opening the Source Storage Replica server you will see a quick over view of you configuration
Easy switch replication direction.
Notifications on the preformed actions
With an overview of the current configuration.
But the best part of Windows Admin Center is creating a new Replica. I removed the old replica and create a new one with the WAC.
Fill in the source and destination and your done.
With the Admin center you got a GUI wrapper for creating the Storage replica, No PowerShell needed
So removing the replication or in case one server is dead.
Normaly you would do
Get-SRPartnership | Remove-SRPartnership –confirm:$false
this removes the replication and both locations will show the Data.
But if source server is no longer there this will not work
Remove-SRPartnership –Name RG02 -IgnoreRemovalFailure so that it breaks the partnership completely
Remove-SRPartnership [[-SourceComputerName] <String>] [-SourceRGName] <String> [-DestinationComputerName] <String> [-DestinationRGName] <String> [-IgnoreRemovalFailure] [-Force] [-CimSession <CimSession[]>] [-ThrottleLimit <Int32>] [-AsJob] [-WhatIf] [-Confirm] [<CommonParameters>]
here is the source link
https://docs.microsoft.com/en-us/powershell/module/storagereplica/remove-srpartnership?view=win10-ps
Clear-SRMetadata Removes unreferenced Storage Replica metadata.
There are more options in Windows Admin Center that could be useful to you just try it.
And if you want to use file replication to Azure take a look at the Azure File Sync https://docs.microsoft.com/en-us/azure/storage/files/storage-files-introduction
Step by Step Azure File Sync – on-premises file servers to #Azure Files Storage Sync Service
Follow Me on Twitter @ClusterMVP
Follow My blog https://robertsmit.wordpress.com
Linkedin Profile Robert Smit MVP Linkedin profile
Google : Robert Smit MVP profile
Robert Smit is Senior Technical Evangelist and is a current Microsoft MVP in Clustering as of 2009.
Robert has over 20 years experience in IT with experience in the educational, health-care and finance industries.
Robert’s past IT experience in the trenches of IT gives him the knowledge and insight that allows him to communicate effectively with IT professionals
who are trying to address real concerns around business continuity, disaster recovery and regulatory compliance issues. Robert holds the following certifications:
MCT — Microsoft Certified Trainer, MCTS — Windows Server Virtualization, MCSE, MCSA and MCPS. He is an active participant in the Microsoft newsgroup community and is currently focused on Hyper-V, Failover Clustering, SQL Server, Azure and all things related to Cloud Computing and Infrastructure Optimalization.
Follow Robert on Twitter @ClusterMVP
Or follow his blog https://robertsmit.wordpress.com
Linkedin Profile Http://nl.linkedin.com/in/robertsmit
Robert is also capable of transferring his knowledge to others which is a rare feature in the field of IT. He makes a point of not only solving issues but also of giving on the job training of his colleagues.
A customer says » Robert has been a big influence on our technical staff and I have to come to know him as a brilliant specialist concerning Microsoft Products. He was Capable with his in-depth knowledge of Microsoft products to troubleshoot problems and develop our infrastructure to a higher level. I would certainly hire him again in the future. »
Details of the Recommendation: «I have been coordinating with Robert implementing a very complex system. Although he was primarily a Microsoft infrastructure specialist; he was able to understand and debug .Net based complext Windows applications and websites. His input to improve performance of applications proved very helpful for the success of our project
View all posts by Robert Smit [MVP]
A capability that has been around for quite some time with Storage Area Network (SAN) devices is the ability to replicate the storage between one SAN device to another SAN device. SAN vendors have long had this capability. It provides an easy way to replicate all the data on a SAN device safely to a DR or other facility where you have another SAN device receiving the replicated data. Back in Windows Server 2016, Microsoft released an extremely interesting capability that allows you to essentially replicate volumes between Windows Servers. This feature is called Storage Replica. This holds out some very interesting and extremely beneficial use cases. With Windows Server 2019, these capabilities were further extended. In this post, we will take a look at Storage Replica in Windows Server 2019 Features and Configuration and see how to leverage this feature.
What is Storage Replica?
What is Storage Replica technology? Storage Replica is a new Windows Server technology that allows you to replicate the content of your volumes between servers or clusters for disaster recovery. In addition, it provides a means to create streteched failover clusters that span two sites and keeps the data between those two sites in sync.
This is a data replication technology that copies data between teh two Windows Servers at the block-level. The Windows Servers can be located at different physical locations and wasn’t an available technology in Windows Server versions prior to Windows Server 2016.
The technology is also important when thinking about architecting a multi-site failover cluster configuration. It allows keeping the the data in synce continuously between the cluster nodes at each site. This is the feature that allows successful failover between cluster configurations at various sites.
When you think about the benefits of this solution in terms of uniformity, simplicity, and functionality, it is a win-win across the board. Microsoft is the sole vendor of the solution and the solution does not depend on a specific type or brand of storage solution as it is taken care of in software. Much like the benefits of software-defined storage in general, this allows you to choose your own preference of hardware vendor backing the storage solution configured for your Windows Servers.
Types of Replication
In looking at Storage Replica in Windows Server 2019 Features and Configuration, there are two types of Storage Replica synchronization technologies:
Synchronous replication – As you would expect, this mirrors data within a low-latency network site with crash-consistent volumes to ensure you have no data loss of your data at a file-system level if and when a failure occurs.
Asynchronous replication – With Asynchronous replication, this mirrors the data across sites beyond metropolitan ranges over network links that may have much higher latencies. Using this type of replication, you don’t have a guarantee the data will be identical between both sites.
Storage Replica Features with Windows Server 2019
One of the limiting factors with Windows Server 2016 with Storage Replica was that you only had this feature with Windows Server Datacenter Edition. However, new with Storage Replica in Windows Server 2019 Features and Configuration, Storage Replica is now available with Standard Edition.
This unlocks the feature for many environments who may be limited to Standard Edition with their servers. However, there are limitations to note with Standard Edition including the following:
- You only have this feature between Standard Edition servers running Windows Server 2019
- You can only replicate a single volume instead of an unlimited number of volumes as with Windows Server 2019 Datacenter Edition
- Volumes can have a size of up to 2 TB instead of unlimited size
Also new is the ability to manage Storage Replica with Windows Admin Center which provides a really nice GUI to manage the solution.
Storage Replica Prerequisites
The prerequisites for Storage Replica include the following:
- Active Directory Domain Services
- Storage Spaces Direct, Fibre Channel SAN, iSCSI, or local SAS/SCI/SATA storage. SSDs are recommended for log drives and other similar workloads
- You want to dedicate a connection to synchronous replication and preferably an RDMA-enabled connection
- At least 2 GB RAM and 2 CPU cores per server
- An average of 5ms round trip latency or lower for synchronous replication. Asynchronous replication can deal with any amount of latency
- With Windows Server 2019, you can use Standard or Datacenter Editions for enabling Storage Replica
Storage Replica Considerations
Considerations to make with Storage Replica:
- Network bandwidth and storage are going to certainly come into play with synchronous replication. You must back sure you are using low latency, high-bandwidth connections and high-throughput disks
- With Windows Server 2016, the destination volume will not be made available for use. You won’t be able to access it through file explorer and other means even though the drive letter may show as available. With Windows Server 2019, there is a Test-Failoer cmdlet that allows you to temporarily mount a read-write snapshot of the destination volume for backups, testing, etc
- Microsoft uses their own version of asynchronous replication that actually allows better RPOs than traditional asynchronous replication. It does not use “snapshot-based replication” but rather uses the same technology that is used by synchronous replication and simply removes the requirement for serialized synchronous acknowledgement
- Storage Replica is a much better solution for replicating data than DFS replication
- Do not use Storage Replica as part of a “backup” solution
- It is not a replacement for Hyper-V Replicas or SSQL AlwaysOn Availability Groups
Configuring Storage Replica with Windows Server 2019
Installing Storage Replica couldn’t be easier. It is a simple matter of installing the Storage Replica feature in Server Manager or using Windows Admin Center.
Installing Storage Replica
Below, using Server Manager in Windows Server 2019, Check off the Storage Replica feature for installation.
Add the Additional features that are required for Storage Replica when prompted.
After adding the additional features, click Install on the Confirm installation selections screen in Server Manager.
The server will need to reboot after the installation of Storage Replica. After the reboot, I went back to take a look at the features present and found the Storage Replica feature had installed.
Configuring Storage Replica
Now that Storage Replica is installed, I have also installed Windows Admin Center 1910 for easily configuring the Storage Replica feature. Navigate in Windows Admin Center to Storage Replica and select the New under Storage Replica Partnerships.
This will launch a wizard in the side panel of Windows Admin Center called Replicate with another server. Here I am choosing Use an existing server or VM and click Next.
On the next screen, you will setup your Source and Destination.
When you scroll all the way down on this screen, you will find the More options section that provides additional settings and features of the synchronization that you can either enable or leave unchecked. These include:
- Use blocks already seeded on the target to speed up initial replication
- Encrypt replication traffic
- Enable consistency groups
After a couple of moments, the Storage Replica partnership is created.
On the replication partner that is the destination of the replication, as expected, I tried to browse the “D Drive” and am unable to.
Storage Replica PowerShell Cmdlets
Below is an example of a couple of the cmdlets that are available to get the details of your Storage Replica environment as you can glean a bit more detail than is provided in Windows Admin Center if needed.
- get-srpartnership
- get-srgroup
Also, if you want to see the details of replication during the initial synchronization, you can use the following PowerShell code:
Get-SRGroup do{ $r=(Get-SRGroup -Name "Replication 2").replicas [System.Console]::Write("Number of remaining bytes {0}`n", $r.NumOfBytesRemaining) Start-Sleep 10 }until($r.ReplicationStatus -eq 'ContinuouslyReplicating') Write-Output "Replica Status: "$r.replicationstatus
A full listing of available PowerShell cmdlets are found on the official Microsoft KB here: https://docs.microsoft.com/en-us/powershell/module/storagereplica/?view=win10-ps
Wrapping Up
Storage Replica is a great new feature found starting in Windows Server 2016 and now looking at Storage Replica in Windows Server 2019 Features and Configuration, it offers further enhancements. Without the need for any third-party hardware solution or vendor-specific solution, Windows Server is now able to replicate your data synchronously or asynchronously as needed between two Windows Servers by means of Storage Replica. Stay tuned for further exploration of this cool technology.
title | description | manager | ms.author | ms.topic | author | ms.date | ms.assetid |
---|---|---|---|---|---|---|---|
Server-to-server storage replication |
How to set up and use Storage Replica for server-to-server replication in Windows Server, including Windows Admin Center and PowerShell. |
siroy |
nedpyle |
how-to |
nedpyle |
03/26/2020 |
61881b52-ee6a-4c8e-85d3-702ab8a2bd8c |
Server-to-server storage replication with Storage Replica
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016
You can use Storage Replica to configure two servers to sync data so that each has an identical copy of the same volume. This topic provides some background of this server-to-server replication configuration, as well as how to set it up and manage the environment.
To manage Storage Replica you can use Windows Admin Center or PowerShell.
Here’s an overview video of using Storage Replica in Windows Admin Center.
[!video https://www.microsoft.com/videoplayer/embed/3aa09fd4-867b-45e9-953e-064008468c4b?autoplay=false]
Prerequisites
- Active Directory Domain Services forest (doesn’t need to run Windows Server 2016).
- Two servers running Windows Server 2019 or Windows Server 2016, Datacenter Edition. If you’re running Windows Server 2019, you can instead use Standard Edition if you’re OK replicating only a single volume up to 2 TB in size.
- Two sets of storage, using SAS JBODs, fibre channel SAN, iSCSI target, or local SCSI/SATA storage. The storage should contain a mix of HDD and SSD media. You will make each storage set available only to each of the servers, with no shared access.
- Each set of storage must allow creation of at least two virtual disks, one for replicated data and one for logs. The physical storage must have the same sector sizes on all the data disks. The physical storage must have the same sector sizes on all the log disks.
- At least one ethernet/TCP connection on each server for synchronous replication, but preferably RDMA.
- Appropriate firewall and router rules to allow ICMP, SMB (port 445, plus 5445 for SMB Direct) and WS-MAN (port 5985) bi-directional traffic between all nodes.
- A network between servers with enough bandwidth to contain your IO write workload and an average of =5ms round trip latency, for synchronous replication. Asynchronous replication doesn’t have a latency recommendation.
If you’re replicating between on-premises servers and Azure VMs, you must create a network link between the on-premises servers and the Azure VMs. To do so, use Express Route, a Site-to-Site VPN gateway connection, or install VPN software in your Azure VMs to connect them with your on-premises network. - The replicated storage cannot be located on the drive containing the Windows operating system folder.
[!IMPORTANT]
In this scenario, each server should be in a different physical or logical site. Each server must be able to communicate with the other via a network.
Many of these requirements can be determined by using the Test-SRTopology cmdlet
. You get access to this tool if you install Storage Replica or the Storage Replica Management Tools features on at least one server. There is no need to configure Storage Replica to use this tool, only to install the cmdlet. More information is included in the steps below.
Windows Admin Center requirements
To use Storage Replica and Windows Admin Center together, you need the following:
System | Operating system | Required for |
---|---|---|
Two servers (any mix of on-premises hardware, VMs, and cloud VMs including Azure VMs) |
Windows Server 2019, Windows Server 2016, or Windows Server (Semi-Annual Channel) | Storage Replica |
One PC | Windows 10 | Windows Admin Center |
[!NOTE]
Right now you can’t use Windows Admin Center on a server to manage Storage Replica.
Terms
This walkthrough uses the following environment as an example:
-
Two servers, named SR-SRV05 and SR-SRV06.
-
A pair of logical «sites» that represent two different data centers, with one called Redmond and one called Bellevue.
Figure 1: Server to server replication
Step 1: Install and configure Windows Admin Center on your PC
If you’re using Windows Admin Center to manage Storage Replica, use the following steps to prep your PC to manage Storage Replica.
-
Download and install Windows Admin Center.
-
Download and install the Remote Server Administration Tools.
- If you’re using Windows 10, version 1809 or later, install the «RSAT: Storage Replica Module for Windows PowerShell» from Features on Demand.
-
Open a PowerShell session as administrator by selecting the Start button, typing PowerShell, right-clicking Windows PowerShell, and then selecting Run as administrator.
-
Enter the following command to enable the WS-Management protocol on the local computer and set up the default configuration for remote management on the client.
-
Type Y to enable WinRM services and enable WinRM Firewall Exception.
Step 2: Provision operating system, features, roles, storage, and network
-
Install Windows Server on both server nodes with an installation type of Windows Server (Desktop Experience).
To use an Azure VM connected to your network via an ExpressRoute, see Adding an Azure VM connected to your network via ExpressRoute.
[!NOTE]
Starting in Windows Admin Center version 1910, you can configure a destination server automatically in Azure. If you choose that option, install Windows Server on the source server and then skip to Step 3: Set up server-to-server replication. -
Add network information, join the servers to the same domain as your Windows 10 management PC (if you’re using one), and then restart the servers.
[!NOTE]
From this point on, always logon as a domain user who is a member of the built-in administrator group on all servers. Always remember to elevate your PowerShell and CMD prompts going forward when running on a graphical server installation or on a Windows 10 computer. -
Connect the first set of JBOD storage enclosure, iSCSI target, FC SAN, or local fixed disk (DAS) storage to the server in site Redmond.
-
Connect the second set of storage to the server in site Bellevue.
-
As appropriate, install latest vendor storage and enclosure firmware and drivers, latest vendor HBA drivers, latest vendor BIOS/UEFI firmware, latest vendor network drivers, and latest motherboard chipset drivers on both nodes. Restart nodes as needed.
[!NOTE]
Consult your hardware vendor documentation for configuring shared storage and networking hardware. -
Ensure that BIOS/UEFI settings for servers enable high performance, such as disabling C-State, setting QPI speed, enabling NUMA, and setting highest memory frequency. Ensure power management in Windows Server is set to High Performance. Restart as required.
-
Configure roles as follows:
-
Windows Admin Center method
- In Windows Admin Center, navigate to Server Manager, and then select one of the servers.
- Navigate to Roles & Features.
- Select Features > Storage Replica, and then click Install.
- Repeat on the other server.
-
Server Manager method
-
Run ServerManager.exe and create a Server Group, adding all server nodes.
-
Install the File Server and Storage Replica roles and features on each of the nodes and restart them.
-
-
Windows PowerShell method
On SR-SRV06 or a remote management computer, run the following command in a Windows PowerShell console to install the required features and roles and restart them:
$Servers = 'SR-SRV05','SR-SRV06' $Servers | ForEach { Install-WindowsFeature -ComputerName $_ -Name Storage-Replica,FS-FileServer -IncludeManagementTools -restart }
For more information on these steps, see Install or Uninstall Roles, Role Services, or Features
-
-
Configure storage as follows:
[!IMPORTANT]
- You must create two volumes on each enclosure: one for data and one for logs.
- Log and data disks must be initialized as GPT, not MBR.
- The two data volumes must be of identical size.
- The two log volumes should be of identical size.
- All replicated data disks must have the same sector sizes.
- All log disks must have the same sector sizes.
- The log volumes should use flash-based storage, such as SSD. Microsoft recommends that the log storage be faster than the data storage. Log volumes must never be used for other workloads.
- The data disks can use HDD, SSD, or a tiered combination and can use either mirrored or parity spaces or RAID 1 or 10, or RAID 5 or RAID 50.
- The log volume must be at least 9GB by default and may be larger or smaller based on log requirements.
- The File Server role is only necessary for Test-SRTopology to operate, as it opens the necessary firewall ports for testing.
-
For JBOD enclosures:
-
Ensure that each server can see that site’s storage enclosures only and that the SAS connections are correctly configured.
-
Provision the storage using Storage Spaces by following Steps 1-3 provided in the Deploy Storage Spaces on a Stand-Alone Server using Windows PowerShell or Server Manager.
-
-
For iSCSI storage:
-
Ensure that each cluster can see that site’s storage enclosures only. You should use more than one single network adapter if using iSCSI.
-
Provision the storage using your vendor documentation. If using Windows-based iSCSI Targeting, consult iSCSI Target Block Storage, How To.
-
-
For FC SAN storage:
-
Ensure that each cluster can see that site’s storage enclosures only and that you have properly zoned the hosts.
-
Provision the storage using your vendor documentation.
-
-
For local fixed disk storage:
-
Ensure the storage doesn’t contain a system volume, page file, or dump files.
-
Provision the storage using your vendor documentation.
-
-
Start Windows PowerShell and use the Test-SRTopology cmdlet to determine if you meet all the Storage Replica requirements. You can use the cmdlet in a requirements-only mode for a quick test as well as a long running performance evaluation mode.
For example, to validate the proposed nodes that each have a F: and G: volume and run the test for 30 minutes:
MD c:temp Test-SRTopology -SourceComputerName SR-SRV05 -SourceVolumeName f: -SourceLogVolumeName g: -DestinationComputerName SR-SRV06 -DestinationVolumeName f: -DestinationLogVolumeName g: -DurationInMinutes 30 -ResultPath c:temp
[!IMPORTANT]
When using a test server with no write IO load on the specified source volume during the evaluation period, consider adding a workload or it will not generate a useful report. You should test with production-like workloads in order to see real numbers and recommended log sizes. Alternatively, simply copy some files into the source volume during the test or download and run DISKSPD to generate write IOs. For instance, a sample with a low write IO workload for ten minutes to the D: volume:Diskspd.exe -c1g -d600 -W5 -C5 -b8k -t2 -o2 -r -w5 -i100 -j100 d:test
-
Examine the TestSrTopologyReport.html report shown in Figure 2 to ensure that you meet the Storage Replica requirements.
Figure 2: Storage replication topology report
Step 3: Set up server-to-server replication
Using Windows Admin Center
-
Add the source server.
- Select the Add button.
- Select Add server connection.
- Type the name of the server and then select Submit.
-
On the All Connections page, select the source server.
-
Select Storage Replica from Tools panel.
-
Select New to create a new partnership. To create a new Azure VM to use as the destination for the partnership:
- Under Replicate with another server select Use a New Azure VM and then select Next. If you don’t see this option, make sure that you’re using Windows Admin Center version 1910 or a later version.
- Specify your source server information and replication group name, and then select Next.
This begins a process that automatically selects a Windows Server 2019 or Windows Server 2016 Azure VM as a destination for the migration source. Storage Migration Service recommends VM sizes to match your source, but you can override this by selecting See all sizes. Inventory data is used to automatically configure your managed disks and their file systems, as well as join your new Azure VM to your Active Directory domain.
- After Windows Admin Center creates the Azure VM, provide a replication group name and then select Create. Windows Admin Center then begins the normal Storage Replica initial synchronization process to start protecting your data.
Here’s a video showing how to use Storage Replica to migrate to Azure VMs.
[!VIDEO https://www.youtube-nocookie.com/embed/_VqD7HjTewQ]
-
Provide the details of the partnership, and then select Create (as shown in Figure 3).
Figure 3: Creating a new partnership
[!NOTE]
Removing the partnership from Storage Replica in Windows Admin Center doesn’t remove the replication group name.
Using Windows PowerShell
Now you will configure server-to-server replication using Windows PowerShell. You must perform all of the steps below on the nodes directly or from a remote management computer that contains the Windows Server Remote Server Administration Tools.
-
Ensure you are using an elevated Powershell console as an administrator.
-
Configure the server-to-server replication, specifying the source and destination disks, the source and destination logs, the source and destination nodes, and the log size.
New-SRPartnership -SourceComputerName sr-srv05 -SourceRGName rg01 -SourceVolumeName f: -SourceLogVolumeName g: -DestinationComputerName sr-srv06 -DestinationRGName rg02 -DestinationVolumeName f: -DestinationLogVolumeName g:
Output:
DestinationComputerName : SR-SRV06 DestinationRGName : rg02 SourceComputerName : SR-SRV05 PSComputerName :
[!IMPORTANT]
The default log size is 8GB. Depending on the results of theTest-SRTopology
cmdlet, you may decide to use -LogSizeInBytes with a higher or lower value. -
To get replication source and destination state, use
Get-SRGroup
andGet-SRPartnership
as follows:Get-SRGroup Get-SRPartnership (Get-SRGroup).replicas
Output:
CurrentLsn : 0 DataVolume : F: LastInSyncTime : LastKnownPrimaryLsn : 1 LastOutOfSyncTime : NumOfBytesRecovered : 37731958784 NumOfBytesRemaining : 30851203072 PartitionId : c3999f10-dbc9-4a8e-8f9c-dd2ee6ef3e9f PartitionSize : 68583161856 ReplicationMode : synchronous ReplicationStatus : InitialBlockCopy PSComputerName :
-
Determine the replication progress as follows:
-
On the source server, run the following command and examine events 5015, 5002, 5004, 1237, 5001, and 2200:
Get-WinEvent -ProviderName Microsoft-Windows-StorageReplica -max 20
-
On the destination server, run the following command to see the Storage Replica events that show creation of the partnership. This event states the number of copied bytes and the time taken. Example:
Get-WinEvent -ProviderName Microsoft-Windows-StorageReplica | Where-Object {$_.ID -eq "1215"} | fl
Here’s some example output:
TimeCreated : 4/8/2016 4:12:37 PM ProviderName : Microsoft-Windows-StorageReplica Id : 1215 Message : Block copy completed for replica. ReplicationGroupName: rg02 ReplicationGroupId: {616F1E00-5A68-4447-830F-B0B0EFBD359C} ReplicaName: f: ReplicaId: {00000000-0000-0000-0000-000000000000} End LSN in bitmap: LogGeneration: {00000000-0000-0000-0000-000000000000} LogFileId: 0 CLSFLsn: 0xFFFFFFFF Number of Bytes Recovered: 68583161856 Elapsed Time (ms): 117
[!NOTE]
Storage Replica dismounts the destination volumes and their drive letters or mount points. This is by design. -
Alternatively, the destination server group for the replica states the number of byte remaining to copy at all times, and can be queried through PowerShell. For example:
(Get-SRGroup).Replicas | Select-Object numofbytesremaining
As a progress sample (that will not terminate):
while($true) { $v = (Get-SRGroup -Name "RG02").replicas | Select-Object numofbytesremaining [System.Console]::Write("Number of bytes remaining: {0}`r", $v.numofbytesremaining) Start-Sleep -s 5 }
-
On the destination server, run the following command and examine events 5009, 1237, 5001, 5015, 5005, and 2200 to understand the processing progress. There should be no warnings of errors in this sequence. There will be many 1237 events; these indicate progress.
Get-WinEvent -ProviderName Microsoft-Windows-StorageReplica | FL
-
Step 4: Manage replication
Now you will manage and operate your server-to-server replicated infrastructure. You can perform all of the steps below on the nodes directly or from a remote management computer that contains the Windows Server Remote Server Administration Tools.
-
Use
Get-SRPartnership
andGet-SRGroup
to determine the current source and destination of replication and their status. -
To measure replication performance, use the
Get-Counter
cmdlet on both the source and destination nodes. The counter names are:-
Storage Replica Partition I/O Statistics(*)Number of times flush paused
-
Storage Replica Partition I/O Statistics(*)Number of pending flush I/O
-
Storage Replica Partition I/O Statistics(*)Number of requests for last log write
-
Storage Replica Partition I/O Statistics(*)Avg. Flush Queue Length
-
Storage Replica Partition I/O Statistics(*)Current Flush Queue Length
-
Storage Replica Partition I/O Statistics(*)Number of Application Write Requests
-
Storage Replica Partition I/O Statistics(*)Avg. Number of requests per log write
-
Storage Replica Partition I/O Statistics(*)Avg. App Write Latency
-
Storage Replica Partition I/O Statistics(*)Avg. App Read Latency
-
Storage Replica Statistics(*)Target RPO
-
Storage Replica Statistics(*)Current RPO
-
Storage Replica Statistics(*)Avg. Log Queue Length
-
Storage Replica Statistics(*)Current Log Queue Length
-
Storage Replica Statistics(*)Total Bytes Received
-
Storage Replica Statistics(*)Total Bytes Sent
-
Storage Replica Statistics(*)Avg. Network Send Latency
-
Storage Replica Statistics(*)Replication State
-
Storage Replica Statistics(*)Avg. Message Round Trip Latency
-
Storage Replica Statistics(*)Last Recovery Elapsed Time
-
Storage Replica Statistics(*)Number of Flushed Recovery Transactions
-
Storage Replica Statistics(*)Number of Recovery Transactions
-
Storage Replica Statistics(*)Number of Flushed Replication Transactions
-
Storage Replica Statistics(*)Number of Replication Transactions
-
Storage Replica Statistics(*)Max Log Sequence Number
-
Storage Replica Statistics(*)Number of Messages Received
-
Storage Replica Statistics(*)Number of Messages Sent
For more information on performance counters in Windows PowerShell, see Get-Counter.
-
-
To move the replication direction from one site, use the
Set-SRPartnership
cmdlet.Set-SRPartnership -NewSourceComputerName sr-srv06 -SourceRGName rg02 -DestinationComputerName sr-srv05 -DestinationRGName rg01
[!WARNING]
Windows Server prevents role switching when the initial sync is ongoing, as it can lead to data loss if you attempt to switch before allowing initial replication to complete. Don’t force switch directions until the initial sync is complete.Check the event logs to see the direction of replication change and recovery mode occur, and then reconcile. Write IOs can then write to the storage owned by the new source server. Changing the replication direction will block write IOs on the previous source computer.
-
To remove replication, use
Get-SRGroup
,Get-SRPartnership
,Remove-SRGroup
, andRemove-SRPartnership
on each node. Ensure you run theRemove-SRPartnership
cmdlet on the current source of replication only, not on the destination server. RunRemove-SRGroup
on both servers. For example, to remove all replication from two servers:Get-SRPartnership Get-SRPartnership | Remove-SRPartnership Get-SRGroup | Remove-SRGroup
Replacing DFS Replication with Storage Replica
Many Microsoft customers deploy DFS Replication as a disaster recovery solution for unstructured user data like home folders and departmental shares. DFS Replication has shipped in Windows Server 2003 R2 and all later operating systems and operates on low bandwidth networks, which makes it attractive for high latency and low change environments with many nodes. However, DFS Replication has notable limitations as a data replication solution:
- 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.
- It’s generally configured as multi-master, which allows changes to flow in both directions, possibly overwriting newer data.
Storage Replica has none of these limitations. It does, however, have several that might make it less interesting in some environments:
- 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
If these are not blocking factors, Storage Replica allows you to replace DFS Replication servers with this newer technology.
The process is, at a high level:
-
Install Windows Server on two servers and configure your storage. This could mean upgrading an existing set of servers or cleanly installing.
-
Ensure that any data you want to replicate exists on one or more data volumes and not on the C: drive.
a. You can also seed the data on the other server to save time, using a backup or file copies, as well as use thin provisioned storage. Making the metadata-like security match perfectly is unnecessary, unlike DFS Replication. -
Share the data on your source server and make it accessible through a DFS namespace. This is important, to ensure that users can still access it if the server name changes to one in a disaster site.
a. You can create matching shares on the destination server, which will be unavailable during normal operations,
b. Don’t add the destination server to the DFS Namespaces namespace, or if you do, ensure that all its folder targets are disabled. -
Enable Storage Replica replication and complete initial sync. Replication can be either synchronous or asynchronous.
a. However, synchronous is recommended in order to guarantee IO data consistency on the destination server.
b. We strongly recommend enabling Volume Shadow Copies and periodically taking snapshots with VSSADMIN or your other tools of choice. This will guarantee applications flush their data files to disk consistently. In the event of a disaster, you can recover files from snapshots on the destination server that might have been partially replicated asynchronously. Snapshots replicate along with files. -
Operate normally until there is a disaster.
-
Switch the destination server to be the new source, which surfaces its replicated volumes to users.
-
If using synchronous replication, no data restore will be necessary unless the user was using an application that was writing data without transaction protection (this is irrespective of replication) during loss of the source server. If using asynchronous replication, the need for a VSS snapshot mount is higher but consider using VSS in all circumstances for application consistent snapshots.
-
Add the server and its shares as a DFS Namespaces folder target.
-
Users can then access their data.
[!NOTE]
Disaster Recovery planning is a complex subject and requires great attention to detail. Creation of runbooks and the performance of annual live failover drills is highly recommended. When an actual disaster strikes, chaos will rule and experienced personnel may be unavailable.
Adding an Azure VM connected to your network via ExpressRoute
-
Create an ExpressRoute in the Azure portal.
After the ExpressRoute is approved, a resource group is added to the subscription — navigate to Resource groups to view this new group. Take note of the virtual network name.
Figure 4: The resources associated with an ExpressRoute — take note of the virtual network name
-
Create a new resource group.
-
Add a network security group. When creating it, select the subscription ID associated with the ExpressRoute you created, and select the resource group you just created as well.
Add any inbound and outbound security rules you need to the network security group. For example, you might want to allow Remote Desktop access to the VM.
-
Create an Azure VM with the following settings (shown in Figure 5):
- Public IP address: None
- Virtual network: Select the virtual network you took note of from the resource group added with the ExpressRoute.
- Network security group (firewall): Select the network security group you created previously.
Figure 5: Creating a VM while selecting ExpressRoute network settings
-
After the VM is created, see Step 2: Provision operating system, features, roles, storage, and network.
Related Topics
- Storage Replica Overview
- Stretch Cluster Replication Using Shared Storage
- Cluster to Cluster Storage Replication
- Storage Replica: Known Issues
- Storage Replica: Frequently Asked Questions
- Storage Spaces Direct in Windows Server 2016
title | description | manager | ms.author | ms.topic | author | ms.date | ms.assetid |
---|---|---|---|---|---|---|---|
Server-to-server storage replication |
How to set up and use Storage Replica for server-to-server replication in Windows Server, including Windows Admin Center and PowerShell. |
siroy |
nedpyle |
how-to |
nedpyle |
03/26/2020 |
61881b52-ee6a-4c8e-85d3-702ab8a2bd8c |
Server-to-server storage replication with Storage Replica
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016
You can use Storage Replica to configure two servers to sync data so that each has an identical copy of the same volume. This topic provides some background of this server-to-server replication configuration, as well as how to set it up and manage the environment.
To manage Storage Replica you can use Windows Admin Center or PowerShell.
Here’s an overview video of using Storage Replica in Windows Admin Center.
[!video https://www.microsoft.com/videoplayer/embed/3aa09fd4-867b-45e9-953e-064008468c4b?autoplay=false]
Prerequisites
- Active Directory Domain Services forest (doesn’t need to run Windows Server 2016).
- Two servers running Windows Server 2019 or Windows Server 2016, Datacenter Edition. If you’re running Windows Server 2019, you can instead use Standard Edition if you’re OK replicating only a single volume up to 2 TB in size.
- Two sets of storage, using SAS JBODs, fibre channel SAN, iSCSI target, or local SCSI/SATA storage. The storage should contain a mix of HDD and SSD media. You will make each storage set available only to each of the servers, with no shared access.
- Each set of storage must allow creation of at least two virtual disks, one for replicated data and one for logs. The physical storage must have the same sector sizes on all the data disks. The physical storage must have the same sector sizes on all the log disks.
- At least one ethernet/TCP connection on each server for synchronous replication, but preferably RDMA.
- Appropriate firewall and router rules to allow ICMP, SMB (port 445, plus 5445 for SMB Direct) and WS-MAN (port 5985) bi-directional traffic between all nodes.
- A network between servers with enough bandwidth to contain your IO write workload and an average of =5ms round trip latency, for synchronous replication. Asynchronous replication doesn’t have a latency recommendation.
If you’re replicating between on-premises servers and Azure VMs, you must create a network link between the on-premises servers and the Azure VMs. To do so, use Express Route, a Site-to-Site VPN gateway connection, or install VPN software in your Azure VMs to connect them with your on-premises network. - The replicated storage cannot be located on the drive containing the Windows operating system folder.
[!IMPORTANT]
In this scenario, each server should be in a different physical or logical site. Each server must be able to communicate with the other via a network.
Many of these requirements can be determined by using the Test-SRTopology cmdlet
. You get access to this tool if you install Storage Replica or the Storage Replica Management Tools features on at least one server. There is no need to configure Storage Replica to use this tool, only to install the cmdlet. More information is included in the steps below.
Windows Admin Center requirements
To use Storage Replica and Windows Admin Center together, you need the following:
System | Operating system | Required for |
---|---|---|
Two servers (any mix of on-premises hardware, VMs, and cloud VMs including Azure VMs) |
Windows Server 2019, Windows Server 2016, or Windows Server (Semi-Annual Channel) | Storage Replica |
One PC | Windows 10 | Windows Admin Center |
[!NOTE]
Right now you can’t use Windows Admin Center on a server to manage Storage Replica.
Terms
This walkthrough uses the following environment as an example:
-
Two servers, named SR-SRV05 and SR-SRV06.
-
A pair of logical «sites» that represent two different data centers, with one called Redmond and one called Bellevue.
Figure 1: Server to server replication
Step 1: Install and configure Windows Admin Center on your PC
If you’re using Windows Admin Center to manage Storage Replica, use the following steps to prep your PC to manage Storage Replica.
-
Download and install Windows Admin Center.
-
Download and install the Remote Server Administration Tools.
- If you’re using Windows 10, version 1809 or later, install the «RSAT: Storage Replica Module for Windows PowerShell» from Features on Demand.
-
Open a PowerShell session as administrator by selecting the Start button, typing PowerShell, right-clicking Windows PowerShell, and then selecting Run as administrator.
-
Enter the following command to enable the WS-Management protocol on the local computer and set up the default configuration for remote management on the client.
-
Type Y to enable WinRM services and enable WinRM Firewall Exception.
Step 2: Provision operating system, features, roles, storage, and network
-
Install Windows Server on both server nodes with an installation type of Windows Server (Desktop Experience).
To use an Azure VM connected to your network via an ExpressRoute, see Adding an Azure VM connected to your network via ExpressRoute.
[!NOTE]
Starting in Windows Admin Center version 1910, you can configure a destination server automatically in Azure. If you choose that option, install Windows Server on the source server and then skip to Step 3: Set up server-to-server replication. -
Add network information, join the servers to the same domain as your Windows 10 management PC (if you’re using one), and then restart the servers.
[!NOTE]
From this point on, always logon as a domain user who is a member of the built-in administrator group on all servers. Always remember to elevate your PowerShell and CMD prompts going forward when running on a graphical server installation or on a Windows 10 computer. -
Connect the first set of JBOD storage enclosure, iSCSI target, FC SAN, or local fixed disk (DAS) storage to the server in site Redmond.
-
Connect the second set of storage to the server in site Bellevue.
-
As appropriate, install latest vendor storage and enclosure firmware and drivers, latest vendor HBA drivers, latest vendor BIOS/UEFI firmware, latest vendor network drivers, and latest motherboard chipset drivers on both nodes. Restart nodes as needed.
[!NOTE]
Consult your hardware vendor documentation for configuring shared storage and networking hardware. -
Ensure that BIOS/UEFI settings for servers enable high performance, such as disabling C-State, setting QPI speed, enabling NUMA, and setting highest memory frequency. Ensure power management in Windows Server is set to High Performance. Restart as required.
-
Configure roles as follows:
-
Windows Admin Center method
- In Windows Admin Center, navigate to Server Manager, and then select one of the servers.
- Navigate to Roles & Features.
- Select Features > Storage Replica, and then click Install.
- Repeat on the other server.
-
Server Manager method
-
Run ServerManager.exe and create a Server Group, adding all server nodes.
-
Install the File Server and Storage Replica roles and features on each of the nodes and restart them.
-
-
Windows PowerShell method
On SR-SRV06 or a remote management computer, run the following command in a Windows PowerShell console to install the required features and roles and restart them:
$Servers = 'SR-SRV05','SR-SRV06' $Servers | ForEach { Install-WindowsFeature -ComputerName $_ -Name Storage-Replica,FS-FileServer -IncludeManagementTools -restart }
For more information on these steps, see Install or Uninstall Roles, Role Services, or Features
-
-
Configure storage as follows:
[!IMPORTANT]
- You must create two volumes on each enclosure: one for data and one for logs.
- Log and data disks must be initialized as GPT, not MBR.
- The two data volumes must be of identical size.
- The two log volumes should be of identical size.
- All replicated data disks must have the same sector sizes.
- All log disks must have the same sector sizes.
- The log volumes should use flash-based storage, such as SSD. Microsoft recommends that the log storage be faster than the data storage. Log volumes must never be used for other workloads.
- The data disks can use HDD, SSD, or a tiered combination and can use either mirrored or parity spaces or RAID 1 or 10, or RAID 5 or RAID 50.
- The log volume must be at least 9GB by default and may be larger or smaller based on log requirements.
- The File Server role is only necessary for Test-SRTopology to operate, as it opens the necessary firewall ports for testing.
-
For JBOD enclosures:
-
Ensure that each server can see that site’s storage enclosures only and that the SAS connections are correctly configured.
-
Provision the storage using Storage Spaces by following Steps 1-3 provided in the Deploy Storage Spaces on a Stand-Alone Server using Windows PowerShell or Server Manager.
-
-
For iSCSI storage:
-
Ensure that each cluster can see that site’s storage enclosures only. You should use more than one single network adapter if using iSCSI.
-
Provision the storage using your vendor documentation. If using Windows-based iSCSI Targeting, consult iSCSI Target Block Storage, How To.
-
-
For FC SAN storage:
-
Ensure that each cluster can see that site’s storage enclosures only and that you have properly zoned the hosts.
-
Provision the storage using your vendor documentation.
-
-
For local fixed disk storage:
-
Ensure the storage doesn’t contain a system volume, page file, or dump files.
-
Provision the storage using your vendor documentation.
-
-
Start Windows PowerShell and use the Test-SRTopology cmdlet to determine if you meet all the Storage Replica requirements. You can use the cmdlet in a requirements-only mode for a quick test as well as a long running performance evaluation mode.
For example, to validate the proposed nodes that each have a F: and G: volume and run the test for 30 minutes:
MD c:temp Test-SRTopology -SourceComputerName SR-SRV05 -SourceVolumeName f: -SourceLogVolumeName g: -DestinationComputerName SR-SRV06 -DestinationVolumeName f: -DestinationLogVolumeName g: -DurationInMinutes 30 -ResultPath c:temp
[!IMPORTANT]
When using a test server with no write IO load on the specified source volume during the evaluation period, consider adding a workload or it will not generate a useful report. You should test with production-like workloads in order to see real numbers and recommended log sizes. Alternatively, simply copy some files into the source volume during the test or download and run DISKSPD to generate write IOs. For instance, a sample with a low write IO workload for ten minutes to the D: volume:Diskspd.exe -c1g -d600 -W5 -C5 -b8k -t2 -o2 -r -w5 -i100 -j100 d:test
-
Examine the TestSrTopologyReport.html report shown in Figure 2 to ensure that you meet the Storage Replica requirements.
Figure 2: Storage replication topology report
Step 3: Set up server-to-server replication
Using Windows Admin Center
-
Add the source server.
- Select the Add button.
- Select Add server connection.
- Type the name of the server and then select Submit.
-
On the All Connections page, select the source server.
-
Select Storage Replica from Tools panel.
-
Select New to create a new partnership. To create a new Azure VM to use as the destination for the partnership:
- Under Replicate with another server select Use a New Azure VM and then select Next. If you don’t see this option, make sure that you’re using Windows Admin Center version 1910 or a later version.
- Specify your source server information and replication group name, and then select Next.
This begins a process that automatically selects a Windows Server 2019 or Windows Server 2016 Azure VM as a destination for the migration source. Storage Migration Service recommends VM sizes to match your source, but you can override this by selecting See all sizes. Inventory data is used to automatically configure your managed disks and their file systems, as well as join your new Azure VM to your Active Directory domain.
- After Windows Admin Center creates the Azure VM, provide a replication group name and then select Create. Windows Admin Center then begins the normal Storage Replica initial synchronization process to start protecting your data.
Here’s a video showing how to use Storage Replica to migrate to Azure VMs.
[!VIDEO https://www.youtube-nocookie.com/embed/_VqD7HjTewQ]
-
Provide the details of the partnership, and then select Create (as shown in Figure 3).
Figure 3: Creating a new partnership
[!NOTE]
Removing the partnership from Storage Replica in Windows Admin Center doesn’t remove the replication group name.
Using Windows PowerShell
Now you will configure server-to-server replication using Windows PowerShell. You must perform all of the steps below on the nodes directly or from a remote management computer that contains the Windows Server Remote Server Administration Tools.
-
Ensure you are using an elevated Powershell console as an administrator.
-
Configure the server-to-server replication, specifying the source and destination disks, the source and destination logs, the source and destination nodes, and the log size.
New-SRPartnership -SourceComputerName sr-srv05 -SourceRGName rg01 -SourceVolumeName f: -SourceLogVolumeName g: -DestinationComputerName sr-srv06 -DestinationRGName rg02 -DestinationVolumeName f: -DestinationLogVolumeName g:
Output:
DestinationComputerName : SR-SRV06 DestinationRGName : rg02 SourceComputerName : SR-SRV05 PSComputerName :
[!IMPORTANT]
The default log size is 8GB. Depending on the results of theTest-SRTopology
cmdlet, you may decide to use -LogSizeInBytes with a higher or lower value. -
To get replication source and destination state, use
Get-SRGroup
andGet-SRPartnership
as follows:Get-SRGroup Get-SRPartnership (Get-SRGroup).replicas
Output:
CurrentLsn : 0 DataVolume : F: LastInSyncTime : LastKnownPrimaryLsn : 1 LastOutOfSyncTime : NumOfBytesRecovered : 37731958784 NumOfBytesRemaining : 30851203072 PartitionId : c3999f10-dbc9-4a8e-8f9c-dd2ee6ef3e9f PartitionSize : 68583161856 ReplicationMode : synchronous ReplicationStatus : InitialBlockCopy PSComputerName :
-
Determine the replication progress as follows:
-
On the source server, run the following command and examine events 5015, 5002, 5004, 1237, 5001, and 2200:
Get-WinEvent -ProviderName Microsoft-Windows-StorageReplica -max 20
-
On the destination server, run the following command to see the Storage Replica events that show creation of the partnership. This event states the number of copied bytes and the time taken. Example:
Get-WinEvent -ProviderName Microsoft-Windows-StorageReplica | Where-Object {$_.ID -eq "1215"} | fl
Here’s some example output:
TimeCreated : 4/8/2016 4:12:37 PM ProviderName : Microsoft-Windows-StorageReplica Id : 1215 Message : Block copy completed for replica. ReplicationGroupName: rg02 ReplicationGroupId: {616F1E00-5A68-4447-830F-B0B0EFBD359C} ReplicaName: f: ReplicaId: {00000000-0000-0000-0000-000000000000} End LSN in bitmap: LogGeneration: {00000000-0000-0000-0000-000000000000} LogFileId: 0 CLSFLsn: 0xFFFFFFFF Number of Bytes Recovered: 68583161856 Elapsed Time (ms): 117
[!NOTE]
Storage Replica dismounts the destination volumes and their drive letters or mount points. This is by design. -
Alternatively, the destination server group for the replica states the number of byte remaining to copy at all times, and can be queried through PowerShell. For example:
(Get-SRGroup).Replicas | Select-Object numofbytesremaining
As a progress sample (that will not terminate):
while($true) { $v = (Get-SRGroup -Name "RG02").replicas | Select-Object numofbytesremaining [System.Console]::Write("Number of bytes remaining: {0}`r", $v.numofbytesremaining) Start-Sleep -s 5 }
-
On the destination server, run the following command and examine events 5009, 1237, 5001, 5015, 5005, and 2200 to understand the processing progress. There should be no warnings of errors in this sequence. There will be many 1237 events; these indicate progress.
Get-WinEvent -ProviderName Microsoft-Windows-StorageReplica | FL
-
Step 4: Manage replication
Now you will manage and operate your server-to-server replicated infrastructure. You can perform all of the steps below on the nodes directly or from a remote management computer that contains the Windows Server Remote Server Administration Tools.
-
Use
Get-SRPartnership
andGet-SRGroup
to determine the current source and destination of replication and their status. -
To measure replication performance, use the
Get-Counter
cmdlet on both the source and destination nodes. The counter names are:-
Storage Replica Partition I/O Statistics(*)Number of times flush paused
-
Storage Replica Partition I/O Statistics(*)Number of pending flush I/O
-
Storage Replica Partition I/O Statistics(*)Number of requests for last log write
-
Storage Replica Partition I/O Statistics(*)Avg. Flush Queue Length
-
Storage Replica Partition I/O Statistics(*)Current Flush Queue Length
-
Storage Replica Partition I/O Statistics(*)Number of Application Write Requests
-
Storage Replica Partition I/O Statistics(*)Avg. Number of requests per log write
-
Storage Replica Partition I/O Statistics(*)Avg. App Write Latency
-
Storage Replica Partition I/O Statistics(*)Avg. App Read Latency
-
Storage Replica Statistics(*)Target RPO
-
Storage Replica Statistics(*)Current RPO
-
Storage Replica Statistics(*)Avg. Log Queue Length
-
Storage Replica Statistics(*)Current Log Queue Length
-
Storage Replica Statistics(*)Total Bytes Received
-
Storage Replica Statistics(*)Total Bytes Sent
-
Storage Replica Statistics(*)Avg. Network Send Latency
-
Storage Replica Statistics(*)Replication State
-
Storage Replica Statistics(*)Avg. Message Round Trip Latency
-
Storage Replica Statistics(*)Last Recovery Elapsed Time
-
Storage Replica Statistics(*)Number of Flushed Recovery Transactions
-
Storage Replica Statistics(*)Number of Recovery Transactions
-
Storage Replica Statistics(*)Number of Flushed Replication Transactions
-
Storage Replica Statistics(*)Number of Replication Transactions
-
Storage Replica Statistics(*)Max Log Sequence Number
-
Storage Replica Statistics(*)Number of Messages Received
-
Storage Replica Statistics(*)Number of Messages Sent
For more information on performance counters in Windows PowerShell, see Get-Counter.
-
-
To move the replication direction from one site, use the
Set-SRPartnership
cmdlet.Set-SRPartnership -NewSourceComputerName sr-srv06 -SourceRGName rg02 -DestinationComputerName sr-srv05 -DestinationRGName rg01
[!WARNING]
Windows Server prevents role switching when the initial sync is ongoing, as it can lead to data loss if you attempt to switch before allowing initial replication to complete. Don’t force switch directions until the initial sync is complete.Check the event logs to see the direction of replication change and recovery mode occur, and then reconcile. Write IOs can then write to the storage owned by the new source server. Changing the replication direction will block write IOs on the previous source computer.
-
To remove replication, use
Get-SRGroup
,Get-SRPartnership
,Remove-SRGroup
, andRemove-SRPartnership
on each node. Ensure you run theRemove-SRPartnership
cmdlet on the current source of replication only, not on the destination server. RunRemove-SRGroup
on both servers. For example, to remove all replication from two servers:Get-SRPartnership Get-SRPartnership | Remove-SRPartnership Get-SRGroup | Remove-SRGroup
Replacing DFS Replication with Storage Replica
Many Microsoft customers deploy DFS Replication as a disaster recovery solution for unstructured user data like home folders and departmental shares. DFS Replication has shipped in Windows Server 2003 R2 and all later operating systems and operates on low bandwidth networks, which makes it attractive for high latency and low change environments with many nodes. However, DFS Replication has notable limitations as a data replication solution:
- 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.
- It’s generally configured as multi-master, which allows changes to flow in both directions, possibly overwriting newer data.
Storage Replica has none of these limitations. It does, however, have several that might make it less interesting in some environments:
- 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
If these are not blocking factors, Storage Replica allows you to replace DFS Replication servers with this newer technology.
The process is, at a high level:
-
Install Windows Server on two servers and configure your storage. This could mean upgrading an existing set of servers or cleanly installing.
-
Ensure that any data you want to replicate exists on one or more data volumes and not on the C: drive.
a. You can also seed the data on the other server to save time, using a backup or file copies, as well as use thin provisioned storage. Making the metadata-like security match perfectly is unnecessary, unlike DFS Replication. -
Share the data on your source server and make it accessible through a DFS namespace. This is important, to ensure that users can still access it if the server name changes to one in a disaster site.
a. You can create matching shares on the destination server, which will be unavailable during normal operations,
b. Don’t add the destination server to the DFS Namespaces namespace, or if you do, ensure that all its folder targets are disabled. -
Enable Storage Replica replication and complete initial sync. Replication can be either synchronous or asynchronous.
a. However, synchronous is recommended in order to guarantee IO data consistency on the destination server.
b. We strongly recommend enabling Volume Shadow Copies and periodically taking snapshots with VSSADMIN or your other tools of choice. This will guarantee applications flush their data files to disk consistently. In the event of a disaster, you can recover files from snapshots on the destination server that might have been partially replicated asynchronously. Snapshots replicate along with files. -
Operate normally until there is a disaster.
-
Switch the destination server to be the new source, which surfaces its replicated volumes to users.
-
If using synchronous replication, no data restore will be necessary unless the user was using an application that was writing data without transaction protection (this is irrespective of replication) during loss of the source server. If using asynchronous replication, the need for a VSS snapshot mount is higher but consider using VSS in all circumstances for application consistent snapshots.
-
Add the server and its shares as a DFS Namespaces folder target.
-
Users can then access their data.
[!NOTE]
Disaster Recovery planning is a complex subject and requires great attention to detail. Creation of runbooks and the performance of annual live failover drills is highly recommended. When an actual disaster strikes, chaos will rule and experienced personnel may be unavailable.
Adding an Azure VM connected to your network via ExpressRoute
-
Create an ExpressRoute in the Azure portal.
After the ExpressRoute is approved, a resource group is added to the subscription — navigate to Resource groups to view this new group. Take note of the virtual network name.
Figure 4: The resources associated with an ExpressRoute — take note of the virtual network name
-
Create a new resource group.
-
Add a network security group. When creating it, select the subscription ID associated with the ExpressRoute you created, and select the resource group you just created as well.
Add any inbound and outbound security rules you need to the network security group. For example, you might want to allow Remote Desktop access to the VM.
-
Create an Azure VM with the following settings (shown in Figure 5):
- Public IP address: None
- Virtual network: Select the virtual network you took note of from the resource group added with the ExpressRoute.
- Network security group (firewall): Select the network security group you created previously.
Figure 5: Creating a VM while selecting ExpressRoute network settings
-
After the VM is created, see Step 2: Provision operating system, features, roles, storage, and network.
Related Topics
- Storage Replica Overview
- Stretch Cluster Replication Using Shared Storage
- Cluster to Cluster Storage Replication
- Storage Replica: Known Issues
- Storage Replica: Frequently Asked Questions
- Storage Spaces Direct in Windows Server 2016
В Windows Server 2016 появилась довольно интересная возможность репликации локального хранилища (дискового тома) на удаленный сервер – Storage Replica (SR). Данные одного тома автоматически синхронизируются по сети на вторичный сервер, на котором всегда будет доступна идентичная копия тома. Репликация данных в Storage Replica выполняется на уровне блоков с помощью протокола SMB v3.1.1 и не зависит от используемой файловой системы (NTFS, CSVFS, ReFS).
Репликация хранилищ в Windows Server 2016 работает в режиме Active / Passive. Это означает, что данные доступны только на сервере источнике. Возможны два режима репликации:
- Синхронная репликация – данные пишутся одновременно на оба сервера. Перед записью данных на основной сервер он ждет подтверждения о записи данных на удаленный сервер;
- Асинхронная репликация – данные записываются на основной сервер, и затем реплицируются на вторичный.
Storage Replica поддерживает следующие сценарии:
- Репликация между томами одного сервера
- Репликация хранилища Server-to-server
- Репликация хранилища в эластичном кластере (stretch cluster)
- Репликация хранилища между двумя разными кластерами (Cluster-to-cluster)
Содержание:
- Требования к Storage Replica
- Установка Storage Replica в Windows Server 2016
- Настройка репликации томов в Windows Server 2016
Требования к Storage Replica
Для использования Storage Replica ваша инфраструктура должна соответствовать следующим требованиям:
- Windows Server 2016/2019 в редакции Datacenter;
- Оба сервера должны состоять в домене Active Directory;
- По два дополнительных диска на каждом сервере – на одном храняться данные, на втором – логи. Диск с логами должен быть быстрее диска с данными, в идеале SSD. Размеры диска с данными должны быть одинаковыми;
- Таблица разделов дисков – только GPT (MBR не поддерживается);
- Поддерживаются локальные диски (SAS/SCSI/SATA), iSCSI, SAN, общие VHDX, Storage Spaces с SAS JBOD;
- Минимум 2 Гб памяти на сервере;
- Сеть между серверами >= 1 Гбит/с с задержками не более 5 мс в обе стороны ( как правило это ограничивает расстоянием между партнерами по репликации до 30-50 км). Сетевой адаптер желательно с поддержкой RDMA;
- Наличие открытых TCP портов 445, 5985 и 5445 между серверами;
Установка Storage Replica в Windows Server 2016
Компонент Storage Replica можно установить из консоли Server Manager или с помощью PowerShell:
Install-WindowsFeature Storage-Replica –IncludeManagementTools -Restart
Компонент Storage-Replica нужно установить на оба сервера. После установки компонента сервера нужно перезагрузить.
Настройка репликации томов в Windows Server 2016
У Storage Replication нет встроенной графической консоли управления. Для настройки репликации хранилищ нужно использовать PowerShell, Admin Center или консоль Failover Clustering (при использовании кластера).
Список доступных командлетов в модуле StorageReplica можно вывести так:
Get-Command -Module storagereplica
С помощью команды
Test-SRTopology
вы можете проверить соответствует ли ваш сервер и канал связи технологии Storage Replica. Вы можете оценить текущее количество операций ввода/вывода, пропускную способность сети, размер журналов. Командлет Test-SRTopology генерирует HTML отчет с текущими нагрузками и рекомендациями.
Включим репликацию хранилища D: между двумя отдельными серверами SR1 и SR2 (для логов используется диск L:, размер журнала – 1 Гб):
New-SRPartnership -SourceComputerName SR1 -SourceRGName SR1ReplGroup01 -SourceVolumeName E: -SourceLogVolumeName L: -DestinationComputerName SR2 -DestinationRGName SR2ReplGroup01 -DestinationVolumeName D: -DestinationLogVolumeName E: -LogSizeInBytes 1GB
После включения репликации на вторичном сервере диск с данными становится недоступен для внесения изменений (формат RAW).
Информацию о репликации тома можно получить с помощью дополнительных счетчиков производительности в PerfMon или из PowerShell:
Get-Counter -Counter “Storage Replica Statistics(*)
События репликации томов можно отслеживать в журналах Event Viewer (Applications and Services Logs -> Microsoft -> Windows -> StorageReplica) или из PowerShell:
Get-WinEvent -ProviderName Microsoft-Windows-StorageReplica -max 10
Переключить режим репликации на асинхронный можно командой:
Set-SRPartnership -ReplicationMode Asynchronous
При выходе из строя основного сервера вы можете вручную изменить направление репликации данных, переведя вторичную копию в онлайн режим:
Set-SRPartnership -NewSourceComputerName SR2 -SourceRGName SR2ReplGroup01 -DestinationComputerName SR1 -DestinationRGName SR1ReplGroup01
Для получения информации о состоянии групп и направлении репликации используйте командлеты Get-SRGroup и Get-SRPartnerShip.
Можно проверить длину очереди копирования:
(Get-SRGroup).Replicas | Select-Object numofbytesremaining
Чтобы удалить репликацию:
Get-SRPartnership | Remove-SRPartnership
(только на основном сервере)
Get-SRGroup | Remove-SRGroup
(на обоих серверах)
Вы можете использовать Admin Center для настройки Storage Replication из графического
интерфейса.
Во многих организациях в качестве решения для катастрофоустойчивого хранения данных используется DFS репликация между ЦОД. У SR есть несколько преимуществ перед DFS репликацией: данные копируются на блочном уровне (возможно репликация открытых и используемых файлов, VSS снапшотов), независимость от базы данных (нет необходимости согласования базы данных при старте), быстрая и синхронная репликация (не нужно ждать часы или дни как в DFS). Из недостатков Storage Replica: репликация только 1 к 1, высокие требования к сети и задержкам, без использования кластера используется ручное переключение направления репликации и перенастройка приложений (пользователей) на новый сервер (можно упростить за счет общего DFS namespace).
В Windows Server 2019 Build 17650 Storage Replica доступна и редакции Standard (можно реплицирвать только 1 том до 2 Тб, одному партнеру по репликации. В Datacenter партеров по репликации можен быть несколько). Кроме того, появился режим Test Failover. В этом режиме на партнере создается достпный для записи том-реплика, а репликация прекращается до момента отключения Test Failover (все изменения за время использования этого режима откатываются к снапшоту).
Содержание
- Storage Replica overview
- Why use Storage Replica?
- Supported configurations
- Storage Replica Features
- Storage Replica prerequisites
- Background
- High-level industry terms
- Synchronous replication
- Asynchronous replication
- Key evaluation points and behaviors
- Storage Replica terminology
- What’s new for Storage Replica
- How to Configure Storage Replica in Windows Server 2019
- Prerequisites
- Scenario
- How to Install Storage Replica Feature
- How to Configure Storage Replica
- часто задаваемые вопросы о служба хранилища реплике
- поддерживается ли в Azure реплика служба хранилища?
- Как следить за ходом выполнения репликации при начальной синхронизации?
- Можно ли указать, какие сетевые интерфейсы будут использоваться для репликации?
- Можно ли настроить репликацию «один ко многим» или транзитивную репликацию (A > B > C)?
- Можно ли увеличить или уменьшить размер томов, которые реплицирует реплика хранилища?
- Можно ли настроить для конечного тома веб-доступ в режиме только для чтения?
- Можно ли настроить масштабируемый файловый сервер (SOFS) в растянутом кластере?
- Требуется ли CSV для репликации в кластере Stretch или между кластерами?
- Можно ли настроить локальные дисковые пространства в растянутом кластере с использованием реплики хранилища?
- Как настроить асинхронную репликацию?
- Как запретить автоматическую отработку отказа для растянутого кластера?
- Как отключить устойчивость виртуальной машины?
- Как сократить время начальной синхронизации?
- Можно ли делегировать выполнение репликации пользователям?
- Какие есть варианты резервного копирования и восстановления реплицируемых томов?
- Какие сетевые порты требует реплика хранилища?
- Каковы рекомендации по тому журнала?
- Какие различия между растянутым кластером, межкластерной топологией и межсерверной топологией?
- поддерживается ли дедупликация данных с служба хранилища реплики?
- можно ли выполнять репликацию между Windows Server 2019 и Windows Server 2016?
- Как сообщить о проблемах, связанных с репликой хранилища или этим руководством?
- можно ли настроить репликацию для служба хранилища реплики в обоих направлениях?
- Можно ли разместить диски кластера в режиме обслуживания?
Storage Replica overview
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016
Storage Replica is Windows Server technology that enables replication of volumes between servers or clusters for disaster recovery. It also enables you to create stretch failover clusters that span two sites, with all nodes staying in sync.
Storage Replica supports synchronous and asynchronous replication:
Why use Storage Replica?
Storage Replica allows more efficient use of multiple datacenters. By stretching clusters or replicating clusters, workloads can be run in multiple datacenters for quicker data access by local proximity users and applications, as well as better load distribution and use of compute resources. If a disaster takes one datacenter offline, you can move its typical workloads to the other site temporarily.
Storage Replica also supports asynchronous replication for longer ranges and higher latency networks. Because it is not checkpoint-based, and instead continuously replicates, the delta of changes tends to be far lower than snapshot-based products. Furthermore, Storage Replica operates at the partition layer and therefore replicates all VSS snapshots created by Windows Server or backup software; this allows use of application-consistent data snapshots for point in time recovery, especially unstructured user data replicated asynchronously.
Supported configurations
You can deploy Storage Replica in a stretch cluster, between cluster-to-cluster, and in server-to-server configurations (see Figures 1-3).
Stretch Cluster allows configuration of computers and storage in a single cluster, where some nodes share one set of asymmetric storage and some nodes share another, then synchronously or asynchronously replicate with site awareness. This scenario can utilize Storage Spaces with shared SAS storage, SAN and iSCSI-attached LUNs. It is managed with PowerShell and the Failover Cluster Manager graphical tool, and allows for automated workload failover.
FIGURE 1: Storage replication in a stretch cluster using Storage Replica
Cluster to Cluster allows replication between two separate clusters, where one cluster synchronously or asynchronously replicates with another cluster. This scenario can utilize Storage Spaces Direct, Storage Spaces with shared SAS storage, SAN and iSCSI-attached LUNs. It is managed with Windows Admin Center and PowerShell, and requires manual intervention for failover.
FIGURE 2: Cluster-to-cluster storage replication using Storage Replica
Server to server allows synchronous and asynchronous replication between two standalone servers, using Storage Spaces with shared SAS storage, SAN and iSCSI-attached LUNs, and local drives. It is managed with Windows Admin Center and PowerShell, and requires manual intervention for failover.
FIGURE 3: Server-to-server storage replication using Storage Replica
You can also configure server-to-self replication, using four separate volumes on one computer. However, this guide does not cover this scenario.
Storage Replica Features
Zero data loss, block-level replication. With synchronous replication, there is no possibility of data loss. With block-level replication, there is no possibility of file locking.
Simple deployment and management. Storage Replica has a design mandate for ease of use. Creation of a replication partnership between two servers can utilize the Windows Admin Center. Deployment of stretch clusters uses intuitive wizard in the familiar Failover Cluster Manager tool.
Guest and host. All capabilities of Storage Replica are exposed in both virtualized guest and host-based deployments. This means guests can replicate their data volumes even if running on non-Windows virtualization platforms or in public clouds, as long as using Windows Server in the guest.
Security. Unlike many vendor’s products, Storage Replica has industry-leading security technology baked in. This includes packet signing, AES-128-GCM full data encryption, support for Intel AES-NI encryption acceleration, and pre-authentication integrity man-in-the-middle attack prevention. Storage Replica utilizes Kerberos AES256 for all authentication between nodes.
High performance initial sync. Storage Replica supports seeded initial sync, where a subset of data already exists on a target from older copies, backups, or shipped drives. Initial replication only copies the differing blocks, potentially shortening initial sync time and preventing data from using up limited bandwidth. Storage replicas block checksum calculation and aggregation means that initial sync performance is limited only by the speed of the storage and network.
Consistency groups. Write ordering guarantees that applications such as Microsoft SQL Server can write to multiple replicated volumes and know the data is written on the destination server sequentially.
User delegation. Users can be delegated permissions to manage replication without being a member of the built-in Administrators group on the replicated nodes, therefore limiting their access to unrelated areas.
Network Constraint. Storage Replica can be limited to individual networks by server and by replicated volumes, in order to provide application, backup, and management software bandwidth.
Thin provisioning. Support for thin provisioning in Storage Spaces and SAN devices is supported, in order to provide near-instantaneous initial replication times under many circumstances.
Storage Replica includes the following features:
Feature | Details |
---|---|
Type | Host-based |
Synchronous | Yes |
Asynchronous | Yes |
Storage hardware agnostic | Yes |
Replication unit | Volume (Partition) |
Windows Server stretch cluster creation | Yes |
Server to server replication | Yes |
Cluster to cluster replication | Yes |
Transport | SMB3 |
Network | TCP/IP or RDMA |
Network constraint support | Yes |
RDMA* | iWARP, InfiniBand, RoCE v2 |
Replication network port firewall requirements | Single IANA port (TCP 445 or 5445) |
Multipath/Multichannel | Yes (SMB3) |
Kerberos support | Yes (SMB3) |
Over the wire encryption and signing | Yes (SMB3) |
Per-volume failovers allowed | Yes |
Thin-provisioned storage support | Yes |
Management UI in-box | PowerShell, Failover Cluster Manager |
*May require additional long haul equipment and cabling.
Storage Replica prerequisites
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:
Background
This section includes information about high-level industry terms, synchronous and asynchronous replication, and key behaviors.
High-level industry terms
Disaster Recovery (DR) refers to a contingency plan for recovering from site catastrophes so that the business continues to operate. Data DR means multiple copies of production data in a separate physical location. For example, a stretch cluster, where half the nodes are in one site and half are in another. Disaster Preparedness (DP) refers to a contingency plan for preemptively moving workloads to a different location prior to an oncoming disaster, such as a hurricane.
Service level agreements (SLAs) define the availability of a business’ applications and their tolerance of down time and data loss during planned and unplanned outages. Recovery Time Objective (RTO) defines how long the business can tolerate total inaccessibility of data. Recovery Point Objective (RPO) defines how much data the business can afford to lose.
Synchronous replication
Synchronous replication guarantees that the application writes data to two locations at once before completion of the IO. This replication is more suitable for mission critical data, as it requires network and storage investments, as well as a risk of degraded application performance.
When application writes occur on the source data copy, the originating storage does not acknowledge the IO immediately. Instead, those data changes replicate to the remote destination copy and return an acknowledgement. Only then does the application receive the IO acknowledgment. This ensures constant synchronization of the remote site with the source site, in effect extending storage IOs across the network. In the event of a source site failure, applications can failover to the remote site and resume their operations with assurance of zero data loss.
Mode | Diagram | Steps |
---|---|---|
Synchronous
RPO |
1. Application writes data 2. Log data is written and the data is replicated to the remote site 3. Log data is written at the remote site 4. Acknowledgement from the remote site 5. Application write acknowledged t & t1 : Data flushed to the volume, logs always write through |
Asynchronous replication
Contrarily, asynchronous replication means that when the application writes data, that data replicates to the remote site without immediate acknowledgment guarantees. This mode allows faster response time to the application as well as a DR solution that works geographically.
When the application writes data, the replication engine captures the write and immediately acknowledges to the application. The captured data then replicates to the remote location. The remote node processes the copy of the data and lazily acknowledges back to the source copy. Since replication performance is no longer in the application IO path, the remote site’s responsiveness and distance are less important factors. There is risk of data loss if the source data is lost and the destination copy of the data was still in buffer without leaving the source.
With its higher than zero RPO, asynchronous replication is less suitable for HA solutions like Failover Clusters, as they are designed for continuous operation with redundancy and no loss of data.
Mode | Diagram | Steps |
---|---|---|
Asynchronous
Near zero data loss (depends on multiple factors) RPO |
1. Application writes data 2. Log data written 3. Application write acknowledged 4. Data replicated to the remote site 5. Log data written at the remote site 6. Acknowledgement from the remote site t & t1 : Data flushed to the volume, logs always write through |
Key evaluation points and behaviors
Network bandwidth and latency with fastest storage. There are physical limitations around synchronous replication. Because Storage Replica implements an IO filtering mechanism using logs and requiring network round trips, synchronous replication is likely make application writes slower. By using low latency, high-bandwidth networks as well as high-throughput disk subsystems for the logs, you minimize performance overhead.
The destination volume is not accessible while replicating in Windows Server 2016. When you configure replication, the destination volume dismounts, making it inaccessible to any reads or writes by users. Its driver letter may be visible in typical interfaces like File Explorer, but an application cannot access the volume itself. Block-level replication technologies are incompatible with allowing access to the destination target’s mounted file system in a volume; NTFS and ReFS do not support users writing data to the volume while blocks change underneath them.
The Test-Failover cmdlet debuted in Windows Server, version 1709, and was also included in Windows Server 2019. This now supports temporarily mounting a read-write snapshot of the destination volume for backups, testing, etc. See https://aka.ms/srfaq for more info.
The Microsoft implementation of asynchronous replication is different than most. Most industry implementations of asynchronous replication rely on snapshot-based replication, where periodic differential transfers move to the other node and merge. Storage Replica asynchronous replication operates just like synchronous replication, except that it removes the requirement for a serialized synchronous acknowledgment from the destination. This means that Storage Replica theoretically has a lower RPO as it continuously replicates. However, this also means it relies on internal application consistency guarantees rather than using snapshots to force consistency in application files. Storage Replica guarantees crash consistency in all replication modes
Storage Replica is not a backup solution. Some IT environments deploy replication systems as backup solutions, due to their zero data loss options when compared to daily backups. Storage Replica replicates all changes to all blocks of data on the volume, regardless of the change type. If a user deletes all data from a volume, Storage Replica replicates the deletion instantly to the other volume, irrevocably removing the data from both servers. Do not use Storage Replica as a replacement for a point-in-time backup solution.
Storage Replica is not Hyper-V Replica or Microsoft SQL AlwaysOn Availability Groups. Storage Replica is a general purpose, storage-agnostic engine. By definition, it cannot tailor its behavior as ideally as application-level replication. This may lead to specific feature gaps that encourage you to deploy or remain on specific application replication technologies.
This document contains a list of known issues and expected behaviors as well as Frequently Asked Questions section.
Storage Replica terminology
This guide frequently uses the following terms:
The source is a computer’s volume that allows local writes and replicates outbound. Also known as «primary».
The destination is a computer’s volume that does not allow local writes and replicates inbound. Also known as «secondary».
A replication partnership is the synchronization relationship between a source and destination computer for one or more volumes and utilizes a single log.
A replication group is the organization of volumes and their replication configuration within a partnership, on a per server basis. A group may contain one or more volumes.
What’s new for Storage Replica
For a list of new features in Storage Replica in Windows Server 2019, see What’s new in storage
Источник
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:
From the other base on Microsoft Docs Storage Replica hasn’t any of these disadvantages but maybe it doesn’t suitable for any environment.
Another one important factor that you must know for the Storage Replica is what replication types support.
Prerequisites
Before start to use Replica Storage you must read very careful all the prerequisites base on Microsoft Docs Storage Replica overview
Scenario
What i have use to test Storage Replication before apply in a Production Environment
How to Install Storage Replica Feature
Now we are ready to proceed with the installation of Storage Replica Feature in both Servers.
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
Which are the steps that must follow?
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.
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.
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.
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
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
Get-SRPartnership | Remove-SRPartnership –confirm:$false
Remove-SRGroup –Name rg1
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.
Источник
часто задаваемые вопросы о служба хранилища реплике
Применяется к: Windows Server 2019, Windows Server 2016
В этой статье содержатся ответы на часто задаваемые вопросы о реплике хранилища.
поддерживается ли в Azure реплика служба хранилища?
Да. В Azure можно использовать следующие сценарии:
Дополнительные замечания о кластеризации гостевых систем в Azure можно найти здесь: развертывание гостевых кластеров виртуальных машин IaaS в Microsoft Azure.
Как следить за ходом выполнения репликации при начальной синхронизации?
Сообщения о событии 1237, которые отображаются в журнале административных событий реплики хранилища на конечном сервере каждые 10 секунд, информируют о количестве скопированных и оставшихся байт. Также можно использовать счетчик производительности реплики хранилища на узле назначения, который отображает общее количество полученных байтов для одного или нескольких реплицируемых томов (Storage Replica StatisticsTotal Bytes Received). Еще можно с помощью Windows PowerShell отправить запрос к группе репликации. Так, команда из этого примера возвращает имена групп на целевом компьютере, а затем каждые 10 секунд запрашивает одну группу с именем Replication 2 и отображает ход выполнения задания:
Можно ли указать, какие сетевые интерфейсы будут использоваться для репликации?
Запишите сведения о шлюзе и интерфейсе (на обоих серверах), а также информацию о направлениях партнерства. Далее выполните:
Чтобы настроить сетевые ограничения для растянутого кластера, выполните:
Можно ли настроить репликацию «один ко многим» или транзитивную репликацию (A > B > C)?
нет, служба хранилища реплика поддерживает только одну репликацию сервера, кластера или узла растянутого кластера. Возможно, ситуация изменится в более поздней версии. Конечно, вы можете настроить репликацию в любом направлении между разными серверами определенной пары томов. Например, сервер 1 может реплицировать свой том D на сервер 2, а свой том E — с сервера 3.
Можно ли увеличить или уменьшить размер томов, которые реплицирует реплика хранилища?
Можно ли настроить для конечного тома веб-доступ в режиме только для чтения?
Не в Windows Server 2016. Реплика хранилища отключает конечный том, когда начинается репликация.
однако в Windows server 2019 и Windows server Semi-Annual, начиная с версии 1709, возможность подключения целевого хранилища теперь возможна. эта функция называется тестовой отработкой отказа. Для этого потребуется неиспользуемый том, отформатированный в файловой системе NTFS или ReFS, который на данный момент не реплицируется в конечной системе. Затем можно временно подключить моментальный снимок реплицированного хранилища для тестирования или резервного копирования.
Например, для проведения тестовой отработки отказа с репликацией тома на диске «D:» в группе репликации «RG2» на конечном сервере «SRV2» и создания нереплицируемого диска «T:» на сервере SRV2 нужно сделать следующее.
Теперь реплицированный том D: доступен на сервере SRV2. Вы можете выполнять чтение и запись в обычном режиме, копировать файлы из нее или запускать оперативную архивацию, которую можно сохранить в любом расположении в папке D: path. Том T: будет содержать только данные журнала.
Для удаления моментального снимка тестовой отработки отказа и отмены внесенных им изменений сделайте следующее.
Тестовую отработку отказа следует использовать только для коротких временных операций. Эта возможность не предназначена для длительного использования. Во время использования этой возможности продолжается репликация на реальный конечный том.
Можно ли настроить масштабируемый файловый сервер (SOFS) в растянутом кластере?
Хотя технически это возможно, это не рекомендуемая конфигурация из-за отсутствия сведений о сайтах на узлах вычислений, которые с SOFS. При использовании сети на территории университета, где задержки обычно являются вспомогательными миллисекундами, такая конфигурация обычно работает без проблем.
Для сценариев межкластерной репликации реплика хранилища полностью поддерживает масштабируемые файловые серверы, в том числе использование локальных дисковых пространств при репликации между двумя кластерами.
Требуется ли CSV для репликации в кластере Stretch или между кластерами?
Нет. Репликацию можно выполнять с помощью CSV-или постоянного резервирования (Народно), принадлежащего ресурсу кластера, например роли файлового сервера.
Для сценариев межкластерной репликации реплика хранилища полностью поддерживает масштабируемые файловые серверы, в том числе использование локальных дисковых пространств при репликации между двумя кластерами.
Можно ли настроить локальные дисковые пространства в растянутом кластере с использованием реплики хранилища?
эта конфигурация не поддерживается в Windows Server. Возможно, ситуация изменится в более поздней версии. Для сценариев межкластерной репликации реплика хранилища полностью поддерживает масштабируемые файловые серверы и серверы Hyper-V, в том числе использование локальных дисковых пространств.
Как настроить асинхронную репликацию?
Как запретить автоматическую отработку отказа для растянутого кластера?
Как отключить устойчивость виртуальной машины?
Чтобы предотвратить запуск новой функции устойчивости виртуальных машин Hyper-V, а затем приостановить виртуальные машины, а не отключать их на сайт аварийного восстановления, выполните команду (Get-Cluster).ResiliencyDefaultPeriod=0
Как сократить время начальной синхронизации?
Для ускорения процесса начальной синхронизации можно использовать хранилище с тонкой подготовкой. Реплика хранилища запрашивает и автоматически использует хранилища с тонкой подготовкой, в том числе некластеризованные дисковые пространства, динамические диски Hyper-V и SAN LUN.
Можно ли делегировать выполнение репликации пользователям?
Можно использовать Grant-SRDelegation командлет. Он позволяет назначить сценарии межсерверной и межкластерной репликации, а также репликации растянутого кластера конкретным пользователям, которые получат разрешения на создание, изменение или удаление репликации, не являясь при этом членами группы локальных администраторов. Пример:
Какие есть варианты резервного копирования и восстановления реплицируемых томов?
Чтобы создавать для реплицируемых томов данных периодические моментальные снимки, согласованные на уровне приложений, можно запустить VSSADMIN.EXE на исходном сервере. Например, если вы используете реплику хранилища для репликации тома F:, выполите:
Затем вы сможете восстановить такой моментальный снимок до состояния на момент времени на том же исходном томе или на томе назначения (для этого переключите направление репликации или удалите репликацию). Пример команд для того же тома F:
Можно также настроить периодический запуск этого средства с помощью запланированной задачи. Дополнительные сведения об использовании VSS см. здесь: Vssadmin. Нет никакой необходимости или пользы в резервном копировании томов журналов. VSS будет игнорировать такие попытки.
Реплика хранилища поддерживает использование архивации данных Windows Server, службы архивации Microsoft Azure, Microsoft DPM и других технологий резервного копирования, использующих моментальные снимки, VSS, виртуальные машины или файлы, при условии, что эти технологии работают на уровне тома. Реплика хранилища не поддерживает резервное копирование и восстановление на основе блоков.
Какие сетевые порты требует реплика хранилища?
Для репликации и управления реплика хранилища использует протоколы SMB и WSMAN. Это означает, что требуются следующие порты:
Для командлета Test-SRTopology требуется ICMPv4/ICMPv6, но не для репликации или управления.
Каковы рекомендации по тому журнала?
Оптимальный размер журнала изменяется в зависимости от среды и рабочей нагрузки и определяется объемом операций ввода-вывода, выполняемых рабочей нагрузкой.
Журнал большего размера просто накапливает в себе больше операций ввода-вывода, прежде чем они будут перенесены. За счет этого допустимо более длительное прерывание в работе службы между исходным и конечным компьютером (например, сбой сети или отключение конечного компьютера от сети). Если размера журнала достаточно для хранения 10 часов операций записи и в работе сети происходит сбой продолжительностью 2 часа, при восстановлении сетевого подключения исходный компьютер может просто передать разницу в объемах несинхронизированных изменений обратно на целевой компьютер, после чего защита будет очень быстро восстановлена. Если журнал содержит 10 часов операций записи, а продолжительность сбоя составляет 2 дня, исходному компьютеру придется считывать данные из другого журнала, называемого битовой картой, и восстановление синхронизированного состояния, скорее всего, будет происходить медленнее. После перехода в синхронный режим исходный компьютер вернется к использованию журнала.
Реплика хранилища зависит от журнала для всей производительности записи. Производительность журнала является критически важной для производительности репликации. Необходимо убедиться, что том журнала работает лучше, чем том данных, так как журнал будет определять порядок следования всех операций ввода-вывода, а также выполнять их сериализацию. На томах журнала следует всегда использовать носители на основе флэш-памяти, например SSD. Не следует разрешать другие задачи для выполнения на томе журнала. Аналогично, не разрешайте другие задачи для выполнения на томах журнала базы данных SQL.
Следует помнить, что корпорация Майкрософт настоятельно рекомендует, чтобы хранилище журналов работало быстрее, чем хранилище данных, и никогда не использовать тома журналов для других рабочих нагрузок.
Чтобы получить рекомендации по выбору размера журнала, запустите средство Test-SRTopology. Кроме того, можно использовать счетчики производительности на существующих серверах, чтобы определить размер журнала. Формула проста: проследите за пропускной способностью диска данных (среднее число записанных байт/с) в рабочей нагрузке и используйте ее для вычисления времени, затрачиваемого на заполнение журнала различных размеров. Например, пропускная способность диска данных 50 МБ/с приведет к переносу журнала в 120 ГБ на 50 МБ секунд или 2400 секунд или 40 минут. Таким образом, время, в течение которого целевой сервер может быть недоступен, прежде чем заносить в журнал 40 минут. Если журнал переносится в оболочку, но место назначения снова станет доступным, источник будет воспроизводить блоки через журнал битовой схемы, а не основной журнал. Размер журнала не влияет на производительность.
Необходимо создать резервную копию только диска данных из исходного кластера. не следует создавать резервные копии дисков журналов служба хранилища реплики, так как резервное копирование может конфликтовать с операциями служба хранилища реплики.
Какие различия между растянутым кластером, межкластерной топологией и межсерверной топологией?
служба хранилища Реплика состоит из трех основных конфигураций: растяжение кластера, кластера в кластер и сервера на сервер. Каждая конфигурация обладает своими преимуществами.
Топология растянутого кластера оптимально подходит для рабочих нагрузок, требующих автоматической отработки отказа с оркестрацией, например для кластеров частного облака Hyper-V и экземпляров отказоустойчивого кластера SQL Server. Она также имеет встроенный графический интерфейс, работающий на базе диспетчера отказоустойчивости кластеров. В этой топологии используется классическая архитектура общего хранилища асимметричного кластера для дисковых пространств, SAN, iSCSI и RAID через постоянное резервирование. Для выполнения этого кластера достаточно двух узлов.
В основе межкластерной топологии лежат два отдельных кластера, и она идеально подходит для администраторов, которые предпочитают выполнять отработку отказов вручную, особенно в том случае, когда второй узел подготовлен для аварийного восстановления, а не повседневного использования. Оркестрация выполняется вручную. в отличие от растянутого кластера дисковые пространства Direct можно использовать в этой конфигурации (с предупреждениями — см. раздел часто задаваемые вопросы о служба хранилища реплике и документации кластера в кластер). Для выполнения этого кластера достаточно четырех узлов.
Межсерверная топология оптимально подходит для клиентов, запускающих оборудование, которое нельзя объединить в кластеры. В рамках этой конфигурации отработка отказа и оркестрация выполняются вручную. Это идеальное решение для недорогого развертывания между филиалами и центральными центрами обработки данных, особенно при использовании асинхронной репликации. Эту конфигурацию можно часто использовать для замены экземпляров DFSR-защищенных файловых серверов, используемых для монопольных сценариев аварийного восстановления.
Во всех конфигурациях топологии поддерживают выполнение как на физическом оборудовании, так и на виртуальных машинах. При выполнении на виртуальных машинах базовым гипервизором не обязательно должен быть гипервизор Hyper-V; это может быть гипервизор VMware, KVM, Xen и т. д.
Реплика хранилища также поддерживает односерверный режим, в котором репликация выполняется на двух разных томах на одном компьютере.
поддерживается ли дедупликация данных с служба хранилища реплики?
да, дедуплкатион данных поддерживается в реплике служба хранилища. Включите дедупликацию данных на томе исходного сервера, и во время репликации целевой сервер получает дублирующуюся копию тома.
Хотя дедупликация данных должна быть установлена как на исходном, так и на целевом серверах (см. раздел Установка и включение дедупликации данных), важно не включать дедупликацию данных на целевом сервере. служба хранилища Реплика разрешает операции записи только на исходном сервере. Так как дедупликация данных делает запись в том, она должна выполняться только на исходном сервере.
можно ли выполнять репликацию между Windows Server 2019 и Windows Server 2016?
к сожалению, мы не поддерживаем создание новой связи между Windows Server 2019 и Windows Server 2016. вы можете безопасно обновить сервер или кластер, на котором работает Windows Server 2016, Windows server 2019, и все существующие партнерства будут продолжать работать.
тем не менее, чтобы повысить производительность репликации Windows server 2019, все участники партнерства должны запустить Windows server 2019, и необходимо удалить существующие партнерства и связанные группы репликации, а затем повторно создать их с заполненными данными (при создании партнерства в центре администрирования Windows или с помощью командлета New-SRPartnership).
Как сообщить о проблемах, связанных с репликой хранилища или этим руководством?
техническая помощь по служба хранилища реплике можно отправить на форумах майкрософт. Также любые вопросы и сообщения, srfeed@microsoft.com имеющие отношение к реплике хранилища или этой документации, можно отправить по электронной почте на адрес. основной сайт обратной связи сервера Windows является предпочтительным для запросов на изменение структуры, так как он позволяет вашим клиентам предоставлять вам поддержку и отзывы о своих идеях.
можно ли настроить репликацию для служба хранилища реплики в обоих направлениях?
служба хранилища Реплика является односторонней технологией репликации. Репликация будет осуществляться только из источника в назначение на уровне каждого тома. Это направление может быть отменено в любое время, но по-прежнему доступно только в одном направлении. Однако это не значит, что набор томов (источник и назначение) реплицируется в одном направлении, а другой набор дисков (источник и назначение) реплицируется в обратном направлении. Например, необходимо настроить репликацию сервера на сервер. Server1 и Server2 имеют буквы L:, M:, N: и O: и вы хотите реплицировать диск M: с Server1 на Server2, но диск O: репликация с Server2 на Server1. Это можно сделать при условии, что для каждой группы существует отдельный диск журнала. такого.
Можно ли разместить диски кластера в режиме обслуживания?
служба хранилища Реплика будет блокировать переход всех дисков кластера в режим обслуживания. Для таких задач, как включение или отключение BitLocker, диски должны находиться в режиме обслуживания. Для выполнения задач, требующих, чтобы диски были в режиме обслуживания, необходимо сначала разорушить связь и создать ее снова после завершения.
Источник
description | title | manager | ms.author | ms.topic | author | ms.date | ms.assetid |
---|---|---|---|---|---|---|---|
Learn more about: Storage Replica overview |
Storage Replica Overview |
siroy |
stevenek |
how-to |
StevenEk |
10/04/2022 |
e9b18e14-e692-458a-a39f-d5b569ae76c5 |
Storage Replica overview
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016
Storage Replica is Windows Server technology that enables replication of volumes between servers or clusters for disaster recovery. It also enables you to create stretch failover clusters that span two sites, with all nodes staying in sync.
Storage Replica supports synchronous and asynchronous replication:
- 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.
Why use Storage Replica?
Storage Replica offers disaster recovery and preparedness capabilities in Windows Server. Windows Server offers the peace of mind of zero data loss, with the ability to synchronously protect data on different racks, floors, buildings, campuses, counties, and cities. After a disaster strikes, all data exists elsewhere without any possibility of loss. The same applies before a disaster strikes; Storage Replica offers you the ability to switch workloads to safe locations prior to catastrophes when granted a few moments warning — again, with no data loss.
Storage Replica allows more efficient use of multiple datacenters. By stretching clusters or replicating clusters, workloads can be run in multiple datacenters for quicker data access by local proximity users and applications, as well as better load distribution and use of compute resources. If a disaster takes one datacenter offline, you can move its typical workloads to the other site temporarily.
Storage Replica may allow you to decommission existing file replication systems such as DFS Replication that were pressed into duty as low-end disaster recovery solutions. While DFS Replication works well over low bandwidth networks, its latency is high — often measured in hours or days. This is caused by its requirement for files to close and its artificial throttles meant to prevent network congestion. With those design characteristics, the newest and hottest files in a DFS Replication replica are the least likely to replicate. Storage Replica operates below the file level and has none of these restrictions.
Storage Replica also supports asynchronous replication for longer ranges and higher latency networks. Because it isn’t checkpoint-based, and instead continuously replicates, the delta of changes tends to be far lower than snapshot-based products. Storage Replica operates at the partition layer and therefore replicates all VSS snapshots created by Windows Server or backup software. By using VSS snapshots it allows use of application-consistent data snapshots for point in time recovery, especially unstructured user data replicated asynchronously.
Supported configurations
You can deploy Storage Replica in a stretch cluster, between cluster-to-cluster, and in server-to-server configurations (see Figures 1-3).
Stretch Cluster allows configuration of computers and storage in a single cluster, where some nodes share one set of asymmetric storage and some nodes share another, then synchronously or asynchronously replicate with site awareness. This scenario can utilize Storage Spaces with shared SAS storage, SAN and iSCSI-attached LUNs. It’s managed with PowerShell and the Failover Cluster Manager graphical tool, and allows for automated workload failover.
FIGURE 1: Storage replication in a stretch cluster using Storage Replica
Cluster to Cluster allows replication between two separate clusters, where one cluster synchronously or asynchronously replicates with another cluster. This scenario can utilize Storage Spaces Direct, Storage Spaces with shared SAS storage, SAN and iSCSI-attached LUNs. It’s managed with Windows Admin Center and PowerShell, and requires manual intervention for failover.
FIGURE 2: Cluster-to-cluster storage replication using Storage Replica
Server to server allows synchronous and asynchronous replication between two standalone servers, using Storage Spaces with shared SAS storage, SAN and iSCSI-attached LUNs, and local drives. It’s managed with Windows Admin Center and PowerShell, and requires manual intervention for failover.
FIGURE 3: Server-to-server storage replication using Storage Replica
[!NOTE]
You can also configure server-to-self replication, using four separate volumes on one computer. However, this guide does not cover this scenario.
Storage Replica Features
-
Zero data loss, block-level replication. With synchronous replication, there’s no possibility of data loss. With block-level replication, there’s no possibility of file locking.
-
Simple deployment and management. Storage Replica has a design mandate for ease of use. Creation of a replication partnership between two servers can utilize the Windows Admin Center. Deployment of stretch clusters uses intuitive wizard in the familiar Failover Cluster Manager tool.
-
Guest and host. All capabilities of Storage Replica are exposed in both virtualized guest and host-based deployments. This means guests can replicate their data volumes even if running on non-Windows virtualization platforms or in public clouds, as long as using Windows Server in the guest.
-
SMB3-based. Storage Replica uses the proven and mature technology of SMB 3, first released in Windows Server 2012. This means all of SMB’s advanced characteristics — such as multichannel and SMB direct support on RoCE, iWARP, and InfiniBand RDMA network cards — are available to Storage Replica.
-
Security. Unlike many vendor’s products, Storage Replica has industry-leading security technology baked in. This includes packet signing, AES-128-GCM full data encryption, support for Intel AES-NI encryption acceleration, and pre-authentication integrity man-in-the-middle attack prevention. Storage Replica utilizes Kerberos AES256 for all authentication between nodes.
-
High performance initial sync. Storage Replica supports seeded initial sync, where a subset of data already exists on a target from older copies, backups, or shipped drives. Initial replication only copies the differing blocks, potentially shortening initial sync time and preventing data from using up limited bandwidth. Storage replicas block checksum calculation and aggregation means that initial sync performance is limited only by the speed of the storage and network.
-
Consistency groups. Write ordering guarantees that applications such as Microsoft SQL Server can write to multiple replicated volumes and know the data is written on the destination server sequentially.
-
User delegation. Users can be delegated permissions to manage replication without being a member of the built-in Administrators group on the replicated nodes, therefore limiting their access to unrelated areas.
-
Network Constraint. Storage Replica can be limited to individual networks by server and by replicated volumes, in order to provide application, backup, and management software bandwidth.
-
Thin provisioning. Support for thin provisioning in Storage Spaces and SAN devices is supported in order to provide near-instantaneous initial replication times under many circumstances. Once initial replication is initiated, the volume won’t be able to shrink or trim
-
Compression. Storage Replica offers compression for data transferred over the network between
the source and destination server. Storage Replica Compression for Data Transfer is only supported in
Windows Server Datacenter: Azure Edition beginning with OS build 20348.1070 and later
(KB5017381).
Storage Replica includes the following features:
Feature | Details |
---|---|
Type | Host-based |
Synchronous | Yes |
Asynchronous | Yes |
Storage hardware agnostic | Yes |
Replication unit | Volume (Partition) |
Windows Server stretch cluster creation | Yes |
Server to server replication | Yes |
Cluster to cluster replication | Yes |
Transport | SMB3 |
Network | TCP/IP or RDMA |
Network constraint support | Yes |
Network compression | Yes** |
RDMA* | iWARP, InfiniBand, RoCE v2 |
Replication network port firewall requirements | Single IANA port (TCP 445 or 5445) |
Multipath/Multichannel | Yes (SMB3) |
Kerberos support | Yes (SMB3) |
Over the wire encryption and signing | Yes (SMB3) |
Per-volume failovers allowed | Yes |
Thin-provisioned storage support | Yes |
Management UI in-box | PowerShell, Failover Cluster Manager |
*May require additional long haul equipment and cabling.
**When using Windows Server Datacenter: Azure Edition beginning with OS build 20348.1070
Storage Replica prerequisites
-
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 is 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 2 GB of RAM and two cores per server.
-
A network between servers with enough bandwidth to contain your IO write workload and an average of 5 ms round trip latency or lower, for synchronous replication. Asynchronous replication doesn’t 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.
Background
This section includes information about high-level industry terms, synchronous and asynchronous replication, and key behaviors.
High-level industry terms
Disaster Recovery (DR) refers to a contingency plan for recovering from site catastrophes so that the business continues to operate. Data DR means multiple copies of production data in a separate physical location. For example, a stretch cluster, where half the nodes are in one site and half are in another. Disaster Preparedness (DP) refers to a contingency plan for preemptively moving workloads to a different location prior to an oncoming disaster, such as a hurricane.
Service level agreements (SLAs) define the availability of a business’ applications and their tolerance of down time and data loss during planned and unplanned outages. Recovery Time Objective (RTO) defines how long the business can tolerate total inaccessibility of data. Recovery Point Objective (RPO) defines how much data the business can afford to lose.
Synchronous replication
Synchronous replication guarantees that the application writes data to two locations at once before completion of the IO operation. This replication is more suitable for mission critical data, as it requires network and storage investments, and risks degraded application performance by needing to perform writes in two locations.
When application writes occur on the source data copy, the originating storage doesn’t acknowledge the IO immediately. Instead, those data changes replicate to the remote destination copy and return an acknowledgment. Only then does the application receive the IO acknowledgment. This ensures constant synchronization of the remote site with the source site, in effect extending storage IOs across the network. In the event of a source site failure, applications can fail over to the remote site and resume their operations with assurance of zero data loss.
Mode | Diagram | Steps |
---|---|---|
Synchronous
Zero Data Loss RPO |
1. Application writes data 2. Log data is written and the data is replicated to the remote site 3. Log data is written at the remote site 4. Acknowledgment from the remote site 5. Application write acknowledged t & t1 : Data flushed to the volume, logs always write through |
Asynchronous replication
Contrarily, asynchronous replication means that when the application writes data, that data replicates to the remote site without immediate acknowledgment guarantees. This mode allows faster response time to the application and a DR solution that works geographically.
When the application writes data, the replication engine captures the write and immediately acknowledges to the application. The captured data then replicates to the remote location. The remote node processes the copy of the data and lazily acknowledges back to the source copy. Since replication performance is no longer in the application IO path, the remote site’s responsiveness and distance are less important factors. There’s risk of data loss if the source data is lost and the destination copy of the data was still in buffer without leaving the source.
With its higher than zero RPO, asynchronous replication is less suitable for HA solutions like Failover Clusters, as they’re designed for continuous operation with redundancy and no loss of data.
Mode | Diagram | Steps |
---|---|---|
Asynchronous
Near zero data loss (depends on multiple factors) RPO |
1. Application writes data 2. Log data written 3. Application write acknowledged 4. Data replicated to the remote site 5. Log data written at the remote site 6. Acknowledgment from the remote site t & t1 : Data flushed to the volume, logs always write through |
Key evaluation points and behaviors
-
Network bandwidth and latency with fastest storage. There are physical limitations around synchronous replication. Because Storage Replica implements an IO filtering mechanism using logs and requiring network round trips, synchronous replication is likely make application writes slower. By using low latency, high-bandwidth networks, and high-throughput disk subsystems for the logs, you minimize performance overhead.
-
The destination volume isn’t accessible while replicating in Windows Server 2016. When you configure replication, the destination volume dismounts, making it inaccessible to any reads or writes by users. Its driver letter may be visible in typical interfaces like File Explorer, but an application can’t access the volume itself. Block-level replication technologies are incompatible with allowing access to the destination target’s mounted file system in a volume. NTFS and ReFS don’t support users writing data to the volume while blocks change underneath them.
The Test-Failover cmdlet debuted in Windows Server, version 1709, and was also included in Windows Server 2019. This now supports temporarily mounting a read-write snapshot of the destination volume for backups, testing, etc. See Frequently asked questions about Storage Replica for more info.
-
The Microsoft implementation of asynchronous replication is different than most. Most industry implementations of asynchronous replication rely on snapshot-based replication, where periodic differential transfers move to the other node and merge. Storage Replica asynchronous replication operates just like synchronous replication, except that it removes the requirement for a serialized synchronous acknowledgment from the destination. This means that Storage Replica theoretically has a lower RPO as it continuously replicates. However, this also means it relies on internal application consistency guarantees rather than using snapshots to force consistency in application files. Storage Replica guarantees crash consistency in all replication modes
-
Many customers use DFS Replication as a disaster recovery solution even though often impractical for that scenario — DFS Replication can’t replicate open files and is designed to minimize bandwidth usage at the expense of performance, leading to large recovery point deltas. Storage Replica may allow you to retire DFS Replication from some of these types of disaster recovery duties.
-
Storage Replica isn’t a backup solution. Some IT environments deploy replication systems as backup solutions, due to their zero data loss options when compared to daily backups. Storage Replica replicates all changes to all blocks of data on the volume, regardless of the change type. If a user deletes all data from a volume, Storage Replica replicates the deletion instantly to the other volume, irrevocably removing the data from both servers. Don’t use Storage Replica as a replacement for a point-in-time backup solution.
-
Storage Replica isn’t Hyper-V Replica or Microsoft SQL AlwaysOn Availability Groups. Storage Replica is a general purpose, storage-agnostic engine. By definition, it can’t tailor its behavior as ideally as application-level replication. This may lead to specific feature gaps that encourage you to deploy or remain on specific application replication technologies.
[!NOTE]
This document contains a list of known issues and expected behaviors as well as Frequently Asked Questions section.
Storage Replica terminology
This guide frequently uses the following terms:
-
The source is a computer’s volume that allows local writes and replicates outbound. Also known as «primary».
-
The destination is a computer’s volume that doesn’t allow local writes and replicates inbound. Also known as «secondary».
-
A replication partnership is the synchronization relationship between a source and destination computer for one or more volumes and utilizes a single log.
-
A replication group is the organization of volumes and their replication configuration within a partnership, on a per server basis. A group may contain one or more volumes.
What’s new for Storage Replica
For a list of new features in Storage Replica in Windows Server 2019, see What’s new in storage
More information
- Stretch Cluster Replication Using Shared Storage
- Server to Server Storage Replication
- Cluster to Cluster Storage Replication
- Storage Replica: Known Issues
- Storage Replica: Frequently Asked Questions
- Storage Spaces Direct in Windows Server 2016
- Windows IT Pro Support
This blog post is cross posted on arnaudpain.com and tech-addict.fr, as we (Arnaud Pain and Samuel Legrand) have decided to work together to present this topic in mulitple events in 2019.
We have decided to work on this presentation to help users understand how they can rely on Microsoft for their data protection.
Here after some more information on the implementation and our feedback.
What is Storage Replica
Storage Replica is Windows Server technology that enables replication of volumes between servers or clusters for disaster recovery. It also enables you to create stretch failover clusters that span two sites, with all nodes staying in sync.
Supported configurations
Stretch Cluster allows configuration of computers and storage in a single cluster, where some nodes share one set of asymmetric storage and some nodes share another, then synchronously or asynchronously replicate with site awareness. This scenario can utilize Storage Spaces with shared SAS storage, SAN and iSCSI-attached LUNs. It is managed with PowerShell and the Failover Cluster Manager graphical tool, and allows for automated workload failover.
Cluster to Cluster allows replication between two separate clusters, where one cluster synchronously or asynchronously replicates with another cluster. This scenario can utilize Storage Spaces Direct, Storage Spaces with shared SAS storage, SAN and iSCSI-attached LUNs. It is managed with Windows Admin Center and PowerShell, and requires manual intervention for failover.
Server to server allows synchronous and asynchronous replication between two standalone servers, using Storage Spaces with shared SAS storage, SAN and iSCSI-attached LUNs, and local drives. It is managed with Windows Admin Center and PowerShell, and requires manual intervention for failover.
The Lab
We decided to work with a Cluster to Cluster configuration for the purpose of this article with:
- 2 Datacenter : 1 in USA and 1 in France
- VPN connection between DC using pfSense
- 1 Host with VMware 6.7 U1 in each DC
- 1 AD + 2 SSD servers in each DC
Storage Spaces Direct Installation
First of all you will need to define if you want to use a File Share Witness or Cloud Witness for the cluster:
- Cloud Witness
- File Share Witness
As we decided to use a Cloud Witness Account, there are some prerequisites on the SSD servers. Run the following commands in an Elevated PoSH on each node:
Install NuGet Repo: Find-Module -Repository PSGallery -Verbose -Name NuGet
Install Azure Module: Install-Module Az
You will then need to restart each nodes
Here after are the PoSH commands to run
$nodes = ("server-1", "server-2”)
icm $nodes {Install-WindowsFeature Failover-Clustering -IncludeAllSubFeature -IncludeManagementTools}
icm $nodes {Install-WindowsFeature FS-FileServer}
Restart each node
Test-Cluster -node $nodes
New-Cluster -Name Cluster-Name -Node $nodes –NoStorage –StaticAddress Cluster-IP
Connect-AzAccount
Set-ClusterQuorum –CloudWitness –AccountName Cloud-Witness-Account -AccessKey Key-1
Enable-ClusterS2D -SkipEligibilityChecks
New-Volume -StoragePoolFriendlyName S2D* -FriendlyName US-Storage -FileSystem CSVFS_REFS -Size 30GB
New-Volume -StoragePoolFriendlyName S2D* -FriendlyName US-Storage-Logs -FileSystem ReFS -Size 5GB
Get-ClusterSharedVolume
Restart each node
SOFS Role Configuration
We will install the Scale-Out File Server role, however it requires some stuff to be done before. In fact, you will need to ensure that the created Cluster has the permission to create Computer on the OU where it resides:
Here after the steps to install SOFS role
After the installation of the SOFS role, the next step is to create File Share, however based on you configuration you will need to wait replication to occur before continuing.
Here after the steps to add File Share
Storage Replica installation and configuration
Before starting the Storage Replica steps, you will need to have created the other Cluster.
In our example, we need all the above steps to be done on Samuel infrastructure in France.
Here after are the PoSH commands to run
$nodes = ("server-1", "server-2”)
icm $nodes {Install-WindowsFeature Storage-Replica -IncludeManagementTools -restart}
In an elevated Command Prompt run the following command on each node:
netsh advfirewall firewall add rule name=PROBEPORT dir=
inprotocol=tcp action=allow localport=
59999remoteip=any profile=any
Run the above PoSH commands on 1 node
$ClusterNetworkName=
"Cluster Network 1"
$IPResourceName=
"Cluster IP Address"
$ILBIP=
"10.0.0.153"[int]
$ProbePort=
59999
Get-ClusterResource$IPResourceName
|
Set-ClusterParameter -Multiple@{
"Address"=
"$ILBIP";
"ProbePort"=
$ProbePort;
"SubnetMask"=
"255.255.255.255";
"Network"=
"$ClusterNetworkName"; ”ProbeFailureThreshold”=
5;
"EnableDhcp"=0}
After the above operation done on both Cluster, you will need to ensure that both clusters can connect/communicate:
Get-Cluster -NameUS-Cluster (ran from fr-server-1)
Get-Cluster -Name FR-Cluster (ran from us-server-1)
On US SSD server:
Within Failover Cluster Manager console, ensure that US-Storage and US-Storage-Logs is owned by local server and is not assigned to Cluster Shared Volume.
Within Computer Management console, assign drive letter L: to US-Storage-Logs
Note: Verify that you have a C:Temp folder on the source and destination Computers (if not create it)
Run the following PoSH command:
Test-SRTopology -SourceComputerName US-Cluster -SourceVolumeName C:ClusterStorageUS-Storage -SourceLogVolumeName L: -DestinationComputerName FR-Cluster -DestinationVolumeName C:ClusterStorageFR-Storage -DestinationLogVolumeName L: -DurationInMinutes 5 -ResultPath c:temp
On FR SSD server:
Within Failover Cluster Manager console, ensure that FR-Storage and FR-Storage-Logs is owned by local server and is not assigned to Cluster Shared Volume.
Within Computer Management console, assign drive letter L: to FR-Storage-Logs
Run the following PoSH command:
Test-SRTopology -SourceComputerName FR-Cluster -SourceVolumeName C:ClusterStorageFR-Storage -SourceLogVolumeName L: -DestinationComputerName US-Cluster -DestinationVolumeName C:ClusterStorageUS-Storage -DestinationLogVolumeName L: -DurationInMinutes 5 -ResultPath c:temp
On US SSD server:
Grant-SRAccess -ComputerName us-ssd-01 -Cluster FR-Cluster
On FR SSD server:
Grant-SRAccess -ComputerName fr-ssd-01 -Cluster US-Cluster
On US SSD server:
New-SRPartnership -SourceComputerName US-Cluster -SourceRGName US -SourceVolumeName c:ClusterStorageUS-Storage -SourceLogVolumeName L: -DestinationComputerName FR-Cluster -DestinationRGName FR -DestinationVolumeName c:ClusterStorageFR-Storage -DestinationLogVolumeName L: -LogSizeinBytes 4GB
Note: As our Log disk is less than minimum requirements (which is at least 8GB), we need to specify the -LogSizeinBytes parameters)
During the initial synchronization, the replication status is Initial block copy
Change Replication Mode
As we have both site in US and France with a latency which is medium/high, we decided to switch Replication Mode from Synchronous to Asynchronous.
To do so, we ran the following PoSH command
Set-SRPartnership -ReplicationMode Asynchronous -SourceComputerName US-Cluster -SourceRGName US -DestinationComputerName FR-Cluster -DestinationRGName FR
To validate the change, you can run the PosH command Get-SRGroup
Now that replication is enabled, if you open the FailOver clustering management, you can see that some volumes are source or destination. A new tab called replication is added and you can check the replication status. The destination volume is no longer accessible until you reverse storage replica way.
The first status will be Initial bloc copy
Validation of replication
Status of the replication can be checked using the following command
(Get-SRGroup).Replicas | Select-Object numofbytesremaining
BTW we can also see traffic between Firewall on the IPsec interface
Once the initial synchronization is finished, the replication
status is Continuously replicating.
Test Storage Replica
Now that everything is in place, we need to ensure that it’s working as expected.
We will need to reverse the Storage Replica to allow FR to become the source and the disk to be mounted.
In US we have the following:
Run the following PoSH command
Set-SRPartnership -NewSourceComputerName FR-Cluster -SourceRGName FR -DestinationComputerName US-Cluster -DestinationRGName US
We can see files in FR and size and ensure it’s consistent from what we had before switching replication
As we simulate an outage and during outage data are written, we had some data in the folder and wait for replication to occur before switching back in US
We can see below that we had 3 Files and 83MB
Switch replication back to US
Set-SRPartnership -NewSourceComputerName US-Cluster -SourceRGName US -DestinationComputerName FR-Cluster -DestinationRGName FR
Validation
Notes from the Field
The disk for the Log should have a minimum recommended size of 8GB (however you can test with a smaller size)
During initial replication, the full size of the disk will be copy between source and replication. In our example with 30GB of disk + Logs we had the following:
Replication mode selection:
Storage Replica supports synchronous and asynchronous replication:
- 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.
Windows Server 2016 and later includes an option for Cloud (Azure)-based Witness. You can choose this quorum option instead of the file share witness.
Key evaluation points and behaviors
- Network bandwidth and latency with fastest storage. There are physical limitations around synchronous replication. Because Storage Replica implements an IO filtering mechanism using logs and requiring network round trips, synchronous replication is likely make application writes slower. By using low latency, high-bandwidth networks as well as high-throughput disk subsystems for the logs, you minimize performance overhead.
- The destination volume is not accessible while replicating in Windows Server 2016. When you configure replication, the destination volume dismounts, making it inaccessible to any reads or writes by users. Its driver letter may be visible in typical interfaces like File Explorer, but an application cannot access the volume itself. Block-level replication technologies are incompatible with allowing access to the destination target’s mounted file system in a volume; NTFS and ReFS do not support users writing data to the volume while blocks change underneath them.
- The Microsoft implementation of asynchronous replication is different than most. Most industry implementations of asynchronous replication rely on snapshot-based replication, where periodic differential transfers move to the other node and merge. Storage Replica asynchronous replication operates just like synchronous replication, except that it removes the requirement for a serialized synchronous acknowledgment from the destination. This means that Storage Replica theoretically has a lower RPO as it continuously replicates. However, this also means it relies on internal application consistency guarantees rather than using snapshots to force consistency in application files. Storage Replica guarantees crash consistency in all replication modes
- Many customers use DFS Replication as a disaster recovery solution even though often impractical for that scenario – DFS Replication cannot replicate open files and is designed to minimize bandwidth usage at the expense of performance, leading to large recovery point deltas. Storage Replica may allow you to retire DFS Replication from some of these types of disaster recovery duties.
- Storage Replica is not backup. Some IT environments deploy replication systems as backup solutions, due to their zero data loss options when compared to daily backups. Storage Replica replicates all changes to all blocks of data on the volume, regardless of the change type. If a user deletes all data from a volume, Storage Replica replicates the deletion instantly to the other volume, irrevocably removing the data from both servers. Do not use Storage Replica as a replacement for a point-in-time backup solution.
- Storage Replica is not Hyper-V Replica or Microsoft SQL AlwaysOn Availability Groups. Storage Replica is a general purpose, storage-agnostic engine. By definition, it cannot tailor its behavior as ideally as application-level replication. This may lead to specific feature gaps that encourage you to deploy or remain on specific application replication technologies.