Identifying DataStore with its Canonical Name

Dealing with storage you surely gonna need to translate between DataStore Names / LUNS and Canonical names like “naa.60000xxxx”

Here’s a short command to help you:

Get-VMHost  | Get-Datastore | % {Get-View $_ | select name,@{n="WWN";e={$_.Info.Vmfs.Extent[0].DiskName}}} | sort-object name | ft -autosize

UPDATE:
I bumped into the Get-ScsiLun cmd-let and now here’s an easiest way to retrieve the canonical name:
This applet will show an entry for each Host connected to it, so it will be even useful to get all ESX conenected to it.

Get-Datastore <DataStoreName> | Get-ScsiLun | Select CanonicalName -First 1
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s