[libvirt-users] getCPUStats of a domain by a non-root user - libvirtError: Requested operation is not valid: cgroup CPUACCT controller is not mounted

Anton Beloglazov anton.beloglazov at gmail.com
Tue Aug 21 07:33:42 UTC 2012


Hi All,

Unfortunately, I couldn't manage to solve my problem.  I've tried various
way to configure Cgroups  to enable VM monitoring by a non-root user with
no luck. My current /etc/cgconfig.conf is the following:

group sysdefault {
       perm {
               task {
                       uid = anton;
                       gid = root;
               }
               admin {
                       uid = anton;
                       gid = root;
               }
       }
}

mount {
       cpuacct = /mnt/cgroups/cpuacct;
}

Where "anton" is a non-root user. However, this doesn't work. Here is a
simple test:

$ virsh start cirros
$ virsh cpu-stats cirros
error: Failed to virDomainGetCPUStats()
error: Requested operation is not valid: cgroup CPUACCT controller is not
mounted

Where cirros is a VM image. Everything is fine for the root user:

$ sudo virsh start cirros
$ sudo virsh cpu-stats cirros
CPU0:
cpu_time             0.025812184 seconds
 vcpu_time            0.025812184 seconds
CPU1:
cpu_time             4.893484927 seconds
 vcpu_time            4.893484927 seconds
Total:
cpu_time             4.924620941 seconds
 user_time            1.060000000 seconds
system_time          3.050000000 seconds

I would be very grateful to get any suggestions from anyone.

Thanks,
Anton


On Sat, Aug 18, 2012 at 4:07 PM, Anton Beloglazov <
anton.beloglazov at gmail.com> wrote:

> Hi Olivier,
>
> Thanks for the links. I see now that there is an option to assign
> permissions to access control groups for non-root users. I'll try to
> configure it and post back the results.
>
> Best regards,
> Anton
>
>
> On Fri, Aug 17, 2012 at 11:31 PM, Anton Beloglazov <
> anton.beloglazov at gmail.com> wrote:
>
>> Hi Olivier,
>>
>> Thanks for the suggestion, but Cgroups is installed and started. As I
>> mentioned, everything works for the root user. Should I do some special
>> configuration for a non-root user? Currently, my /etc/cgconfig.conf
>> contains the following:
>>
>> mount {
>> cpuacct = /mnt/cgroups/cpuacct;
>> }
>>
>> Thanks,
>> Anton
>>
>> On Fri, Aug 17, 2012 at 11:24 PM, Olivier Doucet <webmaster at ajeux.com>wrote:
>>
>>> Hi,
>>>
>>> > libvir: QEMU Driver error : Requested operation is not valid: cgroup
>>> CPUACCT
>>> > controller is not mounted
>>>
>>> You need to install/configure Cgroups on your system :
>>> http://en.wikipedia.org/wiki/Cgroups
>>>
>>> https://access.redhat.com/knowledge/docs/en-US/Red_Hat_Enterprise_Linux/6/html/Resource_Management_Guide/ch01.html
>>>
>>> Olivier
>>>
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/libvirt-users/attachments/20120821/74c3de4c/attachment.htm>


More information about the libvirt-users mailing list