3.2.4.4.1.42 IVolumeClient::ReplaceRaid5Column (Opnum 51)

The ReplaceRaid5Column method repairs a dynamic RAID-5 volume by replacing the failed member of the volume with a specified disk. This is a synchronous task.

 HRESULT ReplaceRaid5Column(
   [in] LdmObjectId volumeId,
   [in] hyper volumeLastKnownState,
   [in] LdmObjectId newDiskId,
   [in] hyper diskLastKnownState,
   [out] TASK_INFO* tinfo
 );

volumeId: Specifies the OID of the volume in which to replace the member.

volumeLastKnownState: Last known modification sequence number of the RAID-5 volume.

newDiskId: Specifies the OID of the replacement disk.

diskLastKnownState: Replacement disk's last known modification sequence number.

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

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 the dynamic volume specified by volumeId is in the list of storage objects, and check whether volumeLastKnownState matches the field LastKnownState of the object. Verify that the volume is RAID-5.

  2. Verify that the disk specified by newDiskId is in the list of storage objects, and check whether diskLastKnownState matches the LastKnownState field of the object.

  3. 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. Replace the failed member of the RAID-5 volume specified by volumeId:

    1. Remove and delete the failed member of the volume.

    2. Create a new member of the volume on the disk specified by newDiskId.

    3. Start a task to regenerate the parity of the volume.

  2. Wait for the member replacement 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.<156>

    TASK_INFO::clientID

    Not required.<157>

    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.<158>

  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 dynamic volume object to account for the change in status and list of members.

  2. Modify the disk object where the new volume member was created to account for the change in region allocation.

  3. Create new disk region objects that correspond to the new volume member.

  4. Modify or delete the free disk region objects where the new volume member was created to account for the allocation of the volume member in those regions.

  5. Modify the disk object that corresponds to the deleted member to account for the change in region allocation.

  6. Delete disk region objects that correspond to the deleted member.

  7. Create new free region objects or modify adjacent free region objects to account for the free space created by the deletion of the old member.