Posts

Showing posts from February, 2013

Powershell - Find VM raw disk path to netapp lun

Purpose:
I needed a way get raw disk mappings from a vmware vm to the lun it is using on a netapp filer. One thing that needs to be edited is the SearchFilers function. Just add your runtime names and what filers they correspond to.Run this from powercli. and this requires the dataontap module which you can get from your now.netapp.com site Note: this script could be improved by gather all lun information from each filer instead of what i did the in the search filer function

param([string]$VC) Import-Module DataONTAP ######################### ####Tony Unger ######################### #################Functions############################################## function GetNetappPath([string]$VMHost,[string]$VMHDLunID,[string]$RuntimeName) { $stor = get-view (Get-VMHostStorage -VMHost $VMHost) $IscsiWWN = $stor.StorageDeviceInfo.HostBusAdapter | where {$_.GetType().Name -eq "HostInternetScsiHba"} | Select -First 1 -expandproperty IScsiName Write-Host "Found…