Well if you just use the Get-ClusterSharedVolume cmdlet it won’t get you very far… However there’s another cmdlet Get-ClusterParameter that will give you enough data that when combined with some other PowerShell/.Net magic will. This function will return the Cluster Object Private Properties for a given object you can look on MSDN to see all of them – in this case we are interested specifically in the Physical Disk Private Properties.
For this first example I am going to utilize the DiskUniqueIds property to extract information about the specific LUN. Looking at the documentation for this property it returns a STORAGE_DEVICE_ID_DESCRIPTOR structure which has a set of identifiers – after some more digging around it turns out these identifiers are actually STORAGE_IDENTIFIER structures which have some interesting values. For most of the storage I have in the lab at the very least the vendor ID (StorageIdTypeEUI64) which is actually a bit mask of the IEEE vendor ID along with some vendor specific data (the bit map is documented here and you can search for vendor ID’s here) as well as a VendorID string and some LUN information although some will tell you what port is being used etc…
In order to format all of this data I’m using some inline C# to define a class with the reprehensive structures and enumerations – just copied from MSDN and made pretty for .Net interop. I also wrote a function in the C# class named DiskUniqueIdstoStorageId, this function takes the byte array returned from calling the Get-ClusterParameter cmdlet and marshel’s it or formats it into the C# classes thus allowing me to consume the now managed object’s in C#. All in all it might be overkill so look for a shorter version coming soon.
Windows PowerShell Copyright (C) 2009 Microsoft Corporation. All rights reserved.
PS C:\Users\taylorb>.\GetCSVDevInfo1.ps1
CSV ClusterResourceName: Cluster_CSV1_IBMXIV Identifiers: CodeSet : Binary Type : EUI64 IdentifierSize : 8 NextOffset : 28 Association : Device Identifiers : 0 17 38 0 1 13 0 1C
CodeSet : Ascii Type : VendorId IdentifierSize : 36 NextOffset : 56 Association : Device Identifiers : IBM 2810XIV 1300113001C
CodeSet : Ascii Type : VendorSpecific IdentifierSize : 13 NextOffset : 32 Association : Device Identifiers : vol=CSV_1
CodeSet : Ascii Type : VendorSpecific IdentifierSize : 22 NextOffset : 40 Association : Device Identifiers : host=37-4611K2713K
CodeSet : Binary Type : TargetPortGroup IdentifierSize : 4 NextOffset : 24 Association : Port Identifiers : 0 0 0 0
CodeSet : Binary Type : PortRelative IdentifierSize : 4 NextOffset : 24 Association : Port Identifiers : 0 0 7 1
CSV ClusterResourceName: Cluster_CSV2_IBMXIV Identifiers: CodeSet : Binary Type : EUI64 IdentifierSize : 8 NextOffset : 28 Association : Device Identifiers : 0 17 38 0 1 13 0 1D
CodeSet : Ascii Type : VendorId IdentifierSize : 36 NextOffset : 56 Association : Device Identifiers : IBM 2810XIV 1300113001D
CodeSet : Ascii Type : VendorSpecific IdentifierSize : 13 NextOffset : 32 Association : Device Identifiers : vol=CSV_2
CodeSet : Ascii Type : VendorSpecific IdentifierSize : 22 NextOffset : 40 Association : Device Identifiers : host=37-4611K2713F
CodeSet : Binary Type : PortRelative IdentifierSize : 4 NextOffset : 24 Association : Port Identifiers : 0 0 7 3
Taylor Brown Hyper-V Enterprise Deployment Team taylorb@microsoft.com http://blogs.msdn.com/taylorb