Florian Klink
2013-Sep-30 14:42 UTC
[libvirt-users] Unable to start libvirt_lxc domain a second time after shutdown
Hi, I'm unable to start a lxc domain again after shutting it down. Something doesn't seem to "clean up" the socket file (and probably more), as the error message says "Unable to start Domain: Failed to connect socket to '/var/run/libvirt/lxc/test.sock': Connection refused." I can create a domain with the same config as the one thats shutted down, but with other uid and name, of course, and I'm able to boot up this domain. However, the init process is much shorter (some filesystems are not mounted), so maybe there is still something left "open" after the lxc container is shut down? I saw the problem in libvirt 1.1.2 and current git (1.1.3-rc2 plus 7 commits, on 51e21ba7b6f59d6ad9339b2da2b75cc7704f9ecf) Configuration is something like this: <domain type='lxc'> <name>test</name> <memory unit='KiB'>1048576</memory> <currentMemory unit='KiB'>1048576</currentMemory> <vcpu placement='static'>1</vcpu> <resource> <partition>/machine</partition> </resource> <os> <type arch='x86_64'>exe</type> <init>/sbin/init</init> </os> <clock offset='utc'/> <on_poweroff>destroy</on_poweroff> <on_reboot>restart</on_reboot> <on_crash>restart</on_crash> <devices> <emulator>/usr/lib/libvirt/libvirt_lxc</emulator> <filesystem type='mount' accessmode='passthrough'> <source dir='/var/lib/libvirt/filesystems/test/root'/> <target dir='/'/> </filesystem> <interface type='network'> </interface> <console type='pty'> <target type='lxc' port='0'/> </console> </devices> <seclabel type='none'/> </domain> Florian
Daniel P. Berrange
2013-Sep-30 14:44 UTC
Re: [libvirt-users] Unable to start libvirt_lxc domain a second time after shutdown
On Mon, Sep 30, 2013 at 04:42:18PM +0200, Florian Klink wrote:> Hi, > > I'm unable to start a lxc domain again after shutting it down. > > Something doesn't seem to "clean up" the socket file (and probably > more), as the error message says > > "Unable to start Domain: Failed to connect socket to > '/var/run/libvirt/lxc/test.sock': Connection refused." > > I can create a domain with the same config as the one thats shutted > down, but with other uid and name, of course, and I'm able to boot up > this domain. > > However, the init process is much shorter (some filesystems are not > mounted), so maybe there is still something left "open" after the lxc > container is shut down? > > I saw the problem in libvirt 1.1.2 and current git (1.1.3-rc2 plus 7 > commits, on 51e21ba7b6f59d6ad9339b2da2b75cc7704f9ecf)I'm assuming you are running on a distro with systemd ? If so, can you try out this patch https://www.redhat.com/archives/libvir-list/2013-September/msg01671.html It tries to workaround a flaw in either systemd or kernel (we're not sure which is broken) that causes cgroups to not be cleaned up Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|
Florian Klink
2013-Sep-30 15:14 UTC
Re: [libvirt-users] Unable to start libvirt_lxc domain a second time after shutdown
Am 30.09.2013 16:44, schrieb Daniel P. Berrange:> On Mon, Sep 30, 2013 at 04:42:18PM +0200, Florian Klink wrote: >> Hi, >> >> I'm unable to start a lxc domain again after shutting it down. >> >> Something doesn't seem to "clean up" the socket file (and probably >> more), as the error message says >> >> "Unable to start Domain: Failed to connect socket to >> '/var/run/libvirt/lxc/test.sock': Connection refused." >> >> I can create a domain with the same config as the one thats shutted >> down, but with other uid and name, of course, and I'm able to boot up >> this domain. >> >> However, the init process is much shorter (some filesystems are not >> mounted), so maybe there is still something left "open" after the lxc >> container is shut down? >> >> I saw the problem in libvirt 1.1.2 and current git (1.1.3-rc2 plus 7 >> commits, on 51e21ba7b6f59d6ad9339b2da2b75cc7704f9ecf) > I'm assuming you are running on a distro with systemd ? > > If so, can you try out this patch > > https://www.redhat.com/archives/libvir-list/2013-September/msg01671.html > > It tries to workaround a flaw in either systemd or kernel (we're not > sure which is broken) that causes cgroups to not be cleaned up > > DanielBingo! This one worked around the issue, thanks! Are you considering to add something like this workaround to the libvirt-1.1.3 release? I'm pretty sure I'm not the only one affected by this... ;-) Florian
Apparently Analagous Threads
- Unable to start libvirt_lxc domain a second time after shutdown
- Re: How to monitor a lxc container started by libvirt_lxc from inside ?
- Re: libvirt_lxc: SELinux MCS
- Re: libvirt_lxc namespace and umount in global namespace
- 答复: libvirt_lxc start problem when selinux enbale