Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configure kdump to exclude some coreos modules in generated kdump initramfs #1832

Open
dustymabe opened this issue Nov 14, 2024 · 12 comments
Open

Comments

@dustymabe
Copy link
Member

There are some low memory cases where kdump is failing to start.

The initramfs generated for kdump includes all the modules used for CoreOS, including Ignition, which make it larger than needed (i.e. Ignition shouldn't and won't run on the kdump boot). So there is opportunity for us to reduce the size (and thus memory requirements) through configuration.

This request originated in https://issues.redhat.com/browse/OCPBUGS-44368

@dustymabe
Copy link
Member Author

I think the biggest question in my mind would be whether we'd want to configure this in kdump itself (i.e. upstream kdump and delivered along with the kdump RPM) or separately in our overlay.

@dustymabe dustymabe added the meeting topics for meetings label Nov 14, 2024
@jbtrystram
Copy link
Contributor

Maybe related : rhkdump/kdump-utils#11 (comment)

@jlebon
Copy link
Member

jlebon commented Nov 27, 2024

This makes sense to me. Though it feels like it should live in f-c-c instead of kdump? We could probably even dynamically generate the exclusion config at build time so we don't have to maintain separate lists. Hmm, do we even need any of the CoreOS dracut modules in kdump? That'd be easy (e.g. just collect all modules with coreos or ignition in its name). If we do need some, we could get fancier and add some metadata in module-setup.sh or something.

@travier
Copy link
Member

travier commented Nov 27, 2024

If you look at #1837, it looks like they want to do the reverse, in that we would have to opt-in the coreos modules that we want in the kdump initramfs if my understanding is correct.

We mostly need the ostree one when we are dumping to the local system from memory, and maybe afterburn for networking? Otherwise I don't think we need anything else.

@travier
Copy link
Member

travier commented Nov 27, 2024

We briefly talked about that issue in today's community meeting and it looks like #1837 should be a good next step.

@licliu
Copy link

licliu commented Dec 4, 2024

Hi team, I noticed that ignition is not listed in dracut.conf.d, it is added as dependency or something else. The real problem is that the ignition related modules are too big, so I suggest to exclude the unnecessary modules when building initramfs.

@jbtrystram
Copy link
Contributor

@licliu it should be fixed with coreos/fedora-coreos-config#3289 if I understand correctly ?

@licliu
Copy link

licliu commented Dec 5, 2024

@jbtrystram I used to think the same, but testing revealed that Ignition is unconditionally included in the initramfs, even though it is not specified in any dracut.conf. I suspect this is because some Ignition-related modules have not implemented hostonly, and Dracut uses this to determine whether or not to include the module in the initramfs.

# lsinitrd /var/lib/kdump/initramfs-6.11.5-300.fc41.x86_64kdump.img|grep ignition
ignition
coreos-ignition
ignition-conf
ignition-ostree
ignition-conf-fcos

After removing the ignition module, the size of initramfs will be significantly reduced, from 66M to 43M.

PS: before coreos/fedora-coreos-config#3289, the initramfs in my test machine is 183M.

@travier
Copy link
Member

travier commented Dec 5, 2024

Overall, while it should work to build using hostonly for kdump right now, this is not the path we should take in the future, as we ideally should build the kdump initramfs image in the container and not on the host.

In the mean time, we can probably add what's needed to support the host-only mode to the ignition modules. I don't know what's needed exactly.

@travier
Copy link
Member

travier commented Dec 5, 2024

From https://man7.org/linux/man-pages/man7/dracut.modules.7.html:

module-setup.sh: check()
check() is called by dracut to evaluate the inclusion of a dracut
module in the initramfs.

  $hostonly
      If the $hostonly variable is set, then the module check()
      function should be in "hostonly" mode, which means, that the
      check() should only return 0, if the module is really needed
      to boot this specific host.

  check() should return with:

  0
      Include the dracut module in the initramfs.

  1
      Do not include the dracut module. The requirements are not
      fulfilled (missing tools, etc.)

  255
      Only include the dracut module, if another module requires it
      or if explicitly specified in the config file or on the
      argument list.

@travier
Copy link
Member

travier commented Dec 5, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants