[Pkg-libvirt-maintainers] Bug#761521: libvirt-daemon: fails to restart domain with error 'CreateMachine: File exists'

Paul Millar paul.millar at desy.de
Sun Sep 14 15:56:35 UTC 2014


Package: libvirt-daemon
Version: 1.2.8-1
Severity: normal

Dear Maintainer,

After booting my laptop (vedrfolnir) I am able to start a domain (xanadu) using
the GUI client (virt-manager).  Logging in to the domain as root and using the
'shutdown -h now' command, the domain halts (apparently normally).  That the
domain is halted is confirmed by ssh no longer working, no response using the
ping command, and virt-manager showing the domain as stopped.

Subsequent attempts to start the domain fail.  The virt-manager GUI reports the
following stack-trace:


Error starting domain: error from service: CreateMachine: File exists

Traceback (most recent call last):
  File "/usr/share/virt-manager/virtManager/asyncjob.py", line 96, in cb_wrapper
    callback(asyncjob, *args, **kwargs)
  File "/usr/share/virt-manager/virtManager/asyncjob.py", line 117, in tmpcb
    callback(*args, **kwargs)
  File "/usr/share/virt-manager/virtManager/domain.py", line 1160, in startup
    self._backend.create()
  File "/usr/lib/python2.7/dist-packages/libvirt.py", line 917, in create
    if ret == -1: raise libvirtError ('virDomainCreate() failed', dom=self)
libvirtError: error from service: CreateMachine: File exists


Attempts to start the machine using virsh fail in a similar manner.


virsh # connect qemu:///system

virsh # start xanadu
error: Failed to start domain xanadu
error: error from service: CreateMachine: File exists

virsh # 


Restarting the laptop (vedrfolnir) allows the domain (xanadu) to start but
after being shutdown, once again the domain cannot be started.

The log file for the virtual machine (/var/log/libvirt/qemu/xanadu.log) shows
the domain starting up but almost immediately (11 ms) failing, unfortunately
without logging any error.

2014-09-14 15:38:50.394+0000: starting up
LC_ALL=C PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin QEMU_AUDIO_DRV=pa /usr/bin/kvm -name xanadu -S -machine pc-0.14,accel=kvm,usb=off -m 1024 -realtime mlock=off -smp 1,sockets=1,cores=1,threads=1 -uuid 91cef140-bea4-41ea-4c9a-856c52e7779f -no-user-config -nodefaults -chardev socket,id=charmonitor,path=/var/lib/libvirt/qemu/xanadu.monitor,server,nowait -mon chardev=charmonitor,id=monitor,mode=control -rtc base=utc -no-shutdown -boot menu=off,strict=on -device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 -drive file=/var/lib/libvirt/images/xanadu.img,if=none,id=drive-virtio-disk0,format=raw,serial=1 -device virtio-blk-pci,scsi=off,bus=pci.0,addr=0x5,drive=drive-virtio-disk0,id=virtio-disk0,bootindex=1 -drive file=/home/libvirt/ISO-images/gparted-live-0.14.1-1.iso,if=none,id=drive-ide0-1-0,readonly=on,format=raw -device ide-cd,bus=ide.1,unit=0,drive=drive-ide0-1-0,id=ide0-1-0,bootindex=2 -netdev tap,fd=25,id=hostnet0,vhost=on,vhostfd=27 -device virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:4e:4c:a2,bus=pci.0,addr=0x3 -chardev pty,id=charserial0 -device isa-serial,chardev=charserial0,id=serial0 -device usb-tablet,id=input0 -vnc 127.0.0.1:0 -device cirrus-vga,id=video0,bus=pci.0,addr=0x2 -device AC97,id=sound0,bus=pci.0,addr=0x4 -device usb-host,hostbus=2,hostaddr=2,id=hostdev0 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x6 -msg timestamp=on
2014-09-14 15:38:50.405+0000: shutting down


To me, this looks like a problem where starting a domain consumes or allocates
some resource that is not freed when that domain shuts down.  I'm not sure
if this is libvirt's responsibility or qemu/kvm.

In case it helps, here is the domain's XML configuration:

<domain type='kvm'>
  <name>xanadu</name>
  <uuid>91cef140-bea4-41ea-4c9a-856c52e7779f</uuid>
  <memory unit='KiB'>1048576</memory>
  <currentMemory unit='KiB'>1048576</currentMemory>
  <vcpu placement='static'>1</vcpu>
  <os>
    <type arch='x86_64' machine='pc-0.14'>hvm</type>
    <bootmenu enable='no'/>
  </os>
  <features>
    <acpi/>
    <apic/>
    <pae/>
  </features>
  <clock offset='utc'/>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>restart</on_crash>
  <devices>
    <emulator>/usr/bin/kvm</emulator>
    <disk type='file' device='disk'>
      <driver name='qemu' type='raw'/>
      <source file='/var/lib/libvirt/images/xanadu.img'/>
      <target dev='vda' bus='virtio'/>
      <serial>1</serial>
      <boot order='1'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
    </disk>
    <disk type='file' device='cdrom'>
      <driver name='qemu' type='raw'/>
      <source file='/home/libvirt/ISO-images/gparted-live-0.14.1-1.iso'/>
      <target dev='hdc' bus='ide'/>
      <readonly/>
      <boot order='2'/>
      <address type='drive' controller='0' bus='1' target='0' unit='0'/>
    </disk>
    <controller type='usb' index='0'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
    </controller>
    <controller type='ide' index='0'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
    </controller>
    <controller type='pci' index='0' model='pci-root'/>
    <interface type='network'>
      <mac address='52:54:00:4e:4c:a2'/>
      <source network='default'/>
      <model type='virtio'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </interface>
    <serial type='pty'>
      <target port='0'/>
    </serial>
    <console type='pty'>
      <target type='serial' port='0'/>
    </console>
    <input type='tablet' bus='usb'/>
    <input type='mouse' bus='ps2'/>
    <input type='keyboard' bus='ps2'/>
    <graphics type='vnc' port='-1' autoport='yes'/>
    <sound model='ac97'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
    </sound>
    <video>
      <model type='cirrus' vram='9216' heads='1'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
    </video>
    <memballoon model='virtio'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
    </memballoon>
  </devices>
</domain>


The qemu.conf configuration file has the following non-empty/non-comment lines:


vedrfolnir:~# egrep -v '^#|^$' /etc/libvirt/qemu.conf
vnc_allow_host_audio = 1
user = "paul"
vedrfolnir:~# 


The laptop is using systemd.  Here is the information about the
libvirtd.service:


vedrfolnir:~# systemctl status libvirtd.service
libvirtd.service - Virtualization daemon
   Loaded: loaded (/lib/systemd/system/libvirtd.service; enabled)
   Active: active (running) since Sun 2014-09-14 16:41:13 CEST; 1h 7min ago
     Docs: man:libvirtd(8)
           http://libvirt.org
 Main PID: 838 (libvirtd)
   CGroup: /system.slice/libvirtd.service
           ├─ 838 /usr/sbin/libvirtd
           ├─1380 /usr/sbin/dnsmasq --conf-file=/var/lib/libvirt/dnsmasq/default.conf --dhcp-script=/usr/lib/libvirt/libvirt_leaseshelper
           └─1381 /usr/sbin/dnsmasq --conf-file=/var/lib/libvirt/dnsmasq/default.conf --dhcp-script=/usr/lib/libvirt/libvirt_leaseshelper

Sep 14 16:43:25 vedrfolnir libvirtd[838]: Unable to remove /sys/fs/cgroup/devices/machine.slice/machine-qemu\x2dxanadu.scope/ (16)
Sep 14 16:43:25 vedrfolnir libvirtd[838]: Unable to remove /sys/fs/cgroup/freezer/machine.slice/machine-qemu\x2dxanadu.scope/ (16)
Sep 14 16:43:25 vedrfolnir libvirtd[838]: Unable to remove /sys/fs/cgroup/blkio/machine.slice/machine-qemu\x2dxanadu.scope/ (16)
Sep 14 16:43:25 vedrfolnir libvirtd[838]: Unable to remove /sys/fs/cgroup/net_cls/machine.slice/machine-qemu\x2dxanadu.scope/ (16)
Sep 14 16:43:25 vedrfolnir libvirtd[838]: Unable to remove /sys/fs/cgroup/perf_event/machine.slice/machine-qemu\x2dxanadu.scope/ (16)
Sep 14 16:43:25 vedrfolnir libvirtd[838]: Failed to remove cgroup for xanadu
Sep 14 16:43:32 vedrfolnir libvirtd[838]: error from service: CreateMachine: File exists
Sep 14 17:33:12 vedrfolnir libvirtd[838]: error from service: CreateMachine: File exists
Sep 14 17:38:50 vedrfolnir libvirtd[838]: error from service: CreateMachine: File exists
Sep 14 17:43:54 vedrfolnir libvirtd[838]: error from service: CreateMachine: File exists


I upgraded to the version of libvirt from experimental, but the problem persisted.

I'm not sure what else I can do to help figure out what is going wrong, but please let me know
if some other piece of information would be helpful.

Cheers,

Paul.

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

Kernel: Linux 3.10-3-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages libvirt-daemon depends on:
ii  libapparmor1        2.8.0-6
ii  libaudit1           1:2.4-1
ii  libavahi-client3    0.6.31-4
ii  libavahi-common3    0.6.31-4
ii  libblkid1           2.20.1-5.8
ii  libc6               2.19-11
ii  libcap-ng0          0.7.4-2
ii  libdbus-1-3         1.8.6-2
ii  libdevmapper1.02.1  2:1.02.90-1
ii  libfuse2            2.9.3-15
ii  libgnutls-deb0-28   3.3.7-2
ii  libnetcf1           1:0.2.3-4.1
ii  libnl-3-200         3.2.24-2
ii  libnl-route-3-200   3.2.24-2
ii  libnuma1            2.0.10~rc2-1
ii  libparted2          3.2-5
ii  libpcap0.8          1.6.2-1
ii  libpciaccess0       0.13.2-3
ii  librados2           0.80.5-1
ii  librbd1             0.80.5-1
ii  libsasl2-2          2.1.26.dfsg1-11
ii  libselinux1         2.3-2
ii  libssh2-1           1.4.3-4
ii  libsystemd-daemon0  208-8
ii  libudev1            208-8
ii  libvirt0            1.2.8-1
ii  libxen-4.4          4.4.0-5
ii  libxenstore3.0      4.4.0-5
ii  libxml2             2.9.1+dfsg1-4
ii  libyajl2            2.1.0-2

Versions of packages libvirt-daemon recommends:
ii  libxml2-utils   2.9.1+dfsg1-4
ii  netcat-openbsd  1.105-7
ii  qemu            2.1+dfsg-4

libvirt-daemon suggests no packages.

-- no debconf information



More information about the Pkg-libvirt-maintainers mailing list