Adding Foreign Disks to a Pack

[Beginning with Windows 8 and Windows Server 2012, the Virtual Disk Service COM interface is superseded by the Windows Storage Management API.]

Most commonly, a foreign disk is a dynamic disk that is allocated on one computer and physically moved to another computer. However, any disk that belongs to a pack other than the online pack is considered to be a foreign disk that belongs to a foreign disk pack.

A foreign pack has the VDS_PKF_FOREIGN flag set in the ulFlags member of the VDS_PACK_PROP structure. Foreign packs are always offline.

The following procedure describes how to import one or more foreign disks.

To import one or more foreign disks

  1. Move disks to the new computer.
  2. On the new computer, use the IVdsService::Reenumerate method to install the foreign disks.
  3. Select the online pack to be the target pack that receives the foreign disks. If no online pack exists, use the IVdsSwProvider::CreatePack method to create a new empty pack.
  4. Use the IVdsPack::MigrateDisks method to import the disks to the new dynamic pack.
  5. Use the IVdsSwProvider::QueryPacks method to enumerate the packs and IVdsPack::GetProperties to determine which pack is now the online pack.

If you create a new empty target pack, the foreign disks are not actually migrated to that pack. Instead, the foreign pack is marked online, the VDS_PKF_FOREIGN flag for the pack is cleared (so the pack is no longer foreign), and the target pack that you created is discarded.

Note

Use the IVdsPack::AddDisk method to add unallocated disks—disks not claimed by a provider—to a pack. An unallocated disk cannot be foreign.

 

Using VDS

IVdsService::Reenumerate

IVdsSwProvider::CreatePack

IVdsPack::MigrateDisks

IVdsPack::AddDisk