butane icon indicating copy to clipboard operation
butane copied to clipboard

Add sugar for kdump configuration

Open travier opened this issue 4 years ago • 14 comments

What are the configuration options for kdump?

Enabling kdump on FCOS (& RHCOS) requires:

  • setting a kernel argument (for example: crashkernel=256M) which has a default suggested value;
  • setting options in /etc/kdump.conf to configure where the coredump will be stored;
  • setting options in /etc/sysconfig/kdump to configure additional kernel arguments passed to the "dump" kernel instance.
  • enabling the kdump.service unit.

What would the sugar looks like?

From https://github.com/coreos/fedora-coreos-tracker/issues/622#issuecomment-694225598:

kdump:
  crashkernel: 128M
  kargs: foo=bar
  config: |
    net penguin.example.com:/export/cores

References

travier avatar Dec 07 '20 17:12 travier

  • Rather than crashkernel: 128M, maybe something like reserved_mib: 128?
  • Is it common to want to pass additional arguments to the dump kernel? Or can we let the user configure this themselves if they want it?

bgilbert avatar Dec 07 '20 17:12 bgilbert

  • Rather than crashkernel: 128M, maybe something like reserved_mib: 128?

The full option syntax enables setting memory size dependent values and offset but I don't know if that's something we want to support.

  • Is it common to want to pass additional arguments to the dump kernel? Or can we let the user configure this themselves if they want it?

I think this heavily depend on where the coredump will be stored as you might need to setup networking for the crash initrd.

travier avatar Dec 07 '20 18:12 travier

The full option syntax enables setting memory size dependent values and offset but I don't know if that's something we want to support.

I suspect that's a pretty unusual setting. Users can always bypass the sugar and configure advanced settings manually.

I think this heavily depend on where the coredump will be stored as you might need to setup networking for the crash initrd.

Would it make sense to provide target-specific sugar?

kdump:
  reserved_mib: 128
  destinations:
    net:
      kernel_args: ip=X
      remotes:
        - penguin.example.com:/export/cores
    something-else: z

bgilbert avatar Dec 07 '20 21:12 bgilbert

  • Is it common to want to pass additional arguments to the dump kernel? Or can we let the user configure this themselves if they want it?

I think this heavily depend on where the coredump will be stored as you might need to setup networking for the crash initrd.

Looking at kdump.conf (config for kdumpctl) and /usr/bin/kdumpctl (executed by kdump.service), it doesn't seem like there is a way to configure the kargs passed to the crash kernel (via kdump); it looks like the kargs passed to the crash kernel are always the same. So I think that although kexec does support specifying kargs for the crash/second kernel, it might not be necessary for kdump to work.

kelvinfan001 avatar Dec 08 '20 00:12 kelvinfan001

It looks like kdumpctl sources the content of /etc/sysconfig/kdump to setup kdump kernel kargs.

So I think that although kexec does support specifying kargs for the crash/second kernel, it might not be necessary for kdump to work.

I don't think this is required for kdump but someone might want to setup a custom networking configuration to bring only the internal network for example (and not the internet connected one) to save kdumps to an internal server as they may include sensitive data.

travier avatar Dec 08 '20 11:12 travier

I suspect that's a pretty unusual setting. Users can always bypass the sugar and configure advanced settings manually.

Agree.

I think this heavily depend on where the coredump will be stored as you might need to setup networking for the crash initrd.

Would it make sense to provide target-specific sugar?

AFAIK, the kdump.conf docs say that "only one dump target and path can be specified".

travier avatar Dec 08 '20 11:12 travier

It looks like kdumpctl sources the content of /etc/sysconfig/kdump to setup kdump kernel kargs.

ahh you're right, I completely missed that. Sorry for the confusion!

kelvinfan001 avatar Dec 08 '20 14:12 kelvinfan001

Would it make sense to provide target-specific sugar?

AFAIK, the kdump.conf docs say that "only one dump target and path can be specified".

Ah, okay. Even so, it might be useful to abstract some of the low-level config file details.

bgilbert avatar Dec 09 '20 04:12 bgilbert

Enabling kdump on FCOS (& RHCOS) requires:

I think that list is also missing enabling kdump.service itself.

jlebon avatar Jan 26 '21 17:01 jlebon

Hi,

Is this work still required? Regarding OpenShift, Butane is available for configuring kdump since OpenShift 4.8 as in documentation. This doesn't look so complicated for those who want to enable kdump simply and looks flexible for those who want to customize the configuration by themselves.

I'm interested in this issue because I hope development of kdump for OpenShift will be completed and it will be fully available.

hshiina avatar Aug 04 '21 17:08 hshiina

It's not required, and we can always add it later.

I'd note, though, that the linked example in OCP docs is not trivial. It has one service enablement, one karg, and two config files with different syntaxes and a bunch of boilerplate. This is exactly the sort of thing sugar can help simplify.

bgilbert avatar Aug 04 '21 18:08 bgilbert

I don't think this feature is required for kdump to be fully supported. However it would definitely help with UX as @bgilbert mentioned.

travier avatar Aug 09 '21 11:08 travier

Is this something we still want to pursue?

bgilbert avatar Jan 10 '23 18:01 bgilbert

I'd say that it would be nice to have but it's low priority.

travier avatar Jan 27 '23 10:01 travier