New-SRPartnership

Creates a replication partnership between two replication groups.

Syntax

New-SRPartnership
   [[-SourceComputerName] <String>]
   [-SourceRGName] <String>
   [-DestinationComputerName] <String>
   [-DestinationRGName] <String>
   [[-ReplicationMode] <ReplicationMode>]
   [-PreventReplication]
   [-Seeded]
   [[-AsyncRPO] <UInt32>]
   [-EnableEncryption]
   [-Force]
   [-CimSession <CimSession[]>]
   [-ThrottleLimit <Int32>]
   [-AsJob]
   [<CommonParameters>]
New-SRPartnership
   [[-SourceComputerName] <String>]
   [-SourceRGName] <String>
   [-SourceVolumeName] <String[]>
   [-SourceLogVolumeName] <String>
   [[-SourceRGDescription] <String>]
   [-DestinationComputerName] <String>
   [-DestinationRGName] <String>
   [-DestinationVolumeName] <String[]>
   [-DestinationLogVolumeName] <String>
   [[-DestinationRGDescription] <String>]
   [[-ReplicationMode] <ReplicationMode>]
   [[-LogSizeInBytes] <UInt64>]
   [-PreventReplication]
   [-Seeded]
   [-EnableConsistencyGroups]
   [[-AsyncRPO] <UInt32>]
   [-EnableEncryption]
   [-Force]
   [-CimSession <CimSession[]>]
   [-ThrottleLimit <Int32>]
   [-AsJob]
   [<CommonParameters>]

Description

The New-SRPartnership cmdlet creates a replication partnership between two new or existing replication groups. This cmdlet can create the complete replication topology. It can also tie together separately created replication groups.

Examples

Example 1: Create a topology between two servers

PS C:\>New-SRPartnership -SourceComputerName "SR-SRV05" -SourceRGName "ReplicationGroup01" -SourceVolumeName "D:" -SourceLogVolumeName "E:" -DestinationComputerName "SR-SRV06" -DestinationRGName "ReplicationGroup02" -DestinationVolumeName "D:" -DestinationLogVolumeName "E:"
DestinationComputerName : SR-SRV06
DestinationRGName       : ReplicationGroup02
Id                      : 3767be20-b82f-4c59-8630-116885de1ac7
SourceComputerName      : SR-SRV05
SourceRGName            : ReplicationGroup01
PSComputerName          :

This command creates a replication topology between servers SR-SRV05 and SR-SRV06. The SR-SRV05 server is the source and SR-SRV06 is the destination for the D: volume. The E: volume contains the logs for this partnership. The log has the default value of 8GB. The replication mode has the default value of synchronous. The command does not specify seeding, encryption, and consistency groups. Replication starts immediately.

Example 2: Pair existing groups

This command creates a replication group named ReplicationGroup01 for the server named SR-SRV05 by using the New-SRGroup cmdlet.
PS C:\>New-SRGroup -ComputerName "SR-SRV05" -Name "ReplicationGroup01" -VolumeName "D:" -LogVolumeName "E:"
AllowVolumeResize  : False
AsyncRPO           : 
ComputerName       : SR-SRV05
Description        : 
Id                 : 7b44e4bd-3fd8-411d-a6d1-1a6bb704520f
IsAutoFailover     : 
IsCluster          : False
IsEncrypted        : False
IsInPartnership    : False
IsPrimary          : 
IsSuspended        : 
IsWriteConsistency : False
LastInSyncTime     : 
LogSizeInBytes     : 8589934592
LogVolume          : e:\ 
Name               : ReplicationGroup01
NumOfReplicas      : 1
Partitions         : {bc49f059-4f78-464d-b88a-3a092108816e}
Replicas           : {MSFT_WvrReplica (PartitionId =
                     "bc49f059-4f78-464d-b88a-3a092108816e")}
ReplicationMode    : Synchronous
ReplicationStatus  : NotInPartnership
PSComputerName     :

