Awhile back a guy at the San Antonio VMUG asked the technical group how you could get the actual LUN UUID for a particular Datastore. I informed him that it was available via the PowerCLI and to contact me via the VMUG forums. He never did. My storage guy at work loves this script, though, so I thought I’d share it with everybody.

Here’s the script:

Expected output should be something like this:

DS Name: DRTCRL0011101_VM_002
VMFS UUID: 481f5e2a-142ab69b-9ce3-001422168f72
LUN Name: vmhba1:2:1
LUN UUID: 0200010000600601605f1119008b9bac46a017dd11524149442035

This information may be useful when dealing on the storage side of things so you don’t pull the wrong LUN!