Hi,
Need help in getting the size and LUN ID of the datastore
Get-Datastore |
Select Name,
@{N='DateTime';E={Get-DateTime}},
@{N='CanonicalName';E={$_.ExtensionData.Info.Vmfs.Extent[0].DiskName}}
Thanks
Madhusudan
Try something like this
Get-Datastore |
Select Name,CapacityGB,
@{N='DateTime';E={Get-Date}},
@{N='CanonicalName';E={$_.ExtensionData.Info.Vmfs.Extent[0].DiskName}},
@{N='LUN';E={
$esx = Get-View -Id $_.ExtensionData.Host[0].Key -Property Name
$dev = $_.ExtensionData.Info.Vmfs.Extent[0].DiskName
$esxcli = Get-EsxCli -VMHost $esx.Name -V2
$esxcli.storage.nmp.path.list.Invoke(@{'device'=$dev}).RuntimeName.Split(':')[-1].TrimStart('L')}}
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Try something like this
Get-Datastore |
Select Name,CapacityGB,
@{N='DateTime';E={Get-Date}},
@{N='CanonicalName';E={$_.ExtensionData.Info.Vmfs.Extent[0].DiskName}},
@{N='LUN';E={
$esx = Get-View -Id $_.ExtensionData.Host[0].Key -Property Name
$dev = $_.ExtensionData.Info.Vmfs.Extent[0].DiskName
$esxcli = Get-EsxCli -VMHost $esx.Name -V2
$esxcli.storage.nmp.path.list.Invoke(@{'device'=$dev}).RuntimeName.Split(':')[-1].TrimStart('L')}}
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Perfect...on dot...as always
you rock LucD