[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [libvirt-users] libvirt/qemu and cgroups



On Mon, Feb 10, 2014 at 12:29 AM, arnaud gaboury
<arnaud gaboury gmail com> wrote:
> Dear list,
>
> I am building a Arch server on my Arch box.
> My tools are QEMU/KVM and libvirt to manage the guest, systemd as
> system manager.
>
> I am looking at implementing the Linux Control Groups facilities for
> resource management. Even after long hours of reading, I am not quite
> sure about how to deal with the cgroups facilities.
>
> First, do I really need to care about all that, or libvirt and systemd
> will manage the resource in an efficient way right out of the box?
>
> If not, It's all about /etc/cgconfig.conf and cgrules.conf. I am
> honestly not sure :
>  -what are the correct mount points for cpu, memory etc in the
> /sys/fs/cgroup directory .
> - which directories am I supposed to mk, if any ?
>
> Then, Archwiki[1] says:
>
> # cgcreate -a $USER -g memory,cpu:groupname
>
>
> - what is the groupename I shall create (qemu*, MyMachine) ?
> - which $USER shall I use (qemu*, my username) ?
>
> * qemu:qemu as user:group in /etc/libvirt/qemu.conf
>
> Thank you for some help as I admit if I understand the cgroups
> principle and advantages, I am far from understanding how to create
> such a group in case of a VM.
>
> [1]https://wiki.archlinux.org/index.php/Cgroups

After more reading, especially the Fedora Resource Management
Guide[1], here is my /etc/cgconfig.conf:

group dahlia {

    perm {
# who can manage limits
        admin {
            uid = 1000;
            gid = 1004;
            }
# who can add task
        task {
            uid = 1000;
            gid = 1004;
            }
        }

# create this group in the controllers
    cpu { }
    cpuset { }
    memory { }
    devices { }
    freezer { }
    net_cls { }
    blkio { }
}

* NOTES : 1004 is qemu user ; dahlia is the name of the guest machine
; all dahlia controllers are created and mounted at boot in
/sys/fs/cgroup/$CONTROLLER-NAME/dahlia

$ systemctl status cgconfig.service
returns no errors, so these settings sound OK.

But now I am not sure how I can use these settings with libvirt. I
have problems understanding well The libvirt Control Groups Resource
Management page[2]

It is the first time I do such a setup (using cgroups & systemd) for a
VM, so thank you for help.


[1]http://docs.fedoraproject.org/en-US/Fedora/17/html-single/Resource_Management_Guide/index.html#sec-How_Control_Groups_Are_Organized
[2]http://libvirt.org/cgroups.html#legacyLayout


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]