3.4.5.2.19.6 IVdsPack::AddDisk (Opnum 8)

This method initializes a disk that has no partitioning format defined, and then adds the disk to the disk pack. AddDisk cannot redefine the partitioning format on a disk.<82>

 HRESULT AddDisk(
   [in] VDS_OBJECT_ID DiskId,
   [in] VDS_PARTITION_STYLE PartitionStyle,
   [in] long bAsHotSpare
 );

DiskId: The VDS object ID of the disk object.

PartitionStyle: A value from the VDS_PARTITION_STYLE enumeration that indicates the partition format.

bAsHotSpare: The Virtual Disk Service Remote Protocol does not support this parameter; callers MUST set it to FALSE.

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 DiskId belongs to a disk object in the list of storage management objects corresponding to an unallocated disk.

  • Verify that PartitionStyle is a valid partitioning format.

The server MUST add the disk having a VDS_OBJECT_ID specified by DiskId to this pack, initialize the partitioning format of the disk based on the value of the PartitionStyle parameter, set the disk object's pack pointer to this pack object, and return an HRESULT indicating failure or success.