3.4.5.2.39.4 IVdsVolumePlex::Repair (Opnum 6)
The Repair method repairs a fault-tolerant volume plex by moving defective members to good disks. Only plexes that are RAID-5, striped with parity, can be repaired with this method.
-
HRESULT Repair( [in, size_is(lNumberOfDisks)] VDS_INPUT_DISK* pInputDiskArray, [in] long lNumberOfDisks, [out] IVdsAsync** ppAsync );
pInputDiskArray: An array of VDS_INPUT_DISK structures that describe the replacement disks. Only diskId and ullSize SHOULD be specified in each VDS_INPUT_DISK element. Only one new disk can be passed to this method at a time.
lNumberOfDisks: The number of elements in pInputDiskArray. Only one new disk can be passed to this method at a time.
ppAsync: A pointer to an IVdsAsync interface that, if the operation is successfully completed, receives the IVdsAsync interface to monitor and control this operation. Callers MUST release the interface when they are done with it. If the Wait method is called on the interface, the interface returned in the VDS_ASYNC_OUTPUT structure MUST be released as well. For information on asynchronous tasks, see section 3.4.5.1.9.
Return Values: The method MUST return zero or a non-error HRESULT (as specified in [MS-ERREF]) to indicate success, or return an implementation-specific nonzero error code to indicate failure. For the HRESULT values predefined by the Virtual Disk Service Remote Protocol, see section 2.2.3.
ERROR_SUCCESS (0x00000000)
When the server receives this message, it MUST validate the following parameters:
Verify that the volume plex is RAID-5.
Verify that pInputDiskArray is not NULL.
Verify that ppAsync is not NULL.
If the volume resides on a basic disk, the server MUST return VDS_E_NOT_SUPPORTED (HRESULT of 0x80042400) or E_NOTIMPL (HRESULT of 0x80004001, which means that the method is not implemented).
The server MUST perform the following:
Verify that the disks specified using the pInputDiskArray parameter have no extents belonging to the volume that is being repaired. If the pInputDiskArray parameter fails this requirement, then the server MUST return VDS_E_DISK_IN_USE_BY_VOLUME.
Create a new async object implementing the IVdsAsync interface with an output type of VDS_ASYNCOUT_REPAIRVOLUMEPLEX and set the pointer that ppAsync references to the interface.
Return an HRESULT indicating failure or success. Any errors encountered up through this point in processing the operation are returned in this HRESULT.
The server MUST then perform the following in sequence. Errors generated in this sequence of steps are returned in the pHrResult parameter to the IVdsAsync::Wait or IVdsAsyncQueryStatus methods.
Repair the volume plex corresponding to the VDS_OBJECT_ID that PlexId specifies from this volume by moving defective members to good disks.
Set the return code in the async object to an HRESULT indicating failure or success.
If the task completed successfully, set the percentage completed value in the async object to 100.
Set the signal state in the async object to TRUE.
The server MUST update the percentage completed value periodically during the preceding sequence. How often the percentage completed is updated, and at what point in the sequence, is implementation-specific.