VMware Cloud Community
alanrenouf
VMware Employee
VMware Employee
Jump to solution

Get-datastore - add LUN ID ?

Hi,

Is there an easy way to add the LUN Addresss / ID to the get-datastore command to show:

DataStore Name | LUN Address / ID

Datastore 01 | vmhba:0:1:1

Thanks

Blog: http://virtu-al.net Twitter: http://twitter.com/alanrenouf Co-author of the PowerCLI Book: http://powerclibook.com
Reply
0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

Perhaps this can help.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

View solution in original post

Reply
0 Kudos
5 Replies
halr9000
Commander
Commander
Jump to solution

Datastores are logical and to the point of view of your VI, have nothing to do with LUNs. You have to go back to the host adapter to get that information.

PS > Get-VMHostStorage | select -ExpandProperty scsilun

CanonicalN LunType    Key                            Model      SerialNumb Vendor
ame                                                             er
---------- -------    ---                            -----      ---------- ------
vmhba0:1:0 disk       key-vim.host.ScsiDisk-vmhba... MAP3735... unavail... FUJITSU
vmhba0:2:0 disk       key-vim.host.ScsiDisk-vmhba... MAP3735... unavail... FUJITSU
vmhba0:0:0 disk       key-vim.host.ScsiDisk-vmhba... ST33660... unavail... SEAGATE

I'm sure there's a way that you can tie the info together, but I'll leave that as an exercise for someone else. Smiley Happy

Author of the upcoming book: Managing VMware Infrastructure with PowerShell

Co-Host, PowerScripting Podcast (http://powerscripting.net)

My signature used to be pretty, but then the forum software broked it. vExpert. Microsoft MVP (Windows PowerShell). Author, Podcaster, Speaker. I'm @halr9000
alanrenouf
VMware Employee
VMware Employee
Jump to solution

Thanks Hal, should be able to get it from there.

Blog: http://virtu-al.net Twitter: http://twitter.com/alanrenouf Co-author of the PowerCLI Book: http://powerclibook.com
Reply
0 Kudos
LucD
Leadership
Leadership
Jump to solution

Perhaps this can help.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Reply
0 Kudos
hugopeeters
Hot Shot
Hot Shot
Jump to solution

Alan,

Take a look at my entry for the contest:

http://communities.vmware.com/docs/DOC-6991

or:

http://www.peetersonline.nl/index.php/uncategorized/my-scripting-contest-contribution/

It contains a section that creates an object relating each datastore with it's extents. You could copy/paste that.

Regards,

Hugo

alanrenouf
VMware Employee
VMware Employee
Jump to solution

Thanks, read that last night as I have you on my RSS feed, very impressive. Some good stuff going into the competition now, I don't envy the judges !

Alan

Blog: http://virtu-al.net Twitter: http://twitter.com/alanrenouf Co-author of the PowerCLI Book: http://powerclibook.com
Reply
0 Kudos