3.4.5.2.19.7 IVdsPack::MigrateDisks (Opnum 9)

The MigrateDisks method migrates a set of disks from one pack to another pack.<83>

 HRESULT MigrateDisks(
   [in, size_is(lNumberOfDisks)] VDS_OBJECT_ID* pDiskArray,
   [in] long lNumberOfDisks,
   [in] VDS_OBJECT_ID TargetPack,
   [in] long bForce,
   [in] long bQueryOnly,
   [out, size_is(lNumberOfDisks)] HRESULT* pResults,
   [out] long* pbRebootNeeded
 );

pDiskArray: A pointer to an array of VDS object IDs--one for each disk object that corresponds to the disks to migrate.

lNumberOfDisks: The number of disks specified in pDiskArray.

TargetPack: The VDS object ID of the pack object.

bForce: A Boolean that determines whether disk migration is forced. When the client makes the call to migrate disks, the provider(s) that owns the disks is notified by the server that the disks are about to be migrated. The provider(s) can respond to this notification with an error.

If this parameter is set to a nonzero value, the migration operation will continue. If the parameter is set to zero and the provider(s) owning the disks responds to the notification with an error, the call to migrate the disks will fail.

bQueryOnly: A Boolean that determines whether the disk migration will actually happen.

pResults: A pointer to an array of HRESULT values that, if the operation is successfully completed, receives the HRESULTs returned by each disk migration request. There MUST be one HRESULT value in the array for each disk in pDiskArray. If any of the disks fail to migrate properly, the specific error code for that failure is received in the corresponding entry in pResults.

pbRebootNeeded: A pointer to a Boolean that, if the operation is successfully completed, receives an indication of whether the user needs to reboot the remote machine in order to complete the migration process.

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.

The HRESULTs in the array that pResults references return zero to indicate success or an implementation-specific nonzero error code if the migration operation on the associated disk fails.

ERROR_SUCCESS (0x00000000)

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

  • Verify that pDiskArray is not NULL.

  • Verify that pResults is not NULL.

  • Verify that pbRebootNeeded is not NULL.

The server MUST perform the following:

  • If this method is called against a dynamic disk which contains volume extents, and the target pack is a basic disk pack, then this method MUST return VDS_E_DISK_NOT_EMPTY.<84>

  • For each VDS object identifier in the specified pDiskArray, migrate the disk that corresponds to the identifier to this pack. Set the status of each migrate operation to the corresponding value in the array that pResults specifies.

  • For each successfully migrated disk, set the disk object's pack pointer to this pack object.

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

  • Return an HRESULT indicating failure or success; also return an HRESULT for each disk that is involved in the migration by using the pResults output parameter.

The server MAY perform the following: