Hi,
 
We have tried with latest libvirt i.e, libvirt-1.0.5 also.
Still i am facing the same error in executing the "cpu-stats" command :
 
virsh # cpu-stats test
error: Failed to retrieve CPU statistics for domain 'test'
error: Requested operation is not valid: cgroup CPUACCT controller is not mounted
 
It would be very helpful for us if you could suggest something to make cpuacct controller mounted.
 
Regards,
Anusha
 
On Fri, May 31, 2013 at 1:18 PM, Anusha Rayani <anusha.rayani@gmail.com> wrote:
 
Hi,
we are using currently libvirt-0.10.2.
And yes in our platform cpu contorller(cpuacct) is not mounted.
 
Could you please let us know how we can mount more controllers through libvirt.
 
It would be helpful for us.
 
Regards,
Anusha
On Fri, May 31, 2013 at 3:27 AM, Eric Blake <eblake@redhat.com> wrote:
On 05/30/2013 01:37 AM, Anusha Rayani wrote:
> Hi,
>
> We are implementing feature called CPU separation in the platform. So,
> guest VMs will have dedicated cores allocated using cgroups (cgroups
> hierachy related VMs managed by libvirt).
>
>  virsh cpu-stats command is not working in our platform :
>
> virsh # cpu-stats test_vm
> error: Failed to virDomainGetCPUStats()
>
> error: Requested operation is not valid: cgroup CPUACCT controller is not
> mounted

Which version of libvirt?  Libvirt 1.0.5 included several improvements
to cgroup; perhaps some of those are relevant?  Libvirt is supposed to
find cgroup controllers, regardless of how you spell their mount point
(it inspects procfs to learn the cgroups of the current process, rather
than hard-coding any particular path).  Are you sure you had cpuacct
mounted?

> # cat /proc/cgroups
> #subsys_name    hierarchy       num_cgroups     enabled
> cpuset  0       1       1
> ns      0       1       1
> cpu     1       3       1
> cpuacct 0       1       1
> memory  2       1       1
> freezer 0       1       1
> net_cls 0       1       1
> blkio   0       1       1
>
> # cat /proc/mounts
> cpu /dev/cgroup_cpu cgroup rw,relatime,cpu 0 0
> memory /dev/cgroup_mem cgroup rw,relatime,memory 0 0

That makes it sound like you haven't mounted quite enough cgroup
controllers.

--
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org