Show Table of Contents
20.19. Creating a Dump File of a Guest Virtual Machine's Core Using virsh dump
One of the methods of troubleshooting guest virtual machines (in addition to kdump and pvpanic) is using the
virsh dump domain corefilepath [--bypass-cache] {--live | --crash | --reset} [--verbose] [--memory-only] [--format=format] command. This creates a dump file containing the core of the guest virtual machine so that it can be analyzed, for example by the crash utility.
Specifically, running
virsh dump command dumps the guest virtual machine core to a file specified by the core file path that you supply. Note that some hypervisors may give restrictions on this action and may require the user to manually ensure proper permissions on the file and path specified in the corefilepath parameter. This command is supported with SR-IOV devices as well as other passthrough devices. The following arguments are supported and have the following effect:
--bypass-cache- The file saved will not bypass the host's file system cache. It has no effect on the content of the file. Note that selecting this option may slow down the dump operation.--livewill save the file as the guest virtual machine continues to run and will not pause or stop the guest virtual machine.--crashputs the guest virtual machine in a crashed status rather than leaving it in a paused state while the dump file is saved. The guest virtual machine will be listed as "Shut off", with the reason as "Crashed".--reset- When the dump file is successfully saved, the guest virtual machine will reset.--verbosedisplays the progress of the dump process--memory-only- Running a dump using this option will create a dump file where the contents of the dump file will only contain the guest virtual machine's memory and CPU common register file. This option should be used in cases where running a full dump will fail. This may happen when a guest virtual machine cannot be live migrated (due to a passthrough PCI device).You can save the memory-only dump using the--format=formatoption. The following formats are available:elf- the default, uncompressed formatkdump-zlib- kdump-compressed format with zlib compressionkdump-lzo- kdump-compressed format with LZO compressionkdump-snappy- kdump-compressed format with Snappy compression
Important
Thecrashutility no longer supports the default core dump file format of thevirsh dumpcommand. If you usecrashto analyze to core dump file created byvirsh dump, you must use the--memory-onlyoption.
Note that the entire process can be monitored using the
virsh domjobinfo command and can be canceled using the virsh domjobabort command.
Example 20.47. How to create a dump file with virsh
The following example creates a dump file of the guest1 virtual machine's core, saves it into the
core/file/path.file file, and then resets the guest. The most common scenario for using this command is if your guest virtual machine is not behaving properly:
# virsh dump guest1 core/file/path.file --reset
Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.