Skip to content

Commit cd493c7

Browse files
enable kdump
Signed-off-by: Poorna Gottimukkula <[email protected]>
1 parent adb579e commit cd493c7

File tree

5 files changed

+83
-0
lines changed

5 files changed

+83
-0
lines changed

examples/install_vars.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,12 @@ chronyconfig:
3838
options: iburst
3939

4040
# bastion_vip: "B.B.B.B"
41+
# For enabling the kdump
42+
kdump:
43+
enabled: false
44+
commandline_remove: "hugepages hugepagesz slub_debug quiet log_buf_len swiotlb"
45+
commandline_append: "irqpoll maxcpus=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 srcutree.big_cpu_lim=0"
46+
kexec_args: "-s"
47+
kdump_img: "vmlinuz"
48+
log_path: "/var/crash"
49+
crash_kernel_memory: "2G-4G:384M,4G-16G:512M,16G-64G:1G,64G-128G:2G,128G-:4G"

playbooks/roles/ocp-config/README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,13 @@ Role Variables
5656
| luks.options | no | ["--cipher", "aes-cbc-essiv:sha256"] | Set List of luks options for the luks encryption |
5757
| luks.wipeVolume | no | true | Configures the luks encrypted partition to be wiped |
5858
| luks.name | no | root | Set the value for the user label of Filesystem to be luks encrypted |
59+
| kdump.enabled | no | false | Set to true to enable the kdump on Cluster Nodes in OCP deployment |
60+
| kdump.commandline_remove | no | "hugepages hugepagesz slub_debug quiet log_buf_len swiotlb" | This option removes arguments from the current kdump command line |
61+
| kdump.commandline_append | no | "irqpoll maxcpus=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 srcutree.big_cpu_lim=0" | This option appends arguments to the current kdump command line |
62+
| kdump.kexec_args | no | "-s" | For adding any extra argument to pass to kexec command |
63+
| kdump.kdump_img | no | "vmlinuz" | For specifying image other than default kernel image |
64+
| kdump.log_path | no | "/var/crash" | The file system path in which the kdump saves the vmcore file |
65+
| kdump.crash_kernel_memory | no | "2G-4G:384M,4G-16G:512M,16G-64G:1G,64G-128G:2G,128G-:4G" | The memory reservation for kdump occurs during the system boot |
5966

6067
*chronyconfig variable example *
6168

@@ -90,6 +97,17 @@ luks:
9097
wipeVolume: true
9198
name: root
9299
```
100+
*Ansible variable for enabling the Kdump example*
101+
```
102+
kdump:
103+
enabled: true
104+
commandline_remove: "hugepages hugepagesz slub_debug quiet log_buf_len swiotlb"
105+
commandline_append: "irqpoll maxcpus=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 srcutree.big_cpu_lim=0"
106+
kexec_args: "-s"
107+
kdump_img: "vmlinuz"
108+
log_path: "/var/crash"
109+
crash_kernel_memory: "2G-4G:384M,4G-16G:512M,16G-64G:1G,64G-128G:2G,128G-:4G"
110+
```
93111
94112
Dependencies
95113
------------

playbooks/roles/ocp-config/defaults/main/main.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,11 @@ luks:
3030
- aes-cbc-essiv:sha256
3131
wipeVolume: true
3232
name: root
33+
kdump:
34+
enabled: false
35+
commandline_remove: "hugepages hugepagesz slub_debug quiet log_buf_len swiotlb"
36+
commandline_append: "irqpoll maxcpus=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 srcutree.big_cpu_lim=0"
37+
kexec_args: "-s"
38+
kdump_img: "vmlinuz"
39+
log_path: "/var/crash"
40+
crash_kernel_memory: "2G-4G:384M,4G-16G:512M,16G-64G:1G,64G-128G:2G,128G-:4G"

playbooks/roles/ocp-config/tasks/main.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,26 @@
9999
- "/machineconfig/*-chrony-configuration.yaml"
100100
when: chronyconfig.enabled
101101

102+
- name: Generate kdump machine configuration
103+
vars:
104+
kdump_sysconfig: |
105+
KDUMP_COMMANDLINE_REMOVE="{{ kdump.commandline_remove }}"
106+
KDUMP_COMMANDLINE_APPEND="{{ kdump.commandline_append }}"
107+
KEXEC_ARGS="{{ kdump.kexec_args }}"
108+
KDUMP_IMG="{{ kdump.kdump_img }}"
109+
kdump_conf: |
110+
path {{ kdump.log_path }}
111+
core_collector makedumpfile -l --message-level 7 -d 31
112+
crash_kernel_memory: "{{ kdump.crash_kernel_memory }}"
113+
role_n: "{{ item }}"
114+
template:
115+
src: ../templates/99-kdump-node-machineconfig.yaml.j2
116+
dest: "{{ workdir }}/manifests/99-kdump-{{ item }}-node-machineconfig.yaml"
117+
with_items:
118+
- worker
119+
- master
120+
when: kdump.enabled
121+
102122
- name: Create ignition files
103123
shell: "OPENSHIFT_INSTALL_RELEASE_IMAGE_OVERRIDE={{ release_image_override }} openshift-install create ignition-configs --log-level {{ log_level }}"
104124
args:
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
apiVersion: machineconfiguration.openshift.io/v1
2+
kind: MachineConfig
3+
metadata:
4+
labels:
5+
machineconfiguration.openshift.io/role: '{{ role_n }}'
6+
name: 99-{{ role_n }}-kdump
7+
spec:
8+
config:
9+
ignition:
10+
version: 3.2.0
11+
storage:
12+
files:
13+
- contents:
14+
source: data:text/plain;charset=utf-8;base64,{{ kdump_conf|b64encode }}
15+
mode: 420
16+
overwrite: true
17+
path: /etc/kdump.conf
18+
- contents:
19+
source: data:text/plain;charset=utf-8;base64,{{ kdump_sysconfig|b64encode }}
20+
mode: 420
21+
overwrite: true
22+
path: /etc/sysconfig/kdump
23+
systemd:
24+
units:
25+
- enabled: true
26+
name: kdump.service
27+
kernelArguments:
28+
- crashkernel="{{ crash_kernel_memory }}"

0 commit comments

Comments
 (0)