VMware Cloud Community
Mobster
Contributor
Contributor
Jump to solution

Accessibility of datastore

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

Tags (2)
0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

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

View solution in original post

0 Kudos
3 Replies
LucD
Leadership
Leadership
Jump to solution

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

0 Kudos
Mobster
Contributor
Contributor
Jump to solution

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.

0 Kudos
LucD
Leadership
Leadership
Jump to solution

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

0 Kudos