Set-SRPartnership
Modifies a replication partnership between two replication groups.
Syntax
AddVolumes (Default)
Set-SRPartnership
[[-SourceComputerName] <String>]
[-SourceRGName] <String>
[-SourceAddVolumePartnership] <String[]>
[-DestinationComputerName] <String>
[-DestinationRGName] <String>
[-DestinationAddVolumePartnership] <String[]>
[-Seeded]
[-Force]
[-CimSession <CimSession[]>]
[-ThrottleLimit <Int32>]
[-AsJob]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
ModifySettings
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>]
ModifyPartnership
Set-SRPartnership
[-SourceRGName] <String>
[-DestinationComputerName] <String>
[-DestinationRGName] <String>
[[-NewSourceComputerName] <String>]
[-Force]
[-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.
Note
The Compression parameter is only available in Azure Stack HCI version 22H2 or later, and Windows Server Datacenter: Azure Edition beginning with the 2022-09 Cumulative Update for Microsoft server operating system version 21H2 for x64-based Systems (KB5017381).
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.
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 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.
Parameter properties
Type: | UInt32 |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Aliases: | RPO |
Parameter sets
ModifySettings
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 |
-Compression
Indicates that the connections in this partnership should use SMB compression for data transfer.
This parameter only applies to Azure Stack HCI version 22H2 or later, and Windows Server Datacenter: Azure Edition beginning with the 2022-09 Cumulative Update for Microsoft server operating system version 21H2 for x64-based Systems (KB5017381).
Parameter properties
Type: | Boolean |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Aliases: | CMP |
Parameter sets
ModifySettings
Position: | 53 |
Mandatory: | False |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
-Confirm
Prompts you for confirmation before running the cmdlet.
Parameter properties
Type: | SwitchParameter |
Default value: | False |
Supports wildcards: | False |
DontShow: | False |
Aliases: | cf |
Parameter sets
(All)
Position: | Named |
Mandatory: | False |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | 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.
Parameter properties
Type: | String[] |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Aliases: | DAV |
Parameter sets
AddVolumes
Position: | 6 |
Mandatory: | True |
Value from pipeline: | False |
Value from pipeline by property name: | True |
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: | 3 |
Mandatory: | True |
Value from pipeline: | False |
Value from pipeline by property name: | True |
Value from remaining arguments: | False |
-DestinationRGName
Specifies the name of the destination replication group.
Parameter properties
Type: | String |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Aliases: | DGN |
Parameter sets
(All)
Position: | 5 |
Mandatory: | True |
Value from pipeline: | False |
Value from pipeline by property name: | True |
Value from remaining arguments: | 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.
Parameter properties
Type: | Boolean |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Aliases: | ENC |
Parameter sets
ModifySettings
Position: | 52 |
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
AddVolumes
Position: | 100 |
Mandatory: | False |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
ModifyPartnership
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
ModifySettings
Position: | 50 |
Mandatory: | False |
Value from pipeline: | False |
Value from pipeline by property name: | True |
Value from remaining arguments: | 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.
Parameter properties
Type: | String |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Aliases: | NSCN |
Parameter sets
ModifyPartnership
Position: | 0 |
Mandatory: | False |
Value from pipeline: | False |
Value from pipeline by property name: | True |
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 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.
Parameter properties
Type: | ReplicationMode |
Default value: | None |
Accepted values: | Synchronous, Asynchronous |
Supports wildcards: | False |
DontShow: | False |
Aliases: | RM |
Parameter sets
ModifySettings
Position: | 8 |
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 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.
Parameter properties
Type: | SwitchParameter |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Aliases: | S |
Parameter sets
AddVolumes
Position: | 9 |
Mandatory: | False |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | 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.
Parameter properties
Type: | String[] |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Aliases: | SAV |
Parameter sets
AddVolumes
Position: | 2 |
Mandatory: | True |
Value from pipeline: | False |
Value from pipeline by property name: | True |
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
AddVolumes
Position: | 0 |
Mandatory: | False |
Value from pipeline: | True |
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 |
-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 |
-WhatIf
Shows what would happen if the cmdlet runs. The cmdlet is not run.
Parameter properties
Type: | SwitchParameter |
Default value: | False |
Supports wildcards: | False |
DontShow: | False |
Aliases: | wi |
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.