Editar

Partilhar via


Set-SRPartnership

Modifies a replication partnership between two replication groups.

Syntax

Set-SRPartnership
   [[-SourceComputerName] <String>]
   [-SourceRGName] <String>
   [-SourceAddVolumePartnership] <String[]>
   [-DestinationComputerName] <String>
   [-DestinationRGName] <String>
   [-DestinationAddVolumePartnership] <String[]>
   [-Seeded]
   [-Force]
   [-CimSession <CimSession[]>]
   [-ThrottleLimit <Int32>]
   [-AsJob]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Set-SRPartnership
   [[-SourceComputerName] <String>]
   [-SourceRGName] <String>
   [-DestinationComputerName] <String>
   [-DestinationRGName] <String>
   [[-ReplicationMode] <ReplicationMode>]
   [[-LogSizeInBytes] <UInt64>]
   [[-AsyncRPO] <UInt32>]
   [[-Encryption] <Boolean>]
   [[-Compression] <Boolean>]
   [-CimSession <CimSession[]>]
   [-ThrottleLimit <Int32>]
   [-AsJob]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Set-SRPartnership
   [-SourceRGName] <String>
   [-DestinationComputerName] <String>
   [-DestinationRGName] <String>
   [-Force]
   [[-NewSourceComputerName] <String>]
   [-CimSession <CimSession[]>]
   [-ThrottleLimit <Int32>]
   [-AsJob]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]

Description

The Set-SRPartnership cmdlet modifies a replication partnership between two existing replication groups. You can use this cmdlet to add replicated volumes. You can also change the direction of replication which makes a source volume into a destination volume.

Examples

Example 1: Reverse replication direction

$Parameters = @{
    NewSourceComputerName = 'SR-SRV06'
    SourceRGName = 'ReplicationGroup02'
    DestinationComputerName = 'SR-SRV05'
    DestinationRGName = 'ReplicationGroup01'
    Confirm = $False
}
Set-SRPartnership @Parameters

This example changes the replication direction without user confirmation, for example after a disaster recovery event has occurred. The previous source replication group named ReplicationGroup01 on previous source server SR-SRV05 becomes the new destination for ReplicationGroup02 on SR-SRV06. Replication is now reversed. You must direct any applications or users attempting to read or write against SR-SRV05 to SR-SRV06.

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

Example 2: Change size of log

$Parameters = @{
    SourceComputerName = 'SR-SRV05'
    SourceRGName = 'ReplicationGroup01'
    DestinationComputerName = 'SR-SRV06'
    DestinationRGName = 'ReplicationGroup02'
    LogSizeInBytes = '32GB'
}
Set-SRPartnership @Parameters
Get-SRPartnership | Get-SRGroup

The example changes the log from its default size of 8GB to 32GB, for the partnership between SR-SRV05 and SR-SRV06.

Example 3: Change to asynchronous mode

$Parameters = @{
    SourceComputerName = 'SR-SRV05'
    SourceRGName = 'ReplicationGroup01'
    ReplicationMode = 'Asynchronous'
    DestinationComputerName = 'SR-SRV06'
    DestinationRGName = 'ReplicationGroup02'
}
Set-SRPartnership @Parameters

This example changes the replication mode from synchronous to asynchronous. A warning will be generated by the setting being applied to both replication groups.

Example 4: Display replicas after a change

$Parameters = @{
    SourceComputerName = 'SR-SRV05'
    SourceRGName = 'ReplicationGroup01'
    SourceAddVolumePartnership = 'F:','G:'
    DestinationComputerName = 'SR-SRV06'
    DestinationRGName = 'ReplicationGroup02'
    DestinationAddVolumePartnership = 'F:','G:'
}
Set-SRPartnership @Parameters
(Get-SRGroup).replicas

The first command changes the partnership for the servers named SR-SRV05 and SR-SRV06. The second command gets all replication groups for the current computer by using the Get-SRGroup cmdlet. The command displays all the replicas.

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
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-AsyncRPO

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

After this time is exceeded, 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. Changing this value modifies monitoring and logging. It does not affect replication or Input/Output.

Type:UInt32
Aliases:RPO
Position:51
Default value:None
Required:False
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
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Compression

Indicates that the connections in this partnership should use SMB compression for data transfer. SMB compression is only used with TCP, and isn't supported on both SMB Direct and RDMA networks.

Type:Boolean
Aliases:CMP
Position:53
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:False
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-DestinationAddVolumePartnership

Specifies an array of drive letters or mount point paths of partitions to add to the existing replication group. You cannot specify paths already added to the replication group.

This list is ordered. The order of volumes determines the order of replication. For more information, see the DestinationVolumeName parameter of the New-SRPartnership cmdlet.

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:DAV
Position:6
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-DestinationComputerName

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

Type:String
Aliases:DCN
Position:3
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-DestinationRGName

Specifies the name of the destination replication group.

Type:String
Aliases:DGN
Position:5
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-Encryption

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

Type:Boolean
Aliases:ENC
Position:52
Default value:None
Required:False
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
Required:False
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:50
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-NewSourceComputerName

Specifies the new source of replication. This parameter changes the direction of replication for the source computer and the source replication group. When changed, replication stops originating on the current source and moves to the new source.

This operation is very likely to disrupt access to data. There is a time when neither volumes are writable and when clients and applications might still access the previously writable source volume. You may also have to reconfigure applications and repoint users to this new location, using technologies such as DFS Namespaces. When switching asynchronously-replicated volumes, to avoid data loss, you must first make sure that user and application data is quiescent.

Type:String
Aliases:NSCN
Position:0
Default value:None
Required:False
Accept pipeline input:True
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 commit 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 server, which allows for replication over high latency, geographic networks.

The default value is synchronous. The default asynchronous recovery point alert time is 30 seconds. You can modify it by using this cmdlet. The alert time has no effect on replication behavior, only on reporting.

Type:ReplicationMode
Aliases:RM
Accepted values:Synchronous, Asynchronous
Position:8
Default value:None
Required:False
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 many 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:9
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-SourceAddVolumePartnership

Specifies an array of drive letters or mount point paths of partitions to add to the existing replication group. You cannot specify paths already added to the replication group.

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

Type:String[]
Aliases:SAV
Position:2
Default value:None
Required:True
Accept pipeline input:True
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
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-SourceRGName

Specifies the name of the source replication group.

Type:String
Aliases:SGN
Position:1
Default value:None
Required:True
Accept pipeline input:True
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
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:False
Required:False
Accept pipeline input:False
Accept wildcard characters:False

Inputs

String

UInt64

Outputs

Object