[Pkg-libvirt-maintainers] Bug#725261: libvirt-bin: Cgroup configuration for LXC and Qemu on the same host

Manuel VIVES manuel.vives at diateam.net
Thu Oct 3 12:45:17 UTC 2013


Package: libvirt-bin
Version: 1.1.2-3hns1
Severity: wishlist

Dear Maintainer,
I'm using libvirt for managing LXC containers and Qemu/KVM vms on the same host
and I was having trouble doing this, because of the common mountpoint of
my cgroups (they were all mounted in /sys/fs/cgroup), so I asked on
#virt and I've been told to use this kind of configuration for the cgroups:
"cgroup_root on /sys/fs/cgroup type tmpfs (rw,relatime)

cgroup_cpuset on /sys/fs/cgroup/cpuset type cgroup
(rw,nosuid,nodev,noexec,relatime,cpuset)

cgroup_cpu on /sys/fs/cgroup/cpu type cgroup
(rw,nosuid,nodev,noexec,relatime,cpu)

cgroup_cpuacct on /sys/fs/cgroup/cpuacct type cgroup
(rw,nosuid,nodev,noexec,relatime,cpuacct)

cgroup_memory on /sys/fs/cgroup/memory type cgroup
(rw,nosuid,nodev,noexec,relatime,memory)

cgroup_devices on /sys/fs/cgroup/devices type cgroup
(rw,nosuid,nodev,noexec,relatime,devices)

cgroup_freezer on /sys/fs/cgroup/freezer type cgroup
(rw,nosuid,nodev,noexec,relatime,freezer)

cgroup_net_cls on /sys/fs/cgroup/net_cls type cgroup
(rw,nosuid,nodev,noexec,relatime,net_cls)

cgroup_blkio on /sys/fs/cgroup/blkio type cgroup
(rw,nosuid,nodev,noexec,relatime,blkio)

cgroup_perf_event on /sys/fs/cgroup/perf_event type cgroup
(rw,nosuid,nodev,noexec,relatime,perf_event)"
It works well now, but I had to make a basic script (attached to this
bugreport) for mounting all of that at the start of my host.
I had a conversation with  Guido Günther and he told me to open this bug
report.

Here is the conversation:
"Hi,
On Wed, Oct 02, 2013 at 03:10:50PM +0200, Manuel VIVES wrote:
> Hello,
>
> I'm using libvirt for a profesionnal purpose on debian wheezy (libvirt
> version = 1.1.2-3) and I want to use LXC containers and Qemu-KVM VMs
> on the same host.
> I was having trouble doing this, because of the common mountpoint of
> my cgroups (they were all mounted in /sys/fs/cgroup), so I asked on
> #virt, here is the chat log:
> "
> <MVives> Hi
> <MVives> When trying to use LXC and qemu-kvm on the same
> host, I get the error message error : "virCgroupDetect:594 :
> Controller 'memory' is not wanted, but 'cpu' is co-mounted:"  when I
> want to start a qemu guest
> <danpb> MVives: sounds like you co-mounted cgroup controllers on the same
> mount point rather than mounting them separately
> <MVives> danpb: So I need to mount every cgroup separately?
> <danpb> the minimal requirement is to have the cpu related ones separate
> <MVives> ok, I'm gonna try this
> <MVives> thanks ;)
> <danpb> i'd recommend just following systemds example setup
> http://paste.fedoraproject.org/43653/13807064

This link one does not exist anymore.

> So I made a basic script for my own usage which mounts /sys/fs/cgroup
> as tmpfs, and create all the dirs inside and mount the cgroup
> separately.
>
> I would like to know if it's possible to provide a script like this in
> the libvirt package for debian (for example an init script).
> If necessary, I'm willing to provide the patch for this script.

So this sounds like systemd gets it correct by default and this would
only be an issue for non systemd systems? I'm all in favour for marking
this work out of the box but I wonder if moving this to cgroup-bin or
cgroup-tools would be a better fit since I expect more tools to expect a
systemd like cgroup layout.

