How to configure kdump for a Red Hat Enterprise Linux system running on Microsoft Hyper-V

Solution Unverified - Updated

Environment

  • Red Hat Enterprise Linux 5, 6, or 7
  • Hyper-V host

Issue

  • Kdump service fails to start on RHEL system running on Hyper V
  • Kdump service starts, but crash kernel hangs while attempting to generate a core

Resolution

Note: It is necessary to manually reserve a specific memory amount for the crash kernel on the Grub kernel command line for Hyper-V systems. You cannot use the "crashkernel=auto" option

Note HyperV daemons are not available for RHEL 5. These instructions should work for RHEL 5 with LIS, but are provided by Microsoft and are not guaranteed to work in all situations

  • From here, please follow these steps. Note that these must be followed for any dump target (i.e. SSH, NFS, or local dump target).

RHEL 5 guests, on Hyper-V before 2012 R2

Ensure /etc/kdump.conf contains the following lines:

blacklist hv_vmbus hv_storvsc hv_utils hv_netvsc hid-hyperv
disk_timeout 100

Next, add the following options to the KDUMP_COMMANDLINE_APPEND line in /etc/sysconfig/kdump:

KDUMP_COMMANDLINE_APPEND="ide_core.prefer_ms_hyperv=0"

RHEL 6 guests, on Hyper-V before 2012 R2

Ensure /etc/kdump.conf contains the following lines:

extra_modules ata_piix sr_mod sd_mod
options ata_piix prefer_ms_hyperv=0
blacklist hv_vmbus hv_storvsc hv_utils hv_netvsc hid-hyperv
disk_timeout 100

Warning: There is a known issue which causes kdump to fail in RHEL6.7 and likely earlier versions when hosted on ws2012 r2. The fix for this issue was included in kernel version kernel-2.6.32-642.13.1.el6. This kernel is a 6.8 z-stream kernel.

RHEL 7 guests, on Hyper-V before 2012 R2

Ensure your /etc/kdump.conf file has the following options:

extra_modules ata_piix sr_mod sd_mod

Next, add the following options to the KDUMP_COMMANDLINE_APPEND line in /etc/sysconfig/kdump:

KDUMP_COMMANDLINE_APPEND="ata_piix.prefer_ms_hyperv=0 disk_timeout=100 rd.driver.blacklist=hv_vmbus,hv_storvsc,hv_utils,hv_netvsc,hid-hyperv"

RHEL 6 or 7 guests, on Hyper-V 2012 R2 and Hyper-V 2016 R2

On these systems, no /etc/kdump.conf modifications are required. Currently, October 2018, Windows Server 2012 R2 Hyper-V Generation 2 Virtual Machines are only certified with RHEL7. Windows Server 2016 Hyper-V Generation 2 Virtual Machines are certified with RHEL6 and RHEL7.

  • On RHEL6 with these newer Hyper-V, these BZs are relevant:
  • bz1333167 [Hyper-V][RHEL6.8] kdump triggered through NMI does not create vmcore dump file, fixed in RHEL6.9GA (and later), as well as for RHEL6.8.z in RHSA-2017-0036.
  • bz1301903 [Hyper-V][RHEL 6.8]Failure to get dump by "Sysrq" + "c" in RHEL on Hyper-V, fixed in RHEL6.9GA with RHSA-2017-0817

Root Cause

  • Hyper-V can not host two simultaneous connections from the same synthetic driver that's running inside a virtual machine. This means that kdump cannot utilize the Hyper-V storage driver, storvsc.

  • For this reason, these settings are intended to force the crash kernel to utilize standard Linux storage driver.

  • Hyper-V Generation 2 guests (supported since Hyper-V 2012 R2) have no longer IDE emulated disks available. On older Hyper-V guests, the paravirtualized drivers need to be blacklisted. On systems of the newer type, the paravirtualized drivers should be used.

Diagnostic Steps

  • Be aware that it can take some time for the kdump driver to fully initialize and write the core to disk.

  • The system may appear to hang with no console logs for a few minutes.

SBR
Components
Category

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.