VMware Cloud Community
vinivirtus
Enthusiast
Enthusiast

As list LUN ID subimitted in the hosts ESXi 5.5 via power CLI - Help me please!

Hello!

I want to list which LUN ID presented to esxi via PowerCLI hosts.

Anyone know how to do, I'm doing more unsuccessful tests.

Help me please!

Reply
0 Kudos
1 Reply
ssbkang
Enthusiast
Enthusiast

Hey,

Try the following script:

$esxi = Get-VMHost -Name "Name of ESXi"

$esxcli = Get-ESXCLI -VMHost $esxi

$datastore_list = Get-Datastore -VMHost $esxi

$path_list = $esxcli.storage.core.path.list()

$output = $datastore_list | Foreach-Object {

  $datastore = $_

  $path_list | where {$_.Device -eq $datastore.ExtensionData.Info.Vmfs.Extent.diskname} | Get-Unique | Select @{N="Datastore";E={ $datastore.Name }}, Device, LUN

}

$output

Reply
0 Kudos