Red Hat Training

A Red Hat training course is available for Red Hat Enterprise Linux

21.3. Creating virsh Dump Files

Executing a virsh dump command sends a request to dump the core of a guest virtual machine to a file so errors in the virtual machine can be diagnosed. Running this command may require you to manually ensure proper permissions on file and path specified by the argument corefilepath. The virsh dump command is similar to a coredump (or the crash utility). To create the virsh dump file, run:
#virsh dump <domain> <corefilepath> [--bypass-cache] { [--live] | [--crash] | [--reset] } [--verbose] [--memory-only]
While the domain (guest virtual machine domain name) and corefilepath (location of the newly created core dump file) are mandatory, the following arguments are optional:
  • --live creates a dump file on a running machine and does not pause it.
  • --crash stops the guest virtual machine and generates the dump file. The main difference is that the guest virtual machine will not be listed as Stopped, with the reason as Crashed. Note that in virt-manager the status will be listed as Paused.
  • --reset will reset the guest virtual machine following a successful dump. Note, these three switches are mutually exclusive.
  • --bypass-cache uses O_DIRECT to bypass the file system cache.
  • --memory-only the dump file will be saved as an elf file, and will only include domain’s memory and cpu common register value. This option is very useful if the domain uses host devices directly.
  • --verbose displays the progress of the dump
The entire dump process may be monitored using virsh domjobinfo command and can be canceled by running virsh domjobabort.