[libvirt] Loosing lxc guests when restarting libvirt

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

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'>
  <memory unit='KiB'>256000</memory>
  <currentMemory unit='KiB'>256000</currentMemory>
  <vcpu placement='static'>1</vcpu>
  <clock offset='utc'/>
    <filesystem type='mount' accessmode='passthrough'>
      <source dir='/'/>
      <target dir='/'/>
    <console type='pty'>
      <target type='lxc' port='0'/>
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

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