Why not open a bug against libvirt-bin with severity wishlist with your
script attached so we can work on from there. As a first step we could
at least ship it as an example in /u/s/doc/libvirt-bin/examples and
adjust README.Debian accordingly.

(please paste this mail to the bugreport too, so we don't need to repeat
things)
Cheers,
 -- Guido

>
> Regards,
> Manuel VIVES
> "

So now we can consider adding an example to libvirt documentation or creating
an init script in the good package (either cgroup-bin/cgroup-tools or libvirt)

Regards,

Manuel VIVES



-- System Information:
Debian Release: 7.1
  APT prefers stable
  APT policy: (500, 'stable'), (1, 'experimental'), (1, 'unstable'), (1,
'testing'), (1, 'oldstable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.10-0.bpo.2-amd64 (SMP w/16 CPU cores)
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages libvirt-bin depends on:
ii  adduser              3.113+nmu3
ii  gettext-base         0.18.1.1-9
ii  init-system-helpers  1.4-hns1
ii  libaudit0            1:1.7.18-1.1
ii  libavahi-client3     0.6.31-2
ii  libavahi-common3     0.6.31-2
ii  libblkid1            2.20.1-5.3
ii  libc6                2.13-38
ii  libcap-ng0           0.6.6-2
ii  libdbus-1-3          1.6.8-1
ii  libdevmapper1.02.1   2:1.02.74-7
ii  libgcrypt11          1.5.0-5
ii  libgnutls26          2.12.20-7
ii  libnetcf1            1:0.2.3-3~bpo70+1
ii  libnl-3-200          3.2.7-4
ii  libnl-route-3-200    3.2.7-4
ii  libnuma1             2.0.8~rc4-1
ii  libparted0debian1    2.3-12
ii  libpcap0.8           1.3.0-1
ii  libpciaccess0        0.13.1-2
ii  libreadline6         6.2+dfsg-0.1
ii  libsasl2-2           2.1.25.dfsg1-6+deb7u1
ii  libudev0             175-7.2
ii  libvirt0             1.1.2-3hns1
ii  libxenstore3.0       4.1.4-3+deb7u1
ii  libxml2              2.8.0+dfsg1-7+nmu1
ii  libyajl2             2.0.4-2
ii  logrotate            3.8.1-4

Versions of packages libvirt-bin recommends:
ii  bridge-utils    1.5-6
ii  dmidecode       2.11-9
ii  dnsmasq-base    2.62-3+deb7u1
ii  ebtables        2.0.10.4-1
ii  gawk            1:4.0.1+dfsg-2.1
ii  iproute         20120521-3+b3
ii  iptables        1.4.14-3.1
ii  libxml2-utils   2.8.0+dfsg1-7+nmu1
ii  netcat-openbsd  1.105-7
ii  parted          2.3-12
ii  pm-utils        1.4.1-9
ii  qemu            1.1.2+dfsg-6a
ii  qemu-kvm        1.1.2+dfsg-6

Versions of packages libvirt-bin suggests:
pn  auditd       <none>
ii  policykit-1  0.105-3
ii  radvd        1:1.8.5-1
pn  systemtap    <none>

-- Configuration Files:
/etc/libvirt/libvirtd.conf changed [not included]
/etc/libvirt/lxc.conf changed [not included]
/etc/libvirt/qemu.conf [Errno 13] Permission non accordée:
u'/etc/libvirt/qemu.conf'
/etc/libvirt/qemu/networks/default.xml [Errno 13] Permission non accordée:
u'/etc/libvirt/qemu/networks/default.xml'
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mount.sh
Type: text/x-shellscript
Size: 1171 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/pkg-libvirt-maintainers/attachments/20131003/5ba1634e/attachment.bin>


More information about the Pkg-libvirt-maintainers mailing list