One task that crops up often when working with ESXi host storage from the command line is how to match up VMFS datastores to the storage device they live on. There are a couple of ways to find this information from the CLI, either directly or by using a vMA. Using ESXCLI you can get the information by running:
~ # esxcli storage vmfs extent list Volume Name VMFS UUID Extent Number Device Name Partition -------------------- ----------------------------------- ------------- ---------------------------------------------------- --------- TestVOL 4ff9dae8-858c7e95-12f0-000c29e8410a 0 mpx.vmhba1:C0:T2:L0 1 datastore1 4f27b82e-3fc1540e-bf6b-000c295da2d9 0 mpx.vmhba1:C0:T0:L0 3 SSD-Local 504fbcbd-1d655805-636f-000c29e8410a 0 mpx.vmhba1:C0:T4:L0 1 T1 50f13834-f177d8d5-5ec4-000c296f569c 0 mpx.vmhba1:C0:T1:L0 1 SANDS1 4ffa2c9d-a124e5c7-39c6-000c29e841f6 0 t10.F405E46494C4540013C625565687D2A6A75633D293877753 1 snap-21483998-SANDS1 50ddca61-f6faa2a4-e005-000c29e841f6 0 t10.F405E46494C454000714543337B6D29543B603D2A6652613 1
Alternatively, you can use vicfg-scsidevs from a vMA (or esxcfg-scsidevs if run locally):
~ # esxcfg-scsidevs -m mpx.vmhba1:C0:T2:L0:1 /vmfs/devices/disks/mpx.vmhba1:C0:T2:L0:1 4ff9dae8-858c7e95-12f0-000c29e8410a 0 TestVOL mpx.vmhba1:C0:T0:L0:3 /vmfs/devices/disks/mpx.vmhba1:C0:T0:L0:3 4f27b82e-3fc1540e-bf6b-000c295da2d9 0 datastore1