This command creates a replication group named ReplicationGroup02 for the server named SR-SRV06. 
PS C:\>New-SRGroup -ComputerName "SR-SRV06" -Name "ReplicationGroup02" -VolumeName "D:" -LogVolumeName "E:"
AllowVolumeResize  : False
AsyncRPO           : 
ComputerName       : SR-SRV06
Description        : 
Id                 : c72ad564-6618-4ef2-92c6-13e0cc451303
IsAutoFailover     : 
IsCluster          : False
IsEncrypted        : False
IsInPartnership    : False
IsPrimary          : 
IsSuspended        : 
IsWriteConsistency : False
LastInSyncTime     : 
LogSizeInBytes     : 8589934592
LogVolume          : e:\ 
Name               : ReplicationGroup02
NumOfReplicas      : 1
Partitions         : {92306c9f-655c-48e2-a28f-f08010514161}
Replicas           : {MSFT_WvrReplica (PartitionId =
                     "92306c9f-655c-48e2-a28f-f08010514161")}
ReplicationMode    : Synchronous
ReplicationStatus  : NotInPartnership
PSComputerName     :

This command pairs the replication groups from the previous commands.
PS C:\>New-SRPartnership -SourceComputerName "SR-SRV05" -SourceRGName "ReplicationGroup01" -DestinationComputerName "SR-SRV06" -DestinationRGName "ReplicationGroup02" 
DestinationComputerName : SR-SRV06
DestinationRGName       : ReplicationGroup02
Id                      : cc9d4af0-c9c0-41e9-b7ae-e184714077ec
SourceComputerName      : SR-SRV05
SourceRGName            : ReplicationGroup01
PSComputerName          :

This example creates two replication groups separately and then pairs those groups.

Required Parameters

-DestinationComputerName

Specifies a single replica host computer NetBIOS name or fully qualified domain name (FQDN) of the destination computer.

Type:String
Aliases:DCN
Position:2
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-DestinationLogVolumeName

Specifies a drive letter, mount point path, or volume GUID where Storage Replication creates destination replication logs. The volume must contain an NTFS-formatted volume or ReFS-formatted volume. The path must exist. The path cannot be a mapped drive or UNC path.

Storage Replication creates logs in the System Volume Information folder.

Type:String
Aliases:DLV
Position:8
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-DestinationRGName

Specifies a name for the destination replication group.

Type:String
Aliases:DGN
Position:3
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-DestinationVolumeName

Specifies an array of drive letters or mount point paths of partitions for the replica. The volumes must exist. The volumes cannot be mapped drives or UNC paths. You can omit the colon symbol when you specify drive letters.

This is an ordered list. The order of volumes determines the order of replication.

For instance, to replicate the F: and H: drives on one server to the F: and H: drives of another server, specify the following values:

-SourceVolumeName "F:","H:" -DestinationVolumeName "F:","H:"

To replicate F: to H: instead, specify the following values:

-SourceVolumeName "F:","H:" -DestinationVolumeName "H:","F:"

We do not recommend replicating different drive letters or mount point paths. The practice can cause application failures because of stored settings after a failover occurs.

Type:String[]
Aliases:DVN
Position:7
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-SourceLogVolumeName

Specifies a drive letter, mount point path, or volume GUID where Storage Replication creates source replication logs. The volume must contain an NTFS-formatted volume or ReFS-formatted volume. The path must exist. The path cannot be a mapped drive or UNC path.

Storage Replication creates logs in the System Volume Information folder.

Type:String
Aliases:SLN
Position:3
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-SourceRGName

Specifies the name of the source replication group.

Type:String
Aliases:SGN
Position:1
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-SourceVolumeName

Specifies an array of drive letters or mount point paths of partitions for the replica. The volumes must exist. The volumes cannot be mapped drives or UNC paths.

This is an ordered list. The order of volumes determines the order of replication. For more information, see the DestinationVolumeName parameter.

Type:String[]
Aliases:SVN
Position:2
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False

Optional Parameters

-AsJob

Runs the cmdlet as a background job. Use this parameter to run commands that take a long time to complete.

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-AsyncRPO

Specifies the maximum difference in time, in seconds, that data for an asynchronous partnership can be different between source and destination. This is a Recovery Point Objective. The minimum value is 30 seconds. The default value is 5 minutes.

After exceeding this time, the source server alerts the Health Service on clusters. It logs event 1239 in the Storage Replica Admin event log channel. If the RPO time is lower than the configured time, event 1240 is logged.

Type:UInt32
Aliases:RPO
Position:51
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-CimSession

Runs the cmdlet in a remote session or on a remote computer. Enter a computer name or a session object, such as the output of a New-CimSession or Get-CimSession cmdlet. The default is the current session on the local computer.

Type:CimSession[]
Aliases:Session
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-DestinationRGDescription

Specifies a description for the destination replication group.

Type:String
Aliases:DGD
Position:9
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-EnableConsistencyGroups

Indicates that consistency groups are enabled for the replication group that contains multiple volumes. Consistency groups provide write ordering. This can be important, for example, for replication of application data on multiple volumes. If you enable consistency groups, it may decrease replication and write Input/Output performance.

Type:SwitchParameter
Aliases:EC
Position:14
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-EnableEncryption

Indicates that this partnership should encrypt connections by using SMB AES-128-GCM. Enabling encryption can protect Storage Replica block transfers from man-in-the-middle interception or reading. Enabling encryption decreases replication and write Input/Output performance.

Type:SwitchParameter
Aliases:EE
Position:99
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Force

Forces the command to run without asking for user confirmation.

Type:SwitchParameter
Aliases:F
Position:100
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-LogSizeInBytes

Specifies the aggregate size of log files on each server in the replication group for the volumes that are associated with this replication group. The minimum size 512MB. You can specify a value by using the Windows PowerShell byte conversion capability, such as 4GB or 3200MB. A value that is too small may cause decreased replication performance or increased recovery time after an interruption between computers.

Type:UInt64
Aliases:LS
Position:11
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-PreventReplication

Indicates that this cmdlet prevent replication from starting immediately. By default, replication starts automatically at the time that you create the partnership. To start replication later, use the Sync-SRGroup cmdlet.

Type:SwitchParameter
Aliases:P
Position:5
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-ReplicationMode

Specifies the desired mode of replication for this source and destination pair. The acceptable values for this parameter are:

  • Synchronous or 1. The synchronous mode requires all writes to commit on the destination server and on the source server, which guarantees data integrity between computers.
  • Asynchronous or 2. The asynchronous mode writes to the source server without waiting for the destination server, which allows for replication over high latency, geographic networks.

The default value is synchronous.

The default asynchronous recovery point alert time is 5 minutes. You can modify it by using the Set-SRPartnership cmdlet. The alert time has no effect on replication behavior, only on reporting.

Type:ReplicationMode
Aliases:RM
Parameter Sets:Synchronous, Asynchronous
Position:4
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Seeded

Indicates that the destination server contains a seeded copy of the data from the source server. Seeded data is defined as a copy of data from the source server that has a high similarity, such as mostly empty blocks, restoring a recent backup, or shipping cloned copies of disks to the destination server.

Seeding is most effective when using a previous copy of the storage, such as a split mirror or previously replicated drives, or when the storage is mostly empty and was always empty, such as a recently initialized drive with a newly formatted volume. Seeding is somewhat effective with data that came from a backup restore or a complete tree copy of data or from copies of very large files.

Seeding is least effective when copying large numbers of small files from some random locations to some other random locations. Storage Replica automatically uses seeding when it restarts replication after a long outage that wrapped the logs.

Type:SwitchParameter
Aliases:S
Position:6
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-SourceComputerName

Specifies a single replica host computer NetBIOS name or FQDN of the source computer. The default value is the local computer.

Type:String
Aliases:SCN
Position:0
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-SourceRGDescription

Specifies a description for the source replication group.

Type:String
Aliases:SGD
Position:4
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-ThrottleLimit

Specifies the maximum number of concurrent operations that can be established to run the cmdlet. If this parameter is omitted or a value of 0 is entered, then Windows PowerShell® calculates an optimum throttle limit for the cmdlet based on the number of CIM cmdlets that are running on the computer. The throttle limit applies only to the current cmdlet, not to the session or to the computer.

Type:Int32
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

Outputs

replicationgroups