Compare the luns present on hosts in a cluster


But two node cluster it is very easy to compare the lun number and lun name. However in production there won’t be less than 3 cluster. For two node cluster, below is the command

Compare-Object -ReferenceObject $(Get-Datastore -VMHost pzesxi-09.pzwaredu.com) -differenceObject $(Get-Datastore -VMHost
pzesxi-07.pzwaredu.com) -IncludeEqual | Format-Table –AutoSize

image

For multiple node, you need some thing more advance that what i was able to do. But to make it simple here is the out and see the code below

image

 

$Cluster=get-cluster -name ESXi-Cluster | get-vmhost
foreach($hosts in $Cluster){
get-datastore -vmhost $hosts.name | sort name | format-table -autosize
$A=get-datastore -vmhost $hosts.name
$B=$A.count
Write-host "*********** $hosts.name Lun Count ($B)*************" -foreground Yellow
}

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s