Install required Windows features
Install-WindowsFeature -Name "BitLocker", "Data-Center-Bridging", "Failover-Clustering", "FS-FileServer", "FS-SMBBW", "Hyper-V", "Hyper-V-PowerShell", "RSAT-AD-Powershell", "RSAT-Clustering-PowerShell", "NetworkATC", "Storage-Replica" -IncludeAllSubFeature -IncludeManagementTools -Verbose
Create VM switches and configure host networking
For detailed QoS configuration for SMB traffic (Mellanox RDMA adapters only), see QoS policy configuration.
Test-Cluster
Test-Cluster -Node SiteANode1,SiteANode2,SiteBNode1,SiteBNode2 -Include 'Storage
Spaces Direct', Inventory', 'Network', 'System Configuration'
New-Cluster
New-Cluster -Name R740StretchCluster -Node
SiteANode1,SiteANode2,SiteBNode1,SiteBNode2 -NoStorage -StaticAddress
192.168.100.100,192.168.200.100 -IgnoreNetwork
192.168.101.0/24,192.168.201.0/24, 192.168.102.0/24,192.168.202.0/24
Witness
Configure a highly available file share witness at a tertiary site or on Azure cloud.
Set-ClusterQuorum -FileShareWitness \\tertiaryShare\witness
Active Directory sites
Ensure that you have created two sites on your Active Directory based on IP's subnets. This helps with assigning the correct names of sites on the cluster.
If you do not have sites that are configured on Active Directory, create cluster fault domains as required. The following cmdlet overrides the site names that are specified on the Active Directory:
#This is needed if you do not have sites configured on AD
#Create Sites
New-ClusterFaultDomain -Name 'Bangalore' -Type Site
New-ClusterFaultDomain -Name 'Chennai' -Type Site
#Site membership for nodes
Set-ClusterFaultDomain -Name SiteANode1 -Parent 'Bangalore'
Set-ClusterFaultDomain -Name SiteANode2 -Parent 'Bangalore'
Set-ClusterFaultDomain -Name SiteBNode1 -Parent 'Chennai'
Set-ClusterFaultDomain -Name SiteBNode2 -Parent 'Chennai'
Preferred Sites
The Preferred Site is your primary data center site.
#Preferred Site
(get-cluster).PreferredSite = 'Bangalore'
Preferred Sites can also be configured at cluster role and group level.
(Get-ClusterGroup -Name SQLServer1).PreferredSite = 'Bangalore'
If there is an Active-Active stretched cluster where Preferred Sites are not configured, it is highly recommended that you configure Preferred Sites for each volume. This ensures that the volumes stay at the same site if there is a single node failure on either site.
(Get-ClusterSharedVolume "Cluster Virtual Disk (ax740xds2N2)" | Get-ClusterGroup).PreferredSite = "Chennai"
Get-ClusterSharedVolume "*ax740xds2N2)" | Get-ClusterGroup |fl *
Enable Storage Spaces
Enable-ClusterS2D -confirm:$false
This step ensures that Storage Spaces Direct is enabled on the stretched cluster. Two storage pools are created, one for each site.
PS C:\Users\Administrator.TEST> Get-StoragePool
FriendlyName Operational HealthStatus IsPrimordial IsReadOnly Size AllocatedSize
Status
------------ -------------- ------------ ------------ ---------- --------- -------------
Primordial OK Healthy True False 15.94 TB 15.71 TB
Primordial OK Healthy True False 15.94 TB 15.71 TB
Pool for Site OK Healthy False False 15.7 TB 4.28 TB
Chennai
Pool for Site OK Healthy False False 15.7 TB 4.28 TB
Bangalore
New Volume
You can create a new-replicated volume by using Windows Admin Center or a mixture of PowerShell and Failover Cluster Manager.
Using PowerShell and Failover Cluster ManagerFor each volume that you want to replicate across two sites, you have to create its associated Replica volume and Log volume on both sites.
#Primary Volume
New-Volume -StoragePoolFriendlyName "Pool for Site Bangalore" -FriendlyName
VolumeA -FileSystem CSVFS_ReFS -Size 1TB
#Log Volume
New-Volume -StoragePoolFriendlyName "Pool for Site Bangalore" -FriendlyName
'VolumeA-Log' -FileSystem ReFS -Size 50GB
#Replica Volume
New-Volume -StoragePoolFriendlyName "Pool for Site Chennai" -FriendlyName
'VolumeA-Replica' -FileSystem ReFS -Size 1TB
#Replica Log Volume
New-Volume -StoragePoolFriendlyName "Pool for Site Chennai" -FriendlyName
'VolumeA-Replica-Log' -FileSystem ReFS -Size 50GB
To enable replication on volumes, go to Storage >> Disks and right-click the primary volume on which you want to enable replication. Then follow these steps:
- Select Replication and click Enable
- Select the log volume for the primary site
- Select the Replica volume and associated log volume for the secondary site
- Overwrite the destination volume unless you have a seeded disk.
- Select the mode of replication.
- Complete the wizard.
This enables replication on the volume after the initial block copy. The initial block copy process can take a few minutes to a few hours, depending on the size of the volume.
Test-SRTopology
This cmdlet validates a potential replication partnership between source and destination systems. Follow these steps:
- Create a local CSVFS volume, for example 1 TB.
- Create a local log volume (ReFS), for example 50 GB.
- Create a Replica volume (ReFS), for example 1 TB (Ensure that the local and replica volumes are the same size).
- Create a Replica-log volume (ReFS), for example 50 GB.
###Step 1###
New-Volume -StoragePoolFriendlyName "Pool for Site Bangalore" -FriendlyName
'VolumeA' -FileSystem CSVFS_ReFS -Size 1TB
#Log Volume
New-Volume -StoragePoolFriendlyName "Pool for Site Bangalore" -FriendlyName
'VolumeA-Log' -FileSystem ReFS -Size 50GB
## Move 'Available Storage to Site B' ##
Get-ClusterGroup -Name 'Available Storage' | Get-ClusterResource | Stop-
ClusterResource
Move-ClusterGroup -Name 'Available Storage' -Node ax740xds2n1
###Step 2###
#Replica Volume
New-Volume -StoragePoolFriendlyName "Pool for Site Chennai" -FriendlyName
'VolumeA-Replica' -FileSystem ReFS -Size 1TB
#Replica Log Volume
New-Volume -StoragePoolFriendlyName "Pool for Site Chennai" -FriendlyName
'VolumeA-Replica-Log' -FileSystem ReFS -Size 50GB
###Step 3
# Create Replication Group for secondary volumes
$PathVolARep =Get-Volume -FriendlyName VolumeA-Replica | Select -
ExpandProperty Path
$PathVolARepLog=Get-Volume -FriendlyName VolumeA-Replica-Log | Select -
ExpandProperty Path
New-SRGroup -ComputerName ax740xds2n1 -Name Group108 -VolumeName $PathVolARep -
LogVolumeName $PathVolARepLog -LogSizeInBytes 2GB
Get-ClusterGroup -Name 'Available Storage' | Get-ClusterResource | Stop-
ClusterResource
Move-ClusterGroup -Name 'Available Storage' -Node ax740xds1n2
# Assign drive letters
Get-Volume -FriendlyName VolumeB-Log | Get-Partition | Set-Partition -
NewDriveLetter H
Get-Volume -FriendlyName VolumeB-Replica | Get-Partition | Set-Partition -
NewDriveLetter I
Get-Volume -FriendlyName VolumeB-Replica-Log | Get-Partition | Set-Partition -
NewDriveLetter J
Test-SRTopology -SourceComputerName ax740xds1n2 -SourceVolumeName
C:\ClusterStorage\VolumeB -SourceLogVolumeName H -DestinationComputerName
ax740xds2n1 -DestinationVolumeName I -DestinationLogVolumeName J -
DurationInMinutes 30 -ResultPath .\TopologyResults
New-SRPartnership -SourceComputerName "ax740xds1n2" -SourceRGName "Replication1" -SourceVolumeName "C:\Clusterstorage\VolumeB\" -SourceLogVolumeName "H" -DestinationComputerName "ax740xds2n1" -DestinationRGName "Replication2" -DestinationVolumeName "I" -DestinationLogVolumeName "J" -verbose
The preceding cmdlet completes in 30 minutes and displays the results in HTML format.
Test-SRTopology
only for a single volume. Set-SRNetworkConstraint
In a network topology which has multiple routes to the secondary site, it is imperative to provide a correct path for the Replica network. Set-SRNetworkConstraint
is a cmdlet that is useful for specifying an array of network interfaces to be used for replica traffic. This cmdlet has to be run once for each volume.
Set-SRNetworkConstraint -SourceRGName "Replication 2" -SourceNWInterface "SR -
Site B" -DestinationRGName "Replication 1" -DestinationNWInterface "SR - Site A"
-SourceComputerName SiteANode1 -DestinationComputerName SiteBNode1 -Verbose
Set-SRNetworkConstraint
ensures that the Management network does not become bottlenecked because of Replica traffic.