21.2. Dumping a virtual machine core
To analyze why a virtual machine (VM) crashed or malfunctioned, you can dump the VM core to a file on disk for later analysis and diagnostics.
21.2.1. How virtual machine core dumping works
A virtual machine (VM) requires numerous running processes to work accurately and efficiently. In some cases, a running VM may terminate unexpectedly or malfunction while you are using it. Restarting the VM may cause the data to be reset or lost, which makes it difficult to diagnose the exact problem that caused the VM to crash.
In such cases, you can use the
virsh dump utility to save (or dump) the core of a VM to a file before you reboot the VM. The core dump file contains a raw physical memory image of the VM which contains detailed information about the VM. This information can be used to diagnose VM problems, either manually, or by using a tool such as the
21.2.2. Creating a virtual machine core dump file
A virtual machine (VM) core dump contains detailed information about the state of a VM at any given time. This information, which is similar to a snapshot of the VM, can help you detect problems if a VM malfunctions or shuts down suddenly.
- Make sure you have sufficient disk space to save the file. Note that the space occupied by the VM depends on the amount of RAM allocated to the VM.
For example, the following command dumps the
lander1VM’s cores, its memory and the CPU common register file to
# virsh dump lander1 /core/file/gargantua.file --memory-only Domain 'lander1' dumped to /core/file/gargantua.file
crash utility no longer supports the default file format of the virsh dump command. To analyze a core dump file using
crash, you must create the file using the
Additionally, you must use the
--memory-only option when creating a core dump file to attach to a Red Hat Support Case.
Résolution de problèmes
virsh dump command fails with a
System is deadlocked on memory error, ensure you are assigning sufficient memory for the core dump file. To do so, use the following
crashkernel option value. Alternatively, do not use
crashkernel at all, which assigns core dump memory automatically.
virsh dump --helpcommand
- Opening a Support Case