I need to determine whether a given datastore is accessible from ESX
hosts. I notice that the datastore MO has a property called
accessible. However, in my testing, even when I take the datastore down
(it was a test NFS datastore and I just shut the NFS host down), the
accessible property still return true.
Does anyone know of a way to determine when/if a given datastore is no longer accessible by an ESX host?
Many thanks in advance for your help.
--Moby
Did you call UpdsateViewData after you powered off the NFS server ?
$ds = Get-Datastore <name> | Get-View .... # NFS server powered off $ds.UpdateViewData() ....
Note that in PowerCLI 4.1 you have access to the MO via the ExtensionData property.
____________
Blog: LucD notes
Twitter: lucd22
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Did you call UpdsateViewData after you powered off the NFS server ?
$ds = Get-Datastore <name> | Get-View .... # NFS server powered off $ds.UpdateViewData() ....
Note that in PowerCLI 4.1 you have access to the MO via the ExtensionData property.
____________
Blog: LucD notes
Twitter: lucd22
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Thanks LucD, calling UpdateViewData() refreshed the view and gets me correct information. However, now one more question nags at me. If I connect to the VC, then do a Get-Datastore etc and then check the accessible attribute, how do I know what host that ds.accessible applies to? What is the given datastore is shared between 4 hosts, but for whatever reason is has become inaccessible on 2 - what would the accessible attribute mean then for the datastore?
Thanks again btw.
As it happens there is a script that does just that in my LUN report – datastore, RDM and node visibility post.
____________
Blog: LucD notes
Twitter: lucd22
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference