22 Creating crash dumps of a VM Guest #
22.1 Introduction #
Whenever a VM crashes, it is useful to collect a core dump of the VM memory for debugging and analysis. For physical machines, Kexec and Kdump takes care of collecting crash dumps. For virtual machines, it depends whether the guest is fully virtualized (FV) or paravirtualized (PV).
22.2 Creating crash dumps for fully virtualized machines #
To view crash dumps for FV machines, use the same procedures as for physical machines—Kexec and Kdump.
22.3 Creating crash dumps for paravirtualized machines #
Unlike with FVs, Kexec/Kdump does not work in paravirtualized machines.
Crash dumps of PV guests must be performed by the host tool stack. If using
the xl tool stack for Xen domUs, the xl
dump-core command will produce the dump. For libvirt-based
VM Guests, the virsh dump command provides the same
functionality.
You can configure automatic collection of a core dump with the
on_crash setting in the configuration of the VM Guest.
This setting tells the host tool stack what to do if the VM Guest
encounters a crash. The default in both xl and libvirt
is destroy. Useful options for automatically collecting a
core dump are coredump-destroy and
coredump-restart.
22.4 Additional information #
The difference between fully virtualized and paravirtualized virtual machines is described in Section 1.3, “Virtualization modes”.
Detailed information about Kexec/Kdump mechanism is included in Book “System Analysis and Tuning Guide”, Chapter 20 “Kexec and Kdump”.
Refer to the xl.cfg manual page (
man 5 xl.cfg) for more information on thexlconfiguration syntax.Refer to https://libvirt.org/formatdomain.html#events-configuration for details about the
libvirtXML settings.