VMware {code} Community
MikeSullivan
Contributor
Contributor

Determine SCSI queue depth using VM API

Can the current number Queued commands for a scsi device be obtained using the VM API?

0 Kudos
10 Replies
ssurana
VMware Employee
VMware Employee

Hi Mike,

For fetching the SCSI queueDepth you can use the following hierarchy:

HostSystem->configManager->storageSystem->storageDeviceInfo->scsiLun->queueDepth

The VI SDK reference for the same can be found at http://pubs.vmware.com/vi301/sdk/ReferenceGuide/vim.host.ScsiLun.html#queueDepth

I hope the above information helps.

~ Sidharth

0 Kudos
MikeSullivan
Contributor
Contributor

Sidharth

I had tried that but was getting an undefined method. I wonder if there is a config change required in order to make that information available via the API.

Thanks for the response.

Best Regards

Mike

>>> ssurana <communities-emailer@vmware.com> 10/26/07 5:29 PM >>>

MikeSullivan,

A new message was posted in the thread "Determine SCSI queue depth using VM API":

http://communities.vmware.com/message/780030

Author : ssurana

Profile : http://communities.vmware.com/people/ssurana

Message:

0 Kudos
ummak
Contributor
Contributor

I'm a littler confused as to where queueDepth really lives.

When I check VC/Host/Config/Advanced/DiskSchedNumReqOutstanding I see the value as 16, but when I check it at the ESX 3.0.1 level I get 20:

esxcfg-module -g lpfcdd_732

lpfcdd_732 enabled = 1 options = 'lpfc0_lun_queue_depth=20 lpfc1_lun_queue_depth=20'

Also trying to get the data via API scsuLun does not have queueDepth

(HostSystem-&gt;configManager-&gt;storageSystem-&gt;storageDeviceInfo-&gt;scsiLun-&gt;queueDepth)

Also tried looking in HostSystem-&gt;Config-&gt;storageDevice and i get the following (still no queueDepth)!!!

'scsiLun' =&gt; [

bless( {

'canonicalName' =&gt; 'vmhba1:0:0',

'capacity' =&gt; bless( {

'block' =&gt; '0',

'blockSize' =&gt; '512'

}, 'HostDiskDimensionsLba' ),

'deviceName' =&gt; '/vmfs/devices/disks/vmhba1:0:0:0',

'devicePath' =&gt; '/vmfs/devices/disks/vmhba1:0:0:0',

'deviceType' =&gt; 'disk',

'durableName' =&gt; bless( {

'data' =&gt; [

'55',

'48',

'50',

'48',

'48',

'56',

'48',

'48',

'48',

'48',

'48',

'48',

'83',

'89',

'77',

'77',

'69',

'84'

],

'namespace' =&gt; 'SERIALNUM',

'namespaceId' =&gt; '1'

}, 'ScsiLunDurableName' ),

'key' =&gt; 'key-vim.host.ScsiDisk-vmhba1:0:0',

'lunType' =&gt; 'disk',

'model' =&gt; 'SYMMETRIX ',

'operationalState' =&gt; [

'unknown'

],

'revision' =&gt; '5568',

'scsiLevel' =&gt; '4',

'serialNumber' =&gt; 'unavailable',

'uuid' =&gt; '010000000037303230303830303030303053594d4d4554',

'vendor' =&gt; 'EMC '

}, 'HostScsiDisk' ),

Message was edited by: ummak

Can anyone help with this?

0 Kudos
admin
Immortal
Immortal

Are you trying to get the information through the VI Perl Toolkit or through a Java interface? If it is the VIPT, I was wondering if perhaps you are trying to access the MO without using get_view i.e. you are trying to get the info from MORef rather than the MO. That would result in an "undefined method" exception.

0 Kudos
ummak
Contributor
Contributor

I'm using the VIPT. Here is my code:

my $views = Vim::find_entity_views(view_type => 'HostSystem', filter => {'name' => 'somehostname'});

foreach (@$views) {

print Dumper($_->config->storageDevice);

}

the output i get is attached in this file (as you can see i can't find queue depth anywhere)

-Ummak

0 Kudos
ssurana
VMware Employee
VMware Employee

Hi Ummak,

From the output you have provided it seems that the for the Scsi Lun in your environment the queue depth is not set. Since it is not set therefore in the trace of the data object you are not able to see the queueDepth attribute itself. You can verify the same by browsing through the mob of your server using https:///mob.

Just in case you are not familiar with browsing the mob then once you open the above url (for the esx machine) click on the links following the below properties in the same order:

1. content

2. rootFolder

3. childEntity (There may be multiple links there, same as the number of datacenters you have in case you are browsing the VC mob)

4. hostFolder

5. childEntity (at this stage you ideally would reach the Managed Object Type of "ManagedObjectReference:ComputeResource" )

6. host

7. configManager

8. storageSystem

9. storageDeviceInfo

10. scsiLun (these are the list of scsi luns available to that host.)

Now on the last page browsed you would probably see "queueDepth" property with the value "Unset".

Hope the above information helps.

~ Sidharth

0 Kudos
ummak
Contributor
Contributor

it seems to be set....

esxcfg-module -g lpfcdd_732

lpfcdd_732 enabled = 1 options = 'lpfc0_lun_queue_depth=20 lpfc1_lun_queue_depth=20'

also tried

https://server/mob/?moid=storageSystem&doPath=storageDeviceInfo

and did not see queueDepth, see attached PDF screenshot

but when i dug a littler deeper into each lun, i found queueDepth as unset (see attached).

So the questions is, if esxcfg-module -g lpfcdd_732 returns queueDepth=20 but mob and VIPT don't what's going on???

0 Kudos
tmilner
Enthusiast
Enthusiast

Oh good. I'm not going crazy...

My queue depth also shows up as "Unset". I used the mob going through the VC and directly to the esx and its unset. Is there something I need to do to have a value show up for Queue depth? Its a SAN device hooked up on the other side. Is Queue Depth only supported by some drivers?

Tom

0 Kudos
ummak
Contributor
Contributor

Tom, good news is that you're not crazy, bad news is that after opening a ticket and escalating like crazy VMWare confirmed its a bug in the API! Also it has not been fixed in the 2.5/3.5 SDK either.

There are a few other ways to get the info.

Check out esxcfg-mpath command and the esx.conf file. Another thing to note is that the value is in hex

Hope this helps

-Ummak

0 Kudos
tmilner
Enthusiast
Enthusiast

Ummak,

Yes, that does help rather than me spinning my wheels! (I hate that). Much obliged. Smiley Wink

Tom

0 Kudos