Get physical disk mapping for Win 8 Storage Spaces virtual disks

  • Thread starter Thread starter Sam Wood
  • Start date Start date
S

Sam Wood

Guest
Hi all,

Has anyone poked Storage Spaces with DeviceIoControl yet?

We've got the new Storage Management API in Win 8, and it handles Storage Spaces instead of the existing disk tools (diskpart, Disk Management etc.). It's based on WMI.

Using PowerShell Get-StoragePool | Get-Physical Disk (or the equivalent in WMI) I can retrieve the specific physical disks that make up a Storage Pool. However, none of the metadata associated with the physical disk WMI object matches up reliably with anything else I can find in the system.

I make a tool that helps identify physical disks in a server, and it's critical that I can link an MSFT_PhysicalDisk (a physical disk that's part of a Storage Pool) to an actual physical disk (so that I can grab SMART data, SCSI paths, and a bunch of other stuff).

Some interesting device interface GUIDs I can't find anything on:

  • 7fccc86c-228a-40ad-8a58-f590af7bfdce - GUID_DEVINTERFACE_x for disks that are part of a Storage Pool. Storage Spaces appears to remove the normal GUID_DEVINTERFACE_DISK interface and replaces it with this interface when a disk has been assigned to a Storage Pool.
  • 53f5630e-b6bf-11d0-94f2-00a0c91efb8b - GUID_DEVINTERFACE_y for the spaceport controller.
  • 7f108a28-9833-4b3b-b780-2c6b5fa5c062 - GUID_DEVINTERFACE_HIDDEN_VOLUME for the hidden volumes on disks that are part of a Storage Pool. These volumes don't have a mount point.


PowerShell/WMI for MSFT_PhysicalDisk returns data similar to this:

--------------------------------------------

AllocatedSize: 249376538624
BusType: 10
Description:
DeviceId: WDC WD2500KS-00M
EnclosureNumber:
FirmwareVersion: 1C03
FriendlyName: PhysicalDisk3
HealthStatus: 0
IsIndicationEnabled: False
IsPooled: True
LogicalSectorSize: 512
Manufacturer: ATA
Model:
ObjectId: {cfe8c37f-7aa3-11e1-b9e2-806e6f6e6963}
OperationalStatus: System.UInt16[] [Array]
PartNumber:
PassThroughClass:
PassThroughIds:
PassThroughNamespace:
PassThroughServer:
PhysicalLocation:
PhysicalSectorSize: 512
SerialNumber: WD-WCxxxxxxxxx
Size: 249376538624
SlotNumber:
SoftwareVersion:
SpindleSpeed: 1
UniqueId: ATA WDC WD2500KS-00MJB0 WD-WCxxxxxxxx
Usage: 1
__GENUS: 2
__CLASS: MSFT_PhysicalDisk
__SUPERCLASS: MSFT_StorageObject
__DYNASTY: MSFT_StorageObject
__RELPATH: MSFT_PhysicalDisk.ObjectId="{cfe8c37f-7aa3-11e1-b9e2-806e6f6e6963}"
__PROPERTY_COUNT: 29
__DERIVATION: System.String[] [Array]
__SERVER: SERVER4
__NAMESPACE: Root\Microsoft\Windows\Storage
__PATH: \\SERVER4\Root\Microsoft\Windows\Storage:MSFT_PhysicalDisk.ObjectId="{cfe8c37f-7aa3-11e1-b9e2-806e6f6e6963}"
dynamic: True

--------------------------------------------

The "FriendlyName" property is interesting, because that matches \\.\PhysicalDiskX device path for the disk. However, the MSFT_PhysicalDisk class has a method that lets you change the FriendlyName to whatever you want. Not something I can rely on. ObjectId and UniqueId don't match anything I can find using IOCTL_STORAGE_QUERY_PROPERTY.

I've crawled the Win 8 DDK and can't find any reference to my two key GUIDs (for spaceport and Storage Space physical disks). I can open a handle to the disk using the new interface and query for everything I need, I just don't have a way to reliably link those disks to a Storage Space I get from PowerShell/WMI.

To recap, does anyone know how to match a physical disk device to a Storage Space without using WMI?


Development Blog: http://blog.tentaclesoftware.com/
Disk Management for WHS: http://www.tentaclesoftware.com/WHSDiskManagement/

Continue reading...
 
Back
Top