[libvirt-users] Permission issue with cgroups

Antonio Carlos Salzvedel Furtado Junior acsfj08 at inf.ufpr.br
Fri May 11 22:17:57 UTC 2012


Ops, missed this one. It works like a charm.
Now I feel like I'm trying to reinvent the wheel. It's a lot simpler
working directly with libvirt.

Thanks a lot for you help.

On Fri, May 11, 2012 at 7:04 PM, Eric Blake <eblake at redhat.com> wrote:

> On 05/11/2012 03:51 PM, Antonio Carlos Salzvedel Furtado Junior wrote:
> > Thanks for the prompt response, it cleared a lot of my doubts
> >
> > Actually, I could enable the other controllers. It's just that I have a
> > strong reason to use the cpu controller.
> > I need to set a hard limit for CPU consumption. Maybe 'cpu.shares' was a
> > bad example.
> > I'm working especially with two parameters, "cpu.cfs_period_us" and
> > "cpu.cfs_quota_us". For instance, sometimes I need to limit my VM to 20%
> of
> > the CPU share, regardless of the CPU load. Then I set
> > "cpu.cfs_period_us=100000" and "cpu.cfs_quota_us=20000".
> > I'm using the libcgroup API to do that, but I agree that it would be
> better
> > to use the libvirt API.
> >
> > Looking at the documentation, The parameters I'd need to change would be
> > the following:
> >
> > <domain>
> >   ...
> >   <cputune>
> >     <period>100000</period>
> >     <quota>20000</quota>
> >   </cputune>
> >   ...
> > </domain>
> >
> > Unfortunately, I think virsh does not have tools to change these
> > parameters, as libcgroup does ( cgget and cgset ). However I guess it
> won't
> > be a problem, I'll try to use the libvirt API.
>
> virsh exposes the libvirt API; if you can't get it working in virsh,
> that's a bug that we should fix.  That said:
>
> virsh schedinfo $dom --set vcpu_period=100000 --set vcpu_quota=20000
>
> should do exactly what you're asking for.
>
> --
> Eric Blake   eblake at redhat.com    +1-919-301-3266
> Libvirt virtualization library http://libvirt.org
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/libvirt-users/attachments/20120511/1eea1702/attachment.htm>


More information about the libvirt-users mailing list