Storage Replica is great feature baked into Windows Server 2019. It enables volume replication between servers, cluster or even on the server itself. It is great disaster recovery solution at no additional cost.Today, we are going to look into server to server scenario, and configure it.
Before we begin
If you are not familiar with Storage Replica, please visit this link – https://docs.microsoft.com/en-us/windows-server/storage/storage-replica/storage-replica-overview and make sure you understand what it can and cannot do, before you go further.
It is also worth noting that you can use Storage Replica with Windows Server 2019 Standard and Datacenter editions.
Standard edition has some limitations on it:
- it is supported only on Windows Server 2019 Standard
- it can replicate only one volume (DTCNTR has no limit)
- volume can be up to 2TB (DTCNTR unlimited)
So, be sure you weight for what you need it and how much you are going to use it.
If you take into account third party solutions that can do the same thing, Datacenter version does not look that expensive anymore.
We are going to define Synchronous Replication.
Prerequisites
This scenario will work only inside domain environment.
Network setup
I have brought up informatiker.local domain
DC1 – 10.0.1.1
I will install this on two servers (Windows Server 2019 Datacenter) inside domain. Each of theseserver have 2 cores (which is minimum) and 4GB or RAM (I don’t recommend less, but it can be done with 2GB of RAM)
Replica3 – 10.0.1.7
Replica4 – 10.0.1.8
For this lab we are going to use only one network adapter.
We will also need one Windows 10 Pro Client machine on which we will install Windows Admin Center
Client1 – 10.0.1.11
For Synchronous Replication you should have 5ms latency or lower. For Asynchronous it doesn’t matter.
Disk setup
On both Replica3 and Replica4 I’m going to add two disks – E:\ is going to be data disk of 80GB in size, and F:\ is going to be logs disk with 40GB in size.
Storage Spaces support following:
- SAS JBOD, Storage Spaces Direct, FC SAN, shared VHDX, Target ISCSI or local SAS/SATA/SCSI storage.
- Log disk should be on SSDs and fast in general
- Log disk should have minimum of 9GB disk space
Physical disks should have same size and same sector size for both data and log disks.
Format disks as GPT – it will make your life easier if you have to expand beyond 2TB limit.
Software prerequisites
On Windows 10 Pro Client machine install Windows Admin Center
https://www.microsoft.com/en-us/evalcenter/evaluate-windows-admin-center
It says it is “Evaluation” but it is fully functional and free of charge (at least at the time of writing this).
I will not cover installation of Windows Admin center – I will only tell you that you left unchecked “Use WinRM over HTTPS only.” WinRM encrypts data, so it should not be an issue. If you go ahead with WinRM over HTTPS only, make sure you have certificates configured on your servers, and also make sure WinRM listens on port 5896 and that port 5896 is allowed through firewall.
On same machine install Remote Server Administration Tools (RSAT) Storage Replica Module for Windows PowerShell.
Go to Settings | Apps | under Apps & Features select Optional Features | click on Add a Feature | find and install RSAT: Storage Replica Module for Windows Powershell
After installation open PowerShell on that Windows 10 Pro machine (as admin) and type in following
winrm quickconfig
Type Y to enable WinRM services (if not already enabled) and enable Firewall Exceptions.
If Firewall Exceptions are not done – make sure you let port 6516 as both inbound and outbound rules. Open port 5895/tcp on both servers and Windows 10 Pro if you have problems connecting.
Installation
I will not go into great details here, since I assume you know how to use Server Manager and add Roles and Features onto server.
You can do this part via Admin Center or on servers. I will add this on both Replica3 and Replica4 servers as a Feature.
In Add Roles and Features Wizard, under Features add Storage Replica on both Replica3 and Replica4 servers.
Reboot servers after adding Storage Replica Feature.
In Windows 10 Pro installation on Admin Center we are going to add both Replica3 and Replica4 into our Admin Center.
In Windows Admin Center on All connections screen click on Add
Servers | Add
Search Active Directory | Enter Server name | Select it | Add
We now have all our machines in Admin Center
I will now click on Replica3 server name since it will be source server for replication.
Find and select Storage Replica and under Partnerships tab select New
Use an existing server or VM
Under Source I entered replica3 as server name, it was automatically found – Volume and Log volume are automatically filed in, and correctly filled. Under Replication group name you can enter whatever you wish. Scroll down to Destination…
Under Destination part of the screen, I entered replica4test server. Data and log volumes again got automatically filled in. Again enter name of the replication group. Let’s check More options…
Enable synchronous replication, I left other options default, except I selected Encrypt replication traffic – Create
CredSSP will be enabled. Yes (CredSSP appears only if you select encrypt replication traffic).
You will then be asked for administrator account. I entered domain admin, but in production, you should think about creating dedicated account. Continue
Replication is successfully created.
Under status you will get warning signs, with various stages… Give it some time…
After some time you should get green sign signaling that everything is ok.
That is it, we have now created storage replica
On Replica3 server we see bot disk E (Data) and F (Logs)
I also created few folders and file on E drive on Replica3 server
On Replica4 server, E (Data) drive is not accessible.
Switch Replication
We will switch direction of replication for a test, and make replication4 source and replication3 destination server. Click on Switch direction
You will again be asked for credentials
Again, a little bit of waiting…
After some time, replication will be done
Now we can see our files on replica4 server, and replica3 is our DR site.
Testing
Everything is fine in controlled scenario, but what about unexpected situations.
I turned off replica4 server which is now source, to test this. Turned off replica4 will simulate complete loss of server.
Data drive on replica3 server which is still available is not accessible.
To resolve this situation, simply switch direction of replication again. It will work, although one node is not available.
Data will be now available on replica3 server.
In case you bring up second node up that failed, (in my case replica4) your partnership will be stuck at “Waiting for Destination” status after you do above operation.
Backup all the data on your working storage replica volume first where the latest data are.
If you check your two nodes (in my case replica3 and replica4) on both disk E (data) is mounted and data are accessible. That is not desirable situation and storage replica is not working.
You need to remove replication partnership, and setup new one, source should be server that has the latest data. In my case that is replica3 server.
I tested this scenario and it works ok.
Conclusion
Storage replica is great and cheap solution for disaster recovery, it works well, you can replicate to another datacenter, and also to cloud as well.