Hi, I am facing issue with the calls getCPUStats and getMemoryStats. Please find the error below. AttributeError: 'module' object has no attribute 'VIR_NODE_CPU_STATS_ALL_CPUS'>>> print con.getCPUStats(2, None, 0, 0)Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/lib64/python2.6/site-packages/libvirt.py", line 2173, in getCPUStats ret = libvirtmod.virNodeGetCPUStats(self._o, cpuNum, params, nparams, flags) *AttributeError: 'module' object has no attribute 'virNodeGetCPUStats'*>>> print con.getMemoryStats(2, None, 0, 0)Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/lib64/python2.6/site-packages/libvirt.py", line 2245, in getMemoryStats ret = libvirtmod.virNodeGetMemoryStats(self._o, cellNum, params, nparams, flags) *AttributeError: 'module' object has no attribute 'virNodeGetMemoryStats'* Kind let me know if this is a known issue. I came to know that this issue was fixed in 0.9.8 version of libvirt. I am executing these calls on libvirt-0.9.8 compiled (--with-netcf) on centos 6.2. Please let me know if any other option needs to be specified while compiling libvirt in order to get this working. -- Regards Ananth -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://listman.redhat.com/archives/libvirt-users/attachments/20120710/aacc1140/attachment.htm>
Osier Yang
2012-Jul-10 08:08 UTC
[libvirt-users] Issue with getCPUStats and getMemoryStats
On 2012?07?10? 15:07, Ananth wrote:> Hi, > > I am facing issue with the calls getCPUStats and getMemoryStats. Please > find the error below. > > AttributeError: 'module' object has no attribute > 'VIR_NODE_CPU_STATS_ALL_CPUS' > >>> print con.getCPUStats(2, None, 0, 0) > Traceback (most recent call last): > File "<stdin>", line 1, in <module> > File "/usr/lib64/python2.6/site-packages/libvirt.py", line 2173, in > getCPUStats > ret = libvirtmod.virNodeGetCPUStats(self._o, cpuNum, params, > nparams, flags) > *AttributeError: 'module' object has no attribute 'virNodeGetCPUStats'* > > >>> print con.getMemoryStats(2, None, 0, 0) > Traceback (most recent call last): > File "<stdin>", line 1, in <module> > File "/usr/lib64/python2.6/site-packages/libvirt.py", line 2245, in > getMemoryStats > ret = libvirtmod.virNodeGetMemoryStats(self._o, cellNum, params, > nparams, flags) > *AttributeError: 'module' object has no attribute 'virNodeGetMemoryStats'* > > > Kind let me know if this is a known issue. I came to know that this > issue was fixed in 0.9.8 version of libvirt. I am executing these calls > on libvirt-0.9.8 compiled (--with-netcf) on centos 6.2. > Please let me know if any other option needs to be specified while > compiling libvirt in order to get this working. >Well, from your previous mail, you compiled libvirt with "--prefix=/opt/libvirt", so apprently you don't use the right module: > Traceback (most recent call last): > File "<stdin>", line 1, in <module> > File "/usr/lib64/python2.6/site-packages/libvirt.py", line 2173, in > getCPUStats It's the same reason for you can't see any VMs listed with "virsh list --all", your libvirtd looks up the domains config from /opt/libvirt/etc/libvirt, and there is no vm configs there. I don't known why you want to install to /opt/prefix, but to make things easy enough, why not: ./autogen.sh --system && make install Regards, Osier
Seemingly Similar Threads
- getCPUStats of a domain by a non-root user - libvirtError: Requested operation is not valid: cgroup CPUACCT controller is not mounted
- nparams in virNodeGetCPUStats and CPU utilization
- Host information from libvirt KVM/Xen
- How to use blockcopy in libvirt-java
- Statistics domain memory block when domain shutdown