hi everyone,
i'm now using this one to list the RDM's
$report = @()
$vms = Get-VM | Get-View
foreach($vm in $vms){
foreach($dev in $vm.Config.Hardware.Device){
if(($dev.gettype()).Name -eq "VirtualDisk"){
if($dev.Backing.CompatibilityMode -eq "physicalMode"){
$row = "" | select VMName, HDDeviceName, HDFileName
$row.VMName = $vm.Name
$row.HDDeviceName = $dev.Backing.DeviceName
$row.HDFileName = $dev.Backing.FileName
$report += $row
}
}
}
}
$report | Export-Csv c:\rdm.csv
this lists the RDM devices "ClusterName","LunName","LunUuid","Lunsize","VolumeName" but but what i really need is the mapping id of the lun given from the shared storage device (NetApp) which i can see in the hba devices paths in vsphere. and after that i want to add the RDM disk with the particular Lun ID to a Vm.
This is very important for me so i appreciate any help on this.
Thanks Alot.