Gets a list of all paths and their policy settings

# Gets a list of all paths and their policy settings(this is for storage related multipathing)

Connect-VIServer MYVISERVER

$ESX = get-vmhost "MyESXHost.mydomain.com" | Get-View

$Information = @()
foreach($disk in $esx.Config.StorageDevice.ScsiLun){
    $MyDetails = "" | Select-Object Name, Policy
    foreach($lun in $esx.Config.StorageDevice.MultipathInfo.Lun){
        if($disk.CanonicalName -eq $lun.Id){
            $MyDetails.Name = $disk.CanonicalName 
            $Mydetails.Policy = $lun.Policy.Policy
            $Information += $MyDetails
        }
    }
}
$Information

Comments

Popular posts from this blog

Designing and Configuring an Enterprise Cloud Solution

"Host IPMI system event log status" alarm in vCenter Server

Virtual machines appear as invalid or orphaned in vCenter Server