3.2.4.4.1.40 IVolumeClient::DiskMerge (Opnum 45)

The DiskMerge method merges a foreign disk group into the primary disk group of the server. This is a synchronous task.

 HRESULT DiskMerge(
   [in] int cchDgid,
   [in, size_is(cchDgid)] byte* dgid,
   [in] int numDisks,
   [in, size_is(numDisks)] LdmObjectId* diskList,
   [in] hyper merge_config_tid,
   [in] int numRids,
   [in, size_is(numRids)] hyper* merge_dm_rids,
   [out] TASK_INFO* tinfo
 );

cchDgid: Size of dgid in characters, including the terminating null character.

dgid: Null-terminated string that contains the UUID of the disk group to be merged.

numDisks: Number of disks passed in diskList.

diskList: Array of OIDs of type LdmObjectId that specifies the disks to be merged from the dgid group.

merge_config_tid: Last known modification sequence number of the disk group to be merged.

numRids: Number of elements passed in merge_dm_rids.

merge_dm_rids: Array of disk records for the disks in diskList. Memory for the array is allocated and freed by the client.

tinfo: Pointer to a TASK_INFO structure that the client can use to track the request's progress.<148>

Return Values: The method MUST return 0 or a nonerror HRESULT on success, or an implementation-specific nonzero error code on failure (as specified in [MS-ERREF]; see also section 2.2.1 for HRESULT values predefined by the Disk Management Remote Protocol).

Upon receiving this message the server MUST validate parameters:

  1. Verify that dgid is a valid disk group ID that belongs to a foreign dynamic disk group.

  2. Verify that the disk objects specified by diskList are in the list of storage objects and belong to the disk group specified by dgid.

  3. Verify that merge_config_tid matches the modification sequence number of the disk group specified by dgid.

  4. Verify that the disk records specified in merge_dm_rids exist in the configuration of the disk group specified by dgid.

  5. Verify that tinfo is not NULL.

If parameter validation fails, the server MUST fail the operation immediately, returning an appropriate error as its response to the client.

Otherwise, the server MUST process the message as follows:

  1. Merge the foreign disk group specified by dgid into the primary disk group of the system:

    • Bring all dynamic disks and volumes belonging to the foreign disk group online.

  2. Wait for the merge to either succeed or fail.

  3. Fill in the tinfo output parameter.

    TASK_INFO member

    Required for this operation

    TASK_INFO::id

    Required.

    TASK_INFO::storageId

    Not required.

    TASK_INFO::createTime

    Not required.<149>

    TASK_INFO::clientID

    Not required.<150>

    TASK_INFO::percentComplete

    Required for any task that returns REQ_IN_PROGRESS.

    TASK_INFO::status

    Required.

    TASK_INFO::type

    Required if PercentageComplete is being used.

    TASK_INFO::error

    Required.

    TASK_INFO::tflag

    Not required.<151>

  4. Return a response to the client containing tinfo and the status of the operation.

  5. Send the task completion notification.

If the operation is successful, the server MUST make the following changes to the list of storage objects before returning the response:

  1. Modify the disk objects of the foreign disk group to account for the change in status.

  2. Create new dynamic volume objects that correspond to the imported volumes.

  3. Create new disk region objects that correspond to the imported volumes.

  4. Modify drive letter objects to mark them as in use by the imported volumes (if the volumes have drive letters).

  5. Create file system objects for the imported volumes (if the volumes are formatted with file systems).