Customize 'crashkernel' parameter is not properly working
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Ubuntu on IBM z Systems |
Fix Released
|
High
|
Unassigned | ||
makedumpfile (Ubuntu) |
Fix Released
|
High
|
Thadeu Lima de Souza Cascardo | ||
Xenial |
New
|
Undecided
|
Unassigned | ||
Bionic |
Fix Released
|
High
|
Thadeu Lima de Souza Cascardo | ||
Cosmic |
Fix Released
|
High
|
Thadeu Lima de Souza Cascardo | ||
Disco |
Fix Released
|
High
|
Thadeu Lima de Souza Cascardo |
Bug Description
SRU Justification:
------------------
[Impact]
* While installing makedumpfile the "crashkernel=" argument is not properly set, hence dump is not triggered on reboot.
* Means the triggering of dumpfiles is currently not possible using makedumpfile.
* Dumpfiles are obviously only needed in rare cases, but if they are needed (e.g. in production environments) the situation is usually critical.
* Hence fixing this is needed to allow post-mortem analysis of a dumps.
* The provided shell code snippet provides a fixed sed statement that makes sure that the kernel parameter is propoerly set.
[Test Case]
* Create and boot a s390x (KVM virtual) machine
* Install kdump-tools and makedumpfile
Select 'yes' on question 'Should kdump-tools be enabled by default?' during installation
* [ Reboot system ]
* Look for crashkernel line in zipl boot-loader
grep crashkernel /etc/zipl.conf
crashkernel line is missing in case this bug still exists
one or more lines like this should be given:
parameters = root=UUID=
* One may further trigger a crash (for a full positiv test)
sudo -s
sysctl -w kernel.sysrq=1
echo c > /proc/sysrq-trigger
(in case this bug still exists the system will not come up again - check console in parallel)
Finally dump files should be visible in /var/crash
[Regression Potential]
* The regression potential is very low, since:
* it's limited to the zipl boot loader configuration file only
and this means again it's on the s390x platform only (IBM Z)
* kdump-tools and makedumpfile are not installed by default and only used in debug situations
hence only system where the package(s) got manually installed get updated
* The function is today broken anyway, hence it can actually only get better
* I successfully verified this in disco.
_______
Trying to use crashdump especially in a KVM machine.
Installation looks fine and the reboot is triggered.
But it does not work because the kernel does not have a 'crashkernel=' parameter.
Nothing in /proc/cmdline:
$ cat /proc/cmdline
root=LABEL=
Issue seems to be in adding the crashkernel line in this snippet:
# Customize crashkernel= value according to architecture
ARCH="$(arch)"
DEF_PRESET=
case "$ARCH" in
s390x)
HAS_
if test -z "$HAS_CRASHKERNEL"; then
sed -i "/parameters/
zipl
fi
sed -i "s/\#KDUMP_
sed -i "/KDUMP_
;;
esac
(especially 1st sed stmt)
affects: | ubuntu-z-systems → makedumpfile (Ubuntu) |
Changed in makedumpfile (Ubuntu): | |
assignee: | Canonical Kernel Team (canonical-kernel-team) → Thadeu Lima de Souza Cascardo (cascardo) |
status: | New → In Progress |
importance: | Undecided → High |
tags: | added: patch |
description: | updated |
Changed in ubuntu-z-systems: | |
status: | New → In Progress |
Changed in makedumpfile (Ubuntu Bionic): | |
status: | New → In Progress |
assignee: | nobody → Thadeu Lima de Souza Cascardo (cascardo) |
importance: | Undecided → High |
Changed in ubuntu-z-systems: | |
status: | In Progress → Fix Committed |
Changed in ubuntu-z-systems: | |
importance: | Undecided → High |
Changed in ubuntu-z-systems: | |
status: | Fix Committed → Fix Released |
Ack to the report.
While I had some systems (lpar) which worked I was trivially able to confirm that it doesn't work on KVM guests based on cloud images.
I see this on install of kdump-tools (default answers to debconf)
Setting up kdump-tools (1:1.6.4-2) ...
Using config file '/etc/zipl.conf'
Building bootmap in '/boot'
Adding IPL section 'ubuntu' (default)
Preparing boot device: vda (0000).
Done.
Creating config file /etc/default/ kdump-tools with new version
But that leaves /etc/zipl.conf unmodified.
Frank already copied the snippet in the report.
This line isn't working:
$ sed -i "/parameters/ {s|\"$| crashkernel= ${DEF_PRESET} \"|}" /etc/zipl.conf
At least in my guest and my LPARs the following seemed better, so for your consideration:
$ sed -i "s/^parameters\ s*=/& crashkernel= ${DEF_PRESET} /" /etc/zipl.conf
Note: at this point it already checked there is no crashkernel statement yet, so we can unconditionally insert it here.