3.2.4.4.1.33 IVolumeClient::RemoveMirror (Opnum 37)
The RemoveMirror method removes a mirror from a dynamic volume. This is a synchronous task.
-
HRESULT RemoveMirror( [in] LdmObjectId volumeId, [in] hyper volumeLastKnownState, [in] LdmObjectId diskId, [in] hyper diskLastKnownState, [out] TASK_INFO* tinfo );
volumeId: Specifies the OID of the mirrored volume from which the disk is being removed.
volumeLastKnownState: Volume's last known modification sequence number.
diskId: Specifies the object identifier of the disk being removed from the volume.
diskLastKnownState: Last known modification sequence number of the disk being removed from the volume.
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:
Verify that the dynamic volume specified by volumeId is in the list of storage objects, and check whether the field volumeLastKnownState matches the field LastKnownState of the object. Verify that the dynamic volume is a mirrored one.
Verify that the disk specified by diskId is in the list of storage objects, and check whether diskLastKnownState matches the LastKnownState field of the object. Verify that the disk specified by diskId is in the mirror volume specified by volumeId.
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:
Delete the mirror of the volume specified by volumeId residing on the disk specified by diskId.
Wait for the mirror removal to either succeed or fail.
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.<120>
TASK_INFO::clientID
Not required.<121>
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.<122>
Return a response to the client containing tinfo and the status of the operation.
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:
Modify the dynamic volume object to account for the change in layout and number of members.
Modify the disks where the deleted volume member resided to account for the change in region allocation.
Delete the disk region objects that correspond to the deleted volume member.
Create new free region objects or modify adjacent free region objects to account for the free space created by the deletion.