Pages: [1]
Print
Author Topic: count how many luns are presented to each host  (Read 350 times)
esarakaitis
Administrator
Full Member
*****
Posts: 241


8223109 sack57@hotmail.com littleking57 rootinfortwayne
View Profile WWW Email
« on: June 03, 2009, 10:41:34 AM »

in my environment, i select all luns not-like Dell (raid controller)

Code:
foreach ($cluster in Get-Cluster)
{
    # Make sure this is returned as an array.
    $vmhosts = @($cluster | Get-VMHost)
 
    if ($vmhosts.Length -eq 0)
    {
        # No vmhosts in this cluster, move on to the next one.
        continue
    }
   
    $firstHost = $vmhosts[0]
   
    foreach ($scsilun in ($firstHost | get-scsilun | ? {$_.Vendor -notlike "*Dell*"} | measure-object))
    {
        # Output results
        "" | select  @{Name = "Cluster"; Expression = {$cluster.name}},@{Name = "Host"; Expression = {$firsthost.name}}, @{Name = "NumLunz"; Expression = {$scsilun.count}}
    }
}
Logged
Pages: [1]
Print
Jump to: