Configuring a virtual server for automated dumps on the host

You can configure an automated dump for a virtual server if a kernel panic occurs on the guest.

Before you begin

If kdump is set up for the KVM guest that runs on the virtual server, kdump takes priority and a dump is created on the KVM host only if kdump fails. Use the following procedure as an alternative or as a backup for kdump.

Procedure

  1. Ensure that the domain configuration-XML of the virtual server includes the on_crash element.
    If needed, add the element as a child element of the domain element.
  2. Specify coredump-destroy or coredump-restart as the text content of the on_crash element.
    coredump-destroy
    To stop the virtual server and release all resources when the dump process is completed.
    coredump-restart
    To restart the virtual server when the dump process is completed. This setting can be useful to automatically restore operations, but incurs the danger of restart and crash cycles with dumps accumulating on the KVM host.

Results

When a kernel panic occurs on the guest, a core dump is written to /var/lib/libvirt/qemu/dump on the KVM host. Depending on your specification for the on_crash element, the virtual server is restarted or all resources of the virtual server are released.

Example

<domain type="kvm">
    ...
    <on_crash>coredump-destroy</on_crash>
    ...
</domain>