[libvirt] Loosing lxc guests when restarting libvirt

Christian Ehrhardt christian.ehrhardt at canonical.com
Tue Dec 20 11:29:45 UTC 2016


Hi,
I found an issue in libvirt related to libvirt-lxc, but fail to find the
root cause.

The TL;DR is: libvirt-lxc guests get killed on libvirt restart due to
"internal error: No valid cgroup for machine"

It was able to reproduce libvirt 1.3.1, 2.4 and 2.5 as packages in Ubuntu
and Debian.
I wanted to ask for two things:
- wider coverage where this does reproduce
- your expertise on the case itself.

Steps to reproduce:
1. Spawn new KVM Guest of your choice
2. install test dependencies
$ apt-get install libvirt-daemon-system libvirt-clients libxml2-utils
# or package managers / package names of your chosen os
3. run the following sequence as root
export LIBVIRT_DEFAULT_URI=lxc:///
cat << EOF > /tmp/smoke-lxc.xml
<domain type='lxc'>
  <name>sl</name>
  <memory unit='KiB'>256000</memory>
  <currentMemory unit='KiB'>256000</currentMemory>
  <vcpu placement='static'>1</vcpu>
  <os>
    <type>exe</type>
    <init>/bin/bash</init>
  </os>
  <features>
    <privnet/>
  </features>
  <clock offset='utc'/>
  <devices>
    <emulator>/usr/lib/libvirt/libvirt_lxc</emulator>
    <filesystem type='mount' accessmode='passthrough'>
      <source dir='/'/>
      <target dir='/'/>
    </filesystem>
    <console type='pty'>
      <target type='lxc' port='0'/>
    </console>
  </devices>
</domain>
EOF
virsh define /tmp/smoke-lxc.xml
virsh start sl
virsh list --all
# is running now
/etc/init.d/libvirtd restart
virsh list --all
# is no more running, but it should

Way more background and detail can be found at
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=848317


-- 
Christian Ehrhardt
Software Engineer, Ubuntu Server
Canonical Ltd
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20161220/5066cfc6/attachment-0001.htm>


More information about the libvir-list mailing list