VMware Cloud Community
Srinivas_k
Enthusiast
Enthusiast

How to get Esxi Boot LUN information (SAN boot from EMC) through script

Hi All,

How to get Esxi boot LUN information from list of servers through script. I know how to get from ESXi shell from below KB.

Identifying ESXi/ESX boot LUNs for Boot From SAN configurations (2030957) | VMware KB

Thank you in Advance.

Reply
0 Kudos
6 Replies
jonathanmsa
Contributor
Contributor

Get-VMHost  | Get-ScsiLun | fl

or  you can potentially use the EsxliCLi

$esxcli = Get-EsxCli -VMHost $VMHos

$esxcli.storage.nmp.satp or $esxcli.storage.nmp.device

Reply
0 Kudos
Srinivas_k
Enthusiast
Enthusiast

When i run Get-VMHost  | Get-ScsiLun | fl , it is listing all LUN information which are attached to esxi servers

and below is out put from other commands

$esxcli = Get-EsxCli -VMHost esxiname

PowerCLI D:\> $esxcli.storage.nmp.satp

===================

EsxCliElement: satp

   Elements:

   ---------

   generic

   rule

   Methods:

   --------

   StorageArrayTypePlugin[] list()

   string set(boolean boot, string defaultpsp, string satp)

   string Help()

   string Help(string methodName)

==================================================

PowerCLI D:\> $esxcli.storage.nmp.device

=====================

EsxCliElement: device

   Methods:

   --------

   NmpDevice[] list(string device)

   boolean set(boolean default, string device, string psp)

   string Help()

   string Help(string methodName)

Reply
0 Kudos
jonathanmsa
Contributor
Contributor

sorry, here is the correct command

$esxcli.storage.nmp.device.list()

Reply
0 Kudos
Srinivas_k
Enthusiast
Enthusiast

it is listing all LUN information which are attached to esxi server not boot lun information.

Reply
0 Kudos
doddap
Contributor
Contributor

get the boot device uuid

$cli=Get-EsxCli

$cli.system.boot.device.get()|Select BootFilesystemUUID

take this uuid and match it with the mount filesystem from vmHost , then get the device backing from the mount info.

below link would help you to achieve the above mentioned step.

http://thephuck.com/virtualization/powercli-script-to-get-datastore-uuids/

Reply
0 Kudos
Srinivas_k
Enthusiast
Enthusiast

we are able to get the boot device uuid with $cli.system.boot.device.get()|Select BootFilesystemUUID

but from the script which is in http://thephuck.com/virtualization/powercli-script-to-get-datastore-uuids/ the input requires datastore name as we dont no the name i am not able to get the output form the script where i can match.

Reply
0 Kudos