Skip to content

Commit b1ccafa

Browse files
author
Bob Furu
authored
Merge pull request #32834 from hshiina/machineconfig-kdump
2 parents d0cf099 + e5277b8 commit b1ccafa

File tree

1 file changed

+77
-1
lines changed

1 file changed

+77
-1
lines changed

modules/investigating-kernel-crashes.adoc

Lines changed: 77 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ Perform the following steps to enable `kdump` on {op-system}.
2727
# rpm-ostree kargs --append='crashkernel=256M'
2828
----
2929

30-
. Optional: To write the crash dump over the network or to some other location, rather than to the default local `/var/crash` location, edit the `/etc/kdump.conf` configuration file.
30+
. Optional: To write the crash dump over the network or to some other location, rather than to the default local `/var/crash` location, edit the `/etc/kdump.conf` configuration file.
3131
+
3232
[NOTE]
3333
====
@@ -65,6 +65,82 @@ The `kdump` service is intended to be enabled per node to debug kernel problems.
6565

6666
If you are aware of the downsides and trade-offs of having the `kdump` service enabled, it is possible to enable `kdump` in a cluster-wide fashion. Although machine-specific machine configs are not yet supported, you can perform the previous steps through a `systemd` unit in a `MachineConfig` object on day-1 and have kdump enabled on all nodes in the cluster. You can create a `MachineConfig` object and inject that object into the set of manifest files used by Ignition during cluster setup. See "Customizing nodes" in the _Installing -> Installation configuration_ section for more information and examples on how to use Ignition configs.
6767

68+
.Procedure
69+
70+
Create a `MachineConfig` object for cluster-wide configuration:
71+
72+
. Optional: If you change the `/etc/kdump.conf` configuration from the default, you can encode it into base64 format to include its content in your `MachineConfig` object:
73+
+
74+
[source,terminal]
75+
----
76+
$ cat << EOF | base64
77+
path /var/crash
78+
core_collector makedumpfile -l --message-level 7 -d 31
79+
EOF
80+
----
81+
82+
. Optional: Create a content of the `/etc/sysconfig/kdump` file and encode it as base64 if you change the configuration from the default:
83+
+
84+
[source,terminal]
85+
----
86+
$ cat << EOF | base64
87+
KDUMP_COMMANDLINE_REMOVE="hugepages hugepagesz slub_debug quiet log_buf_len swiotlb"
88+
KDUMP_COMMANDLINE_APPEND="irqpoll nr_cpus=1 reset_devices cgroup_disable=memory mce=off numa=off udev.children-max=2 panic=10 rootflags=nofail acpi_no_memhotplug transparent_hugepage=never nokaslr novmcoredd hest_disable"
89+
KEXEC_ARGS="-s"
90+
KDUMP_IMG="vmlinuz"
91+
EOF
92+
----
93+
94+
. Create the `MachineConfig` object file:
95+
+
96+
[source,terminal]
97+
----
98+
$ cat << EOF > ./99-master-kdump-configuration.yaml
99+
apiVersion: machineconfiguration.openshift.io/v1
100+
kind: MachineConfig
101+
metadata:
102+
labels:
103+
machineconfiguration.openshift.io/role: master <1>
104+
name: 99-master-kdump-configuration
105+
spec:
106+
kernelArguments:
107+
- 'crashkernel=256M' <2>
108+
config:
109+
ignition:
110+
version: 3.2.0
111+
storage:
112+
files:
113+
- contents:
114+
source: data:text/plain;charset=utf-8;base64,ICAgIHBhdGggL3Zhci9jcmFzaAogICAgY2... <3>
115+
mode: 420
116+
overwrite: true
117+
path: /etc/kdump.conf
118+
- contents:
119+
source: data:text/plain;charset=utf-8;base64,S0RVTVBfQ09NTUFORExJTkVfUkVNT1ZFPS... <4>
120+
mode: 420
121+
overwrite: true
122+
path: /etc/sysconfig/kdump
123+
systemd:
124+
units:
125+
- enabled: true
126+
name: kdump.service
127+
EOF
128+
----
129+
+
130+
<1> Replace `master` with `worker` for creating a `MachineConfig` object for the `worker` role.
131+
<2> Provide kernel arguments to reserve memory for the crash kernel. You can add other kernel arguments if necessary.
132+
<3> Replace the base64 content with the one you created for `/etc/kdump.conf`.
133+
<4> Replace the base64 content with the one you created for `/etc/sysconfig/kdump`.
134+
+
135+
136+
. Put the YAML file into manifests during cluster setup. You can also create this `MachineConfig` object after cluster setup with the YAML file:
137+
138+
+
139+
[source,terminal]
140+
----
141+
$ oc create -f ./99-master-kdump-configuration.yaml
142+
----
143+
68144
== Testing the kdump configuration
69145

70146
ifdef::openshift-enterprise[]

0 commit comments

Comments
 (0)