search
Categories
Sponsors
VirtualMetric Hyper-V Monitoring, Hyper-V Reporting
Archive
Blogroll

Badges
MCSE
Community

Cozumpark Bilisim Portali
Getting Physical Disk Information of Cluster Shared Volumes
Posted in Virtual Machine Manager, Windows Powershell | 4 Comments | 3,241 views | 22/05/2014 15:03

This is very basic function to get physical disk information of cluster shared volumes.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
function Get-CSVDiskLun
{
	param ($CSVName, $ClusterName=".")
 
	if ($CSVName -like "CSVolume*")
	{
		$CSVVolume = Get-ClusterSharedVolume -Cluster $ClusterName | Where Name -eq $CSVName
	}
	else
	{
		$CSVVolume = Get-ClusterSharedVolume -Cluster $ClusterName | Where {$_.SharedVolumeInfo.FriendlyVolumeName -like "*\$CSVName"}
	}
 
	# Get CSV Volume Name
	$CSVVolumeName = $CSVVolume.Name
 
	# Get CSV Signature
	$CSVSignature = ($CSVVolume  | Get-ClusterParameter DiskSignature).Value.Substring(2)
 
	# Get CSV Physical Disk
	$PhysicalDisk  = Get-WmiObject Win32_DiskDrive -ComputerName $ClusterName | Where {"{0:x}" -f $_.Signature -eq $CSVSignature}
 
	# Get CSV Physical Disk DeviceID
	$CSVDeviceID = $PhysicalDisk.DeviceID.Substring(4)
 
	# Get CSV Physical Disk Bus
	$CSVBus = $PhysicalDisk.SCSIBus
 
	# Get CSV Physical Disk LunID
	$CSVLunID = $PhysicalDisk.SCSILogicalUnit
 
	# Get CSV Physical Disk Caption
	$CSVCaption = $PhysicalDisk.Caption
 
	# Output
	$Value = $CSVVolumeName + ";" + $CSVDeviceID + ";" + $CSVLunID + ";" + $CSVCaption
	Write-Host $Value
}

You can call it like Get-CSVDiskLun Volume2 or Get-CSVDiskLun Volume2 Cluster01.


Comments (4)

Weekly IT Newsletter – May 19-23, 2014 | Just a Lync Guy

May 27th, 2014
05:19:18

[…] Getting Physical Disk Information of Cluster Shared Volumes – […]


NeWay Technologies – Weekly Newsletter #96 – May 22, 2014 | NeWay

May 27th, 2014
05:24:17

[…] Getting Physical Disk Information of Cluster Shared Volumes – […]


NeWay Technologies – Weekly Newsletter #96 – May 23, 2014 | NeWay

May 27th, 2014
05:27:09

[…] Getting Physical Disk Information of Cluster Shared Volumes – […]


Sreejith K

May 29th, 2015
07:37:23

Hi,

“Signature” property is available only for MBR disks. Incase of GPT disks, is there any way to find the association between Win32_DiskDrive and MsCluster_Disk?

Thanks,
Sreejith K



Leave a Reply