sethu subbiah
2012-Feb-10 16:35 UTC
[libvirt-users] Unable to collect VM metrics for ESX using libvirt
Hi, I am trying to connect to a server running esx and collect system metrics like cpu usage, network and disk iops. I am able to establish the connection successfully and obtain VM information such as ids, domain names, config xml etc. But I am unable to collect statistics. I am using the python interface and if I do , conn=libvirt.openAuth(uri, auth, 0) dom-conn.lookupByID(id) // Where id is the domain id of the vms netstats=dom.interfaceStats(interface) gives an error libvirt.libvirtError: this function is not supported by the connection driver: virDomainInterfaceStats The same goes for block stats. For the cpu, I used, cpu=dom.info()[4] but, that always returns 0 (I thought it was cumulative and returns a huge value) I have used similar scripts with xen and kvm and it worked well. Can someone tell me what mistake I am doing or if the driver doesnt support these functions, is there any other way of getting the stats ?? Thank you. - Regards, Sethuraman Subbiah Graduate Student - NC state University M.S in Computer Science -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://listman.redhat.com/archives/libvirt-users/attachments/20120210/053e51f1/attachment.htm>
Eric Blake
2012-Feb-10 18:13 UTC
[libvirt-users] Unable to collect VM metrics for ESX using libvirt
On 02/10/2012 09:35 AM, sethu subbiah wrote:> gives an error libvirt.libvirtError: this function is not supported by the > connection driver: virDomainInterfaceStats >> I have used similar scripts with xen and kvm and it worked well. Can > someone tell me what mistake I am doing or if the driver doesnt support > these functions, is there any other way of getting the stats ?? Thank you.The error message is correct - no one has yet submitted patches for the ESX backend driver in libvirt to provide those statistics. Your code is correct, and will start working if anyone ever patches ESX to provide the information. -- Eric Blake eblake at redhat.com +1-919-301-3266 Libvirt virtualization library http://libvirt.org -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 620 bytes Desc: OpenPGP digital signature URL: <http://listman.redhat.com/archives/libvirt-users/attachments/20120210/b1a5c064/attachment.sig>