Skip to content

Commit eccafae

Browse files
author
Bob Furu
authored
Merge pull request #33736 from bgilbert/kdump
2 parents 9a163b3 + 6786d7f commit eccafae

File tree

1 file changed

+42
-56
lines changed

1 file changed

+42
-56
lines changed

modules/investigating-kernel-crashes.adoc

Lines changed: 42 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -69,76 +69,62 @@ If you are aware of the downsides and trade-offs of having the `kdump` service e
6969

7070
Create a `MachineConfig` object for cluster-wide configuration:
7171

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:
72+
. Create a Butane config file, `99-worker-kdump.bu`, that configures and enables kdump:
7373
+
74-
[source,terminal]
74+
[source,yaml]
7575
----
76-
$ cat << EOF | base64
77-
path /var/crash
78-
core_collector makedumpfile -l --message-level 7 -d 31
79-
EOF
76+
variant: openshift
77+
version: 4.8.0
78+
metadata:
79+
name: 99-worker-kdump <1>
80+
labels:
81+
machineconfiguration.openshift.io/role: worker <1>
82+
openshift:
83+
kernel_arguments: <2>
84+
- crashkernel=256M
85+
storage:
86+
files:
87+
- path: /etc/kdump.conf <3>
88+
mode: 0644
89+
overwrite: true
90+
contents:
91+
inline: |
92+
path /var/crash
93+
core_collector makedumpfile -l --message-level 7 -d 31
94+
95+
- path: /etc/sysconfig/kdump <4>
96+
mode: 0644
97+
overwrite: true
98+
contents:
99+
inline: |
100+
KDUMP_COMMANDLINE_REMOVE="hugepages hugepagesz slub_debug quiet log_buf_len swiotlb"
101+
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"
102+
KEXEC_ARGS="-s"
103+
KDUMP_IMG="vmlinuz"
104+
105+
systemd:
106+
units:
107+
- name: kdump.service
108+
enabled: true
80109
----
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:
83110
+
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-
----
111+
<1> Replace `worker` with `master` in both locations when creating a `MachineConfig` object for control plane nodes.
112+
<2> Provide kernel arguments to reserve memory for the crash kernel. You can add other kernel arguments if necessary.
113+
<3> If you want to change the contents of `/etc/kdump.conf` from the default, include this section and modify the `inline` subsection accordingly.
114+
<4> If you want to change the contents of `/etc/sysconfig/kdump` from the default, include this section and modify the `inline` subsection accordingly.
93115

94-
. Create the `MachineConfig` object file:
116+
. Use Butane to generate a machine config YAML file, `99-worker-kdump.yaml`, containing the configuration to be delivered to the nodes:
95117
+
96118
[source,terminal]
97119
----
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
120+
$ butane 99-worker-kdump.bu -o 99-worker-kdump.yaml
128121
----
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-
+
135122

136123
. Put the YAML file into manifests during cluster setup. You can also create this `MachineConfig` object after cluster setup with the YAML file:
137-
138124
+
139125
[source,terminal]
140126
----
141-
$ oc create -f ./99-master-kdump-configuration.yaml
127+
$ oc create -f ./99-worker-kdump.yaml
142128
----
143129

144130
== Testing the kdump configuration

0 commit comments

Comments
 (0)