VMware {code} Community
arpitmpatel13
Enthusiast
Enthusiast

Current Disk Queue Length

Hello All,

I am using Esx3.5 server with VC 2.5 and i want to determine the current disk queue length from VC through API.

If anyone can tell me how i can do this ?

0 Kudos
3 Replies
Niket
Enthusiast
Enthusiast

Hi,

Below is the code snippet to access queuedepth property.

TraversalSpec tSpec = buildTSpec();

PropertySpec[] propSpecArray = new PropertySpec[] { new PropertySpec() };

propSpecArray[0].type = "HostSystem";

propSpecArray[0].all = true;

propSpecArray[0].allSpecified = true;

PropertyFilterSpec spec = new PropertyFilterSpec();

spec.propSet = propSpecArray;

spec.objectSet = new ObjectSpec[] { new ObjectSpec() };

spec.objectSet[0].obj = _sic.rootFolder;

spec.objectSet[0].skip = false;

spec.objectSet[http://0].selectSet = new SelectionSpec[|http://0].selectSet = new SelectionSpec[] ;

ObjectContent[] ocArray =

service.RetrieveProperties(sic.propertyCollector, new PropertyFilterSpec[] );

foreach (ObjectContent oc in ocArray)

{

DynamicProperty[] pcArray = oc.propSet;

foreach (DynamicProperty d in pcArray)

{

if (d.name.Equals("config"))

{

HostConfigInfo hcf = (HostConfigInfo)d.val;

HostStorageDeviceInfo hsdi = hcf.storageDevice;

ScsiLun[] sc = hsdi.scsiLun;

foreach (ScsiLun sce in sc)

{

System.Console.Write(sce.canonicalName + " ");

System.Console.WriteLine(sce.queueDepth);

}

}

}

}

I hope it helps you.

Thanks

Niket

0 Kudos
tmilner
Enthusiast
Enthusiast

Well, yes, that will get the Queue Depth field, but I'm not sure its worth it. There's a VMware bug preventing it from being populated. http://communities.vmware.com/thread/108929?tstart=0

My esx 3.5 systems still show the queue depth field uninitialized.

Tom

0 Kudos
arpitmpatel13
Enthusiast
Enthusiast

Thanks alot...

It helps me lot ..

0 Kudos