New-SRPartnership

Creates a replication partnership between two replication groups.

Syntax

CreatePartnership (Default)

New-SRPartnership
    [[-SourceComputerName] <String>]
    [-SourceRGName] <String>
    [-DestinationComputerName] <String>
    [-DestinationRGName] <String>
    [[-ReplicationMode] <ReplicationMode>]
    [[-AsyncRPO] <UInt32>]
    [-PreventReplication]
    [-Seeded]
    [-EnableEncryption]
    [-EnableCompression]
    [-Force]
    [-CimSession <CimSession[]>]
    [-ThrottleLimit <Int32>]
    [-AsJob]
    [<CommonParameters>]

CreateTopology

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>]
    [[-AsyncRPO] <UInt32>]
    [-PreventReplication]
    [-Seeded]
    [-EnableConsistencyGroups]
    [-EnableEncryption]
    [-EnableCompression]
    [-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

$Parameters = @{
    SourceComputerName = 'SR-SRV05'
    SourceRGName = 'ReplicationGroup01'
    SourceVolumeName = 'D:'
    SourceLogVolumeName = 'E:'
    DestinationComputerName = 'SR-SRV06'
    DestinationRGName = 'ReplicationGroup02'
    DestinationVolumeName = 'D:'
    DestinationLogVolumeName = 'E:'
}
New-SRPartnership @Parameters

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, with volume D: used as both the source and destination. The E: volume contains the logs for this partnership. The log has the default value of 8GB. As the replication mode has not been specified, it will use the default value of synchronous. The command does not specify seeding, encryption, and consistency groups. Replication will start immediately.

This example uses splatting to pass parameter values from the $Parameters variable to the command. Learn more about Splatting.

Example 2: Pair existing groups

$Parameters = @{
    SourceComputerName = 'SR-SRV05'
    SourceRGName = 'ReplicationGroup01'
    DestinationComputerName = 'SR-SRV06'
    DestinationRGName = 'ReplicationGroup02'
}
New-SRGroup -ComputerName "SR-SRV05" -Name "ReplicationGroup01" -VolumeName "D:" -LogVolumeName "E:"
New-SRGroup -ComputerName "SR-SRV06" -Name "ReplicationGroup02" -VolumeName "D:" -LogVolumeName "E:"
New-SRPartnership @Parameters"

This example creates two replication groups separately and then creates a partnership between those groups.

The example uses splatting to pass parameter values from the $Parameters variable to the command. Learn more about Splatting.

Parameters

-AsJob

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

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments: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.

Parameter properties

Type:UInt32
Default value:None
Supports wildcards:False
DontShow:False
Aliases:RPO

Parameter sets

(All)
Position:51
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments: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.

Parameter properties

Type:

CimSession[]

Default value:None
Supports wildcards:False
DontShow:False
Aliases:Session

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-DestinationComputerName

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

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False
Aliases:DCN

Parameter sets

(All)
Position:2
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments: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.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False
Aliases:DLV

Parameter sets

CreateTopology
Position:8
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-DestinationRGDescription

Specifies a description for the destination replication group.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False
Aliases:DGD

Parameter sets

CreateTopology
Position:9
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-DestinationRGName

Specifies a name for the destination replication group.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False
Aliases:DGN

Parameter sets

(All)
Position:3
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments: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. This practice can cause application failures because of stored settings after a failover occurs.

Parameter properties

Type:

String[]

Default value:None
Supports wildcards:False
DontShow:False
Aliases:DVN

Parameter sets

CreateTopology
Position:7
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-EnableCompression

Indicates that the connections in this partnership should use SMB compression for data transfer.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False
Aliases:ECMP

Parameter sets

(All)
Position:99
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments: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.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False
Aliases:EC

Parameter sets

CreateTopology
Position:14
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments: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.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False
Aliases:EE

Parameter sets

(All)
Position:99
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Force

Forces the command to run without asking for user confirmation.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False
Aliases:F

Parameter sets

(All)
Position:100
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments: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.

Parameter properties

Type:UInt64
Default value:None
Supports wildcards:False
DontShow:False
Aliases:LS

Parameter sets

CreateTopology
Position:11
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments: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.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False
Aliases:P

Parameter sets

(All)
Position:5
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments: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.

Parameter properties

Type:ReplicationMode
Default value:None
Accepted values:Synchronous, Asynchronous
Supports wildcards:False
DontShow:False
Aliases:RM

Parameter sets

(All)
Position:4
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments: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.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False
Aliases:S

Parameter sets

(All)
Position:6
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-SourceComputerName

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

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False
Aliases:SCN

Parameter sets

(All)
Position:0
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments: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.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False
Aliases:SLN

Parameter sets

CreateTopology
Position:3
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-SourceRGDescription

Specifies a description for the source replication group.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False
Aliases:SGD

Parameter sets

CreateTopology
Position:4
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-SourceRGName

Specifies the name of the source replication group.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False
Aliases:SGN

Parameter sets

(All)
Position:1
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments: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.

Parameter properties

Type:

String[]

Default value:None
Supports wildcards:False
DontShow:False
Aliases:SVN

Parameter sets

CreateTopology
Position:2
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments: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.

Parameter properties

Type:Int32
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Outputs

replicationgroups