PowerCLI code to Find a datastore by NAA ID

There are times that you have a NAA ID of a LUN and need to find the corresponding datastore.

The below PowerCLI code is quite helpful that you can use to run to quickly find which datastore is attached to the NAA ID:


get-datastore |
Where-Object { $_.extensiondata.info.vmfs.extent.diskname -eq “NAA_ID of the Datastore”}

It returns the matching datastore name similar to this one:

get-datastore | Where-Object { $_.extensiondata.info.vmfs.extent.d
iskname -eq "naa.60060160f12335007e8600b99aeae211"}

Name                               FreeSpaceGB      CapacityGB
----                               -----------      ----------
DATASTORE_HIGH_0                       294.117       1,023.750

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 )

Google photo

You are commenting using your Google 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 )

Connecting to %s

%d bloggers like this:
search previous next tag category expand menu location phone mail time cart zoom edit close