Hi
I created this piece of Powershell to find out if some hosts report a datastore as inaccessible.
$listdatastores = Get-Datastore
ForEach( $DS in $listdatastores)
{
$DSView = Get-View $DS
ForEach( $MountHost in $DSView.host )
{
if( -not $MountHost.MountInfo.Mounted )
{
Write-Host $DS.Name $MountHost.Key $MountHost.MountInfo.Mounted $MountHost.MountInfo.Accessible
}
if( -not $MountHost.MountInfo.Accessible )
{
Write-Host $DS.Name $MountHost.Key $MountHost.MountInfo.Mounted $MountHost.MountInfo.Accessible
}
}
}
The output is:
UTRDS120-T1 HostSystem-host-388 True False
UTRDS120-T1 HostSystem-host-267 True False
UTRDS120-T1 HostSystem-host-51 True False
UTRDS121-T1 HostSystem-host-388 True False
UTRDS121-T1 HostSystem-host-51 True False
Which is good, since it tells me that some datastores are inaccessible. But now it would be great to also report the name of the ESXi host, but I don't know how to go back from HostSystem-host-388 to a ESXi hostname.
Gabrie