3.4.5.2.6.2 IVdsServiceUninstallDisk::UninstallDisks (Opnum 4)

The UninstallDisks method uninstalls a specific set of disks when it is given a list of the VDS object IDs for the disks. All volumes that are contained wholly or partially on the disks are also uninstalled, and the obsolete mount points are removed.

 HRESULT UninstallDisks(
   [in, size_is(ulCount)] VDS_OBJECT_ID* pDiskIdArray,
   [in] unsigned long ulCount,
   [in] boolean bForce,
   [out] boolean* pbReboot,
   [out, size_is(ulCount)] HRESULT* pResults
 );

pDiskIdArray: A pointer to an array of VDS_OBJECT_ID structures that store the VDS object IDs of the disks to be uninstalled.

ulCount: The number of disks that are specified in pDiskIdArray.

bForce: A Boolean that determines whether the volume dismount is forced.

pbReboot: A pointer to a Boolean that, if the operation is successfully completed, indicates whether the user is required to reboot the remote machine to complete the uninstall process.

pResults: A pointer to an array of HRESULT values that, if the operation is successfully completed, receives an HRESULT for each disk uninstall request. There MUST be one HRESULT value in the array for each disk in pDiskIdArray. If any disk fails to uninstall properly, the error code for that failure is received in the corresponding entry in pResults.

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.

When the server receives this message, it MUST validate the following parameters:

  • Verify that pDiskIdArray is not NULL.

  • Verify that pbReboot is not NULL.

  • Verify that pResults is not NULL.

The server MUST perform the following:

  • For each VDS object identifier in the specified pDiskIdArray, lock and dismount all volumes that have extents on the disk. If the value of the Boolean that bForce references is specified as TRUE, continue to the next steps, even if the lock or dismount operation fails.

  • For each VDS object identifier in the specified pDiskIdArray, take offline (if possible) and uninstall all volumes that have extents on the disk. For information on removing volumes, see section 3.4.5.1.6.

  • If the volume uninstalls require a reboot to take full effect, set the value of the Boolean that pbReboot references to TRUE; otherwise, FALSE.

  • For each VDS object identifier in the specified pDiskIdArray, uninstall the disk that corresponds to the identifier. Set the status of each disk operation to the corresponding value in the array that pResults specifies. For more information on removing disk objects, see section 3.4.5.1.4.

  • If the disk uninstalls require a restart to take full effect, set the value of the Boolean that pbReboot references to TRUE; otherwise, FALSE.

  • Clean up any obsolete drive letters and mount points for the volumes that have been uninstalled.

  • Return success (HRESULT of 0x00000000) if successful.