Hi all,
I've been looking for a cmdlet or function that would return whether an NFS volume is mounted in read/write or read-only mode on a node. The use case for this is looping through a vCenter to ensure volumes that should be mounted as read-only weren't accidentally mounted as read/write during a node rebuild. I haven't yet found anything that returns this value.
Is there anything available in PowerCLI that will provide this information?
Thanks,
Jason
Try something like this
foreach($ds in (Get-Datastore | where {$_.Type -eq "NFS"})){
$ds.ExtensionData.Host |
Select @{N="DS";E={$ds.Name}},
@{N="RemoteHost";E={$ds.RemoteHost}},
@{N="RemotePath";E={$ds.RemotePath}},
@{N="ESXi";E={Get-view $_.Key -Property Name | Select -ExpandProperty Name}},
@{N="AccessMode";E={$_.MountInfo.AccessMode}}
}
If you only want to see the read-only ones, you can add a Where-clause
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Try something like this
foreach($ds in (Get-Datastore | where {$_.Type -eq "NFS"})){
$ds.ExtensionData.Host |
Select @{N="DS";E={$ds.Name}},
@{N="RemoteHost";E={$ds.RemoteHost}},
@{N="RemotePath";E={$ds.RemotePath}},
@{N="ESXi";E={Get-view $_.Key -Property Name | Select -ExpandProperty Name}},
@{N="AccessMode";E={$_.MountInfo.AccessMode}}
}
If you only want to see the read-only ones, you can add a Where-clause
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
This is exactly what I was looking for, thanks!
Jason