@vakkilsrijith - Thanks for the nicely organized query. I just shorted the naa.ID to naa.600* (where DiskName -like 'naa.600*'
) and replace ft -auto with Out-GridView to get my entire inventory for asset management.
Get-Datastore | select Name,CapacityGB,FreeSpaceGB,@{n='DiskName';e={$_.ExtensionData.Info.Vmfs.Extent.Diskname}},@{n='Hosts';e={[string]::Join(',', (Get-VMHost -Datastore $_.Name | select -ExpandProperty Name))}} | where DiskName -like 'naa.600*' | sort DiskName | Out-Gridview -T "Data Center Data Storage"
Thank you.
------------------------------
VMSysAdmin
------------------------------
Original Message:
Sent: Nov 21, 2022 06:33 PM
From: Srijith Vakkil
Subject: Find the Device name which is backing the Datastore
You can use this command
Replace 'naa.60060e8007*' with the naa.ID for the storage array or the beginning
Get-Datastore | select Name,CapacityGB,FreeSpaceGB,@{n='DiskName';e={$_.ExtensionData.Info.Vmfs.Extent.Diskname}},@{n='Hosts';e={[string]::Join(',', (Get-VMHost -Datastore $_.Name | select -ExpandProperty Name))}} | where DiskName -like 'naa.60060e8007*' | sort DiskName | ft -AutoSize
This will provide additional details like ESXi Hosts to which the DS/volume is mounted.