VMware Cloud Community
rwatsh
Contributor
Contributor

How to get runtime name of storage LUN

Hi,

Can someone tell what class/property gives the Runtime Name for a LUN device that we see in vSphere client. I could not figure out from the MOB where we can get the Runtime name (which is kind of a short name based on the bus#, target id and lun id) for a lun.

Thanks,

Watsh

0 Kudos
8 Replies
lamw
Community Manager
Community Manager

The Runtime Name info is what is known as A:C:T:L or Adapter:Controller:Target:Lun

Take the host you're trying to access this information plug that into the following URL in the browser:

https://<hostname>/mob/?moid=storageSystem&doPath=storageDeviceInfo.scsiTopology

Basically, you're looking at the HostSystem's storage subsystem and looking at it's device information and the scsi topology.

You can also get it here by looking at the multipath information:

https://<hostname>/mob/?moid=storageSystem&doPath=storageDeviceInfo.multipathInfo

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

William Lam

VMware vExpert 2009,2010

VMware scripts and resources at:

Twitter: @lamw

Getting Started with the vMA (tips/tricks)

Getting Started with the vSphere SDK for Perl

VMware Code Central - Scripts/Sample code for Developers and Administrators

VMware Developer Community

If you find this information useful, please award points for "correct" or "helpful".

0 Kudos
rwatsh
Contributor
Contributor

Hi Lamw,

Thanks for the prompt reply.

I am unable to see the runtime name in the MOB though at the url you mentioned. I tried to go to HostScsiTopologyTarget and then to the HostScsiTopologyLun instance in the MOB but I don’t see any property with the value for runtime name. Do we need to derive it from multiple properties? Can you please tell what Type/Property(ies) combination I should be looking at?

I only see the A:C:T:L based runtime name through the vSphere client for the same lun.

Thanks,

Watsh

0 Kudos
lamw
Community Manager
Community Manager

Really? Hm, one of those URLs should have brought you to a page that displays what you're looking for. Make sure you're logging into the ESX or ESXi host MOB and not vCenter.

Here's the path for URL1:

1.

https://<hostname>/mob/?moid=ha-host

2. configManager -> storageSystem -> storageDeviceInfo -> scsiTopology

Here's the path for URL2:

1.

https://<hostname>/mob/?moid=ha-host

2. configManager -> storageSystem -> storageDeviceInfo -> multipathInfo -> "select LUN"

Note, this is for vSphere 4.0 only and not for VI 3.5 or older.

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

William Lam

VMware vExpert 2009,2010

VMware scripts and resources at:

Twitter: @lamw

Getting Started with the vMA (tips/tricks)

Getting Started with the vSphere SDK for Perl

VMware Code Central - Scripts/Sample code for Developers and Administrators

VMware Developer Community

If you find this information useful, please award points for "correct" or "helpful".

0 Kudos
rwatsh
Contributor
Contributor

Hi Lamw,

Yes I have been accessing the MOB on the ESX 4.0 server and not through vCenter.

I still don’t see the runtime name in the MOB for the ESX host. My ESX server is :VMware ESX 4.0.0 build-164009 – This is from the AboutInfo in the MOB.

Following are the screenshots of MOB view for what I get for the 2 paths you mentioned:

Path1: I also selected the lun.

Path2:

Thanks,

Watsh

0 Kudos
lamw
Community Manager
Community Manager

Its probably going to be much easier to extract this out using a script versus going through the MOB.

Here is a script that does a mapping from VMDK -> Device, it will give you the extract properties that you'll need to look at to get what you're looking for.

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

William Lam

VMware vExpert 2009,2010

VMware scripts and resources at:

Twitter: @lamw

Getting Started with the vMA (tips/tricks)

Getting Started with the vSphere SDK for Perl

VMware Code Central - Scripts/Sample code for Developers and Administrators

VMware Developer Community

If you find this information useful, please award points for "correct" or "helpful".

0 Kudos
rwatsh
Contributor
Contributor

I thought we could get it from APIs itself. Do you have a Java SDK API example. I don't use perl SDK in my setup.

Thanks for your help.

Watsh

0 Kudos
lamw
Community Manager
Community Manager

Yes as mentioned already, this is all accessible via the vSphere API, I'm just only familiar with the vSphere SDK for Perl bindings. If you take a look at the script, you'll see what components within the API I reference to generate the relevant pieces of information and you should be able to deduce and convert to relevant java code.

For more questions about the API or Java SDK, I would recommend that you post in the Developer forum and specifically in the Java section if you have questions around the Java SDK - http://communities.vmware.com/community/developer

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

William Lam

VMware vExpert 2009,2010

VMware scripts and resources at:

Twitter: @lamw

Getting Started with the vMA (tips/tricks)

Getting Started with the vSphere SDK for Perl

VMware Code Central - Scripts/Sample code for Developers and Administrators

VMware Developer Community

If you find this information useful, please award points for "correct" or "helpful".

0 Kudos
rwatsh
Contributor
Contributor

OK let me try that out then. Thanks for the quick reply.

Thanks,

Watsh

0 Kudos