/usr/lib/vmware/bin/vscsiStats -s -w <world_group_id>
/usr/lib/vmware/bin/vscsiStats -p <histo_type> [-c]


Irfan:
You mentioned at VMworld 2009 that you would like to see vscsiStats included in vCenter. Do you know if this is going to happen? Soon? If not soon, then will there be an ESXi version? My recommendation to roll-out ESX 4.0 vs. ESXi 4.0 would be influenced by the availability of vscsiStats-like data gathering.
Thanks.
aenagy: Can you describe your use case a little bit please?
Irfan
Irfan:
I am getting ready to roll out vSphere and still debating ESX vs. ESXi. There is no problem at this time, I just want to be prepared if we encounter performance problems.
aenagy: please get in touch with drummonds (author of this communities doc) if you need access to vscsiStats on ESXi. Stopping deployment of ESXi should not be gated on this issue.
Will do.
Thanks.
Is vscsiStats actually available for ESXi? I was under the impression it was only available on Service Console with the classic ESX
lamw: see my response to aenagy of Sep 17.
I think you have seen my blog about this already, but I have updated this document to answer your question.
Scott
More information on my blog and on Twitter:
http://vpivot.com
http://twitter.com/drummonds
How can I link the worldgroupIds and virtual disk handleIDs to objects in the rest of the world? I could of course find e.g. the VM uuid by doing a lookup using SOAP for that machine, but what about the disks if e.g. a VM uses more than one disk?
try vscsiStats -l and let me know if that helped at all. That's -l as in 'dash' 'el'.
Irfan
Not really. What I see for e.g. a virtual machine that uses 2 hard disks (one on iSCSI and one on NFS) is:# /usr/lib/vmware/bin/vscsiStats -l
Virtual Machine worldGroupID: 1144, Virtual Machine Display Name: Probe {
Virtual SCSI Disk handleID: 8200
Virtual SCSI Disk handleID: 8210
}
The histograms refer to the worldGroupID and handleID, but how do I know if 8200 is the iSCSI or the NFS disk?
The virtual disks should be presented to the VM in list order of that output. So, Hard Disk 1 should be the first one presented and so forth.
Irfan
Great! So I could do the following to find this:
1) find the hardware for the VM (e.g. via /mob/?moid=3904&doPath=config.hardware)
2) iterate over the virtual devices and find those of type VirtualDisk and look at their deviceInfo.label (e.g. "Hard Disk 1")
3) for these devices look at the backing.datastore to find out on which datastore they are located
and then map the datastores to the handleIDs in the same order.
Works for me as long as users can't change the labels of the devices (can they)? Or should I rely on the key attribute instead (first disk aways seems to have 2000, next one 2001 etc).
Thanks for the help and have a great weekend!
Sorry, I'm not a scripting expert. Maybe someone else can chip in to help. If possible, I'd like to get a hold of the final script you write though for future reference.
Irfan
If what @irfan.ahmad says is true about the the mapping of vscsiStats output to VMDK order in the VM configuration, then as @nkiesel pointed out this can easily be retrieved usign the VI/vSphere API.
@nkiesel, There is a unique key for each Device that is kept track on a per VM basis, hence you may see repetitive values such as 2000,2001,etc. as VMDK(s) afaik starts at 2000 and increments by 1 and actuallyt he users can change the labels to whatever their heart desires, if the order is kept upon the creation of the devices then it should be trivial to map.
Here is a script I wrote awhile back that retrieves some info about VM's disk, I've added an additional attribute to capture the VMDK SCSI adapter and target value (SCSI X:Y).
Take a look here for more details: getVMDiskInfo.pl
Here's an example:
script output:
[vi-admin@scofield ~] $ ./getVMDiskInfo.pl --server reflex.primp-industries.com --username primp
esxi4-1
Hard disk 1 = [himalaya-local-SATA.RE4-GP:Storage] esxi4-1/esxi4-1.vmdk
Hard disk 1 = isThinProvsioned
Hard disk 1 = persistent
Hard disk 1 = VirtualDiskFlatVer2BackingInfo
Hard disk 1 = SCSI(0:0)
Hard disk 2 = [himalaya-local-SATA.RE4-GP:Storage] esxi4-1/esxi4-1_1.vmdk
Hard disk 2 = isThinProvsioned
Hard disk 2 = persistent
Hard disk 2 = VirtualDiskFlatVer2BackingInfo
Hard disk 2 = SCSI(3:13)
Hard disk 3 = [himalaya-local-SATA.RE4-GP:Storage] esxi4-1/esxi4-1_2.vmdk
Hard disk 3 = isThinProvsioned
Hard disk 3 = persistent
Hard disk 3 = VirtualDiskFlatVer2BackingInfo
Hard disk 3 = SCSI(3:2)
Hard disk 4 = [himalaya-local-SATA.RE4-GP:Storage] esxi4-1/esxi4-1_3.vmdk
Hard disk 4 = isThinProvsioned
Hard disk 4 = persistent
Hard disk 4 = VirtualDiskFlatVer2BackingInfo
Hard disk 4 = SCSI(0:4)
Hard disk 5 = [himalaya-local-SATA.RE4-GP:Storage] esxi4-1/esxi4-1_4.vmdk
Hard disk 5 = isThinProvsioned
Hard disk 5 = persistent
Hard disk 5 = VirtualDiskFlatVer2BackingInfo
Hard disk 5 = SCSI(2:5)
[root@himalaya ~]# /usr/lib/vmware/bin/vscsiStats -l
.....
Virtual Machine worldGroupID: 40133, Virtual Machine Display Name: esxi4-1 {
Virtual SCSI Disk handleID: 8578
Virtual SCSI Disk handleID: 8579
Virtual SCSI Disk handleID: 8580
Virtual SCSI Disk handleID: 8581
Virtual SCSI Disk handleID: 8582
}
Can I rely on the fact the the vSCSI handleIDs only change at VM boot time. What about hot-swapping (e.g. are disks added to a VM while it's running visible/accessible to the VM before the next reboot)?
Just curious: is there any other place these vSCSI handleIDs (or the worldGroupIDs) are used?\
I will of course test all this in my lab...
</nk>
All virtual disks have vscsi handles (and therefore handle IDs).
If you suspend/resume, vmotion/svmotion or initiate any other such operations that require registration of virtual disks, of course, the IDs will change.
These IDs are really just opaque identifiers to uniquely identify virtual disks and you should not infer any semantics from them since the semantics are likely to change in the future.
Irfan
FWIW: I really think that the folks active on this thread should take a good look at http://communities.vmware.com/docs/DOC-10104. The paper referenced there and published at VPACT is a great resource for comparing your workloads' vscsi stats with those of 5 major benchmarks and also understanding the performance costs and benefits of consolidation.
Internally, we refer to that paper a lot when trying to understand new workloads we observe.
IMHO, that should really be required reading for vSphere storage admins.
Irfan
Yeah, thanks for the clarification. Would still be helpful if there were somewhere an explicit mapping between the vSCSI handleIDs and the VirtualDisk object accessible via mob/SOAP (I mean other then the ordering of the Ids which I'm using right now).
Anyway, thanks a lot for all the comments. Oh, and am I correct to assume that the unit for the ioLength histograms is bytes, and that the "mean" is calculated over the real length of the packets and not from the histogram?
</nk>
The two things you want connected don't exist in the same universe
Still, the larger point is that this analysis should be easier to do. Ideally this data should be available even through the vCenter API.
If you find this data useful (especially take a look at http://communities.vmware.com/docs/DOC-10104 for ideas on how far you can stretch this analysis), please consider filing a feature request for the plumbing of the stats.
Yes to bytes. Means are calculated online before data is inserted into the histogram. Off to vacation now. Look forward to your comments on the storage workload characterization paper referred to above.
Irfan
Just one last question- hopefully before you go in your (I'm sure well-deserved) vacation: how is the mean calculated? Is that the same as the average (i.e. sum of all packet sizes divided by number of packets?)
</nk>
Basically that. But of course the online version of that formula.
Irfan
Hi,
I heard rumors that the next version of ESX (ESX 4.1 ?) will have NFS stats available via SOAP. Any idea if is that correct?
Best,
Norbert
Is it just coincidence that I had to dodge this question on my blog just an hour ago? ![]()
I provided the best answer VMware can give in the comments section to the blog on vscsiStats for ESXi:
http://vpivot.com/2009/10/21/vscsistats-for-esxi/#comments
Scott
More information on my blog and on Twitter:
http://vpivot.com
http://twitter.com/drummonds
Hey, don't blame me for trying ![]()
Fair enough. Of course the next logical question is: what does it take to get a hand on a development (or beta) version?
Best,
Norbert
Also answered on vPivot:
http://vpivot.com/2009/10/21/vscsistats-for-esxi/#comments
The beta program is invite only. Please contact your account team for an invitation.
Scott
More information on my blog and on Twitter:
http://vpivot.com
http://twitter.com/drummonds
I've come up with a way to map the VMDKs to HandleIDs in a conclusive manner (takes time into account): http://communities.vmware.com/message/1460390#1460390
In case folks are interested in learning more about how this stuff works under the hood, take a look at my related blog posts and read the IISWC academic paper on the topic as well.
Finally, Scott is planning on covering vscsiStats usage in detail during his performance labs at VMworld 2009.
Irfan