What steps can I take to investigate a KVM guest that freezes about once every two weeks? By "freezes", I mean there is no response when I try to connect with "ssh" or "virsh console". The host is Ubuntu (natty, 11.04), using libvirt to manage its guests, and the guest is Ubuntu (natty, 11.04), both server editions with no window manager installed.

If I force the guest to reset, it works fine for another week. There are no recent or relevant message in the guest syslog (to indicate a kernel panic, etc). For all I know, it could be that the virtual network and tty are breaking and stopping me from talking to the guest. The host runs three other, nearly identical, guests that have been stable all year. If the guest itself is crashing, shouldn't there be some indication in syslog?

The disk is an lvm logical volume configured with virtio

% cat /etc/libvirt/qemu/vm-et.xml

    <domain type='kvm'>
        <type arch='x86_64' machine='pc-0.12'>hvm</type>
        <boot dev='hd'/>
      <clock offset='utc'/>
        <!--<disk type='file' device='disk'>
          <driver name='qemu' type='qcow2'/>
          <source file='/usr/scratch/appliances/vm-et/ubuntu-kvm/tmpzwV0x3.qcow2'/>
          <target dev='hda' bus='ide'/>
          <address type='drive' controller='0' bus='0' unit='0'/>
        <controller type='ide' index='0'>
          <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
        <interface type='bridge'>
          <mac address='52:54:00:5a:1f:b4'/>
          <source bridge='br0'/>
          <model type='virtio'/>
          <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
        <input type='mouse' bus='ps2'/>
        <graphics type='vnc' port='-1' autoport='yes' listen=''/>
          <model type='cirrus' vram='9216' heads='1'/>
          <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
        <memballoon model='virtio'>
          <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
        <disk type='file' device='disk'>
          <source file='/dev/vg1/lv-et'/>
          <target dev='vda' bus='virtio'/>

        <serial type="pty">
          <source path="/dev/pts/3"/>
          <target port="1"/>

  • This is the qemu config
    – echo85
    Nov 30 '11 at 19:53
  • have you tried connecting with vnc? My experience is that even on crashed kernels you can read the last system messages (that did not make it into syslog).
    – Jasper
    Nov 30 '11 at 20:28
  • Are you attempting to connect via direct IP address, or by a hostname that depends on DNS? I've often run into connectivity problems in environments where DNS wasn't quite up to snuff, and a failed hostname lookup sent me on a wild goose chase. Is the KVM pingable when it becomes otherwise non-responsive? How was the KVM's IP address allocated? Was it properly assigned by DHCP, or was it hardcoded? Perhaps there is an IP address conflict on the network, and some other computer or device is now answering to the IP address that the KVM thinks it owns. Dec 6 '11 at 22:49
  • I've been having a similar problem recently with a Ubuntu 11.04 KVM guest (64bit) on a CentOS 5.6 KVM host (64bit). It is the only 11.04 guest I have and has been sporadically getting shutdown. In auditing its setup with my other guests I noticed it had a virtual CDROM associated. I removed that bit of hardware using virt-manager and restarted, it's been up since then. Something to try if you're desperate.
    – slm
    Dec 11 '11 at 6:43
  • In my case the guest freezes were caused by the underlying storage on the host getting full ...
    – Zrin
    Sep 23 '15 at 21:47

Investigating there kinds of problems is really difficult because you'd need to isolate different features of the setup and test them - which is very difficult on such a commplex setup and as the repro is a two weeks long process.

The first thing is try to do is to configure the syslog to send the logs over the network to a remote syslog service (possibly the one running on the host - you'd need to enable remote forwarding access on the syslog server) to allow you to catch errors that didn't make it into the guest log due to storage free space or sync issues.

If that doesn't give any useful info, you can try hooking into the guest serial console (see here for details) and log anything that happens there to a log file on the host.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.