次の方法で共有


CreateReplicationRelationship method of the MSFT_SMSystem class

Creates two replication groups and then creates a replication relationship between them.

Syntax

UInt32 CreateReplicationRelationship(
  [in]            string                      RelationshipName,
  [in]            uint16                      SyncType,
  [in]            uint16                      Mode,
  [in]            MSFT_SMReplicaPeer      REF TargetStorageSystem,
  [in]            String                      SourceReplicationGroupFriendlyName,
  [in]            MSFT_SMStorageObject    REF SourceStorageElements[],
  [in, optional]  MSFT_SMReplicationSettings  SourceReplicationGroupSettings,
  [in]            String                      TargetReplicationGroupFriendlyName,
  [in, optional]  MSFT_SMStorageObject    REF TargetStorageElements[],
  [in]            MSFT_SMPool             REF TargetStoragePool,
  [in]            MSFT_SMPool             REF TargetStoragePools[],
  [in, optional]  MSFT_SMReplicationSettings  TargetReplicationGroupSettings,
  [in]            UInt32                      RecoveryPointObjective,
  [in, out]       MSFT_SMReplicationGroup REF SourceGroup,
  [in]            MSFT_SMReplicationGroup REF TargetGroup,
  [out]           MSFT_SMReplicaPeer      REF TargetReplicaPeer,
  [out]           MSFT_SMJob              REF Job,
  [out, optional] MSFT_SMExtendedStatus       ExtendedStatus,
  [in, optional]  String                      username,
  [in, optional]  String                      password
);

Parameters

RelationshipName [in]

The name of the replication relationship to create.

SyncType [in]

An integer that indicates the type of copy to make.

The possible values are:

DMTF Reserved

0 5

Mirror (6)

Snapshot (7)

Clone (8)

TokenizedClone (9)

DMTF Reserved

10 32767

Vendor Specific

32768 ...

Mode [in]

The setting to use to update target elements. If this value is NULL, the system will specify this setting.

The possible values are:

Synchronous (2)

Update target elements synchronously.

Asynchronous (3)

Update target elements asynchronously.

Adaptive (4)

Dynamically switch between synchronous and asynchronous modes.

DMTF Reserved

Vendor Specific

TargetStorageSystem [in]

Indicates the replica target system to use when setting up a relationship of storage objects within the system.

SourceReplicationGroupFriendlyName [in]

The name of the source replication group to create.

SourceStorageElements [in]

An array that contains the storage objects to include in the source replication group.

SourceReplicationGroupSettings [in, optional]

A MSFT_SMReplicationSettings object that contains settings to apply to the source replication group.

TargetReplicationGroupFriendlyName [in]

The name of the target replication group to be created.

TargetStorageElements [in, optional]

An array that contains the storage objects to include in the target replication group. The number and order of elements should match those specified in the SourceStorageElements parameter.

TargetStoragePool [in]

A MSFT_SMPool object that contains the storage objects of the target replication group. You can specify this parameter instead of the TargetStorageElements parameter.

Note

If this parameter is specified, the TargetStoragePools parameter must be set to NULL.

TargetStoragePools [in]

An array that contains MSFT_SMPool objects that contain storage objects of the target replication group.

Note

If this parameter is specified, TargetStoragePool parameter must be set to NULL.

TargetReplicationGroupSettings [in, optional]

A MSFT_SMReplicationSettings object that contains settings for the target replication group.

RecoveryPointObjective [in]

Indicates the maximum interval in which data from copy operations might be lost. For synchronous copy operations, this interval is "0". For asynchronous copy operations, this parameter represents the interval since the most recent transmission of data to the target element.

SourceGroup [in, out]

A MSFT_SMReplicationGroup object that specifies the source replication group to create.

TargetGroup [in]

A MSFT_SMReplicationGroup object that specifies the target replication group to create.

TargetReplicaPeer [out]

A MSFT_SMReplicaPeer object that specifies the association between the source replication group and the instance of the replication target.

Job [out]

A MSFT_SMJob object that specifies a reference to a job if this method returns "Method Parameters Checked - Job Started". If this operation performs synchronously, this parameter is set to NULL.

ExtendedStatus [out, optional]

A MSFT_SMExtendedStatus object that specifies detailed status information about the result of this operation.

username [in, optional]

The username to use to authenticate the SMI-S provider. If this parameter is not set, the storage service will attempt to retrieve the credentials from the configuration provider.

password [in, optional]

The password to use to authenticate the SMI-S provider. If this parameter is not set, the storage service will attempt to retrieve the credentials from the configuration provider.

Return value

The possible return values are:

Success (0)

Not Supported (1)

Unspecified Error (2)

Timeout (3)

Failed (4)

Invalid Parameter (5)

Object Not Found (8)

Method Parameters Checked - Job Started (4096)

Access denied (40001)

There are not enough resources to complete the operation. (40002)

Cache out of date (40003)

Requirements

Minimum supported client
None supported
Minimum supported server
Windows Server 2016
Namespace
Root\Microsoft\Windows\Storage\SM
MOF
MsftStrgMan.mof
DLL
StorageService.dll

See also

MSFT_SMSystem