How to determine which Windows drives map to which SAN storage devices using WMI?

1.1k views Asked by At

For a Windows machine, I'd like to programatically determine which of its drives are actually iSCSI or Fibre Channel (FC) volumes and what storage (SAN) device they are exposed from, i.e. where the data is actually stored. For example, the C:\ drive may be a volume exposed from My_SAN_Storage_Array (https://mysan.company.org) over Fibre Channel.

Ideally, I'd like to do this using WMI in order to be able to obtain this data for remote hosts as well. I don't want to use SAN vendor-specific tools that need to be deployed on each machine separately.

I've looked at a bunch of WMI classes but found nothing of use, e.g. Win32_LogicalDisk doesn't contain any useful info - all drives are seen as local drives; there is no distinction between network iSCSI/FC drives and local drives. diskpart didn't prove helpful either.

At the very least, I'd like to obtain some kind of drive ID (or SAN IQN/WWN) that I can use to determine the underlying SAN device. By querying the actual SAN devices I can determine what FC/iSCSI volumes (LUNs) are exposed to what hosts, but there's no information about the mapping of LUNs to the actual individual drives as seen by Windows. E.g. I can determine that LUN LogicalUnitA (as seen by the SAN device) is assigned to WindowsHostA, but I don't know how to figure out that LogicalUnitA is the C:\ drive as seen by Windows.

0

There are 0 answers