Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 2029801

Summary: RFE: Allow creating kdump.img for all kernel versions
Product: Red Hat Enterprise Linux 9 Reporter: Marko Myllynen <myllynen>
Component: kexec-toolsAssignee: Philipp Rudo <prudo>
Status: CLOSED MIGRATED QA Contact: Jie Li <jieli>
Severity: unspecified Docs Contact: Sujata Kurup <skurup>
Priority: unspecified    
Version: 9.0CC: denli, frival, prudo, ruyang, skurup, xiawu
Target Milestone: rcKeywords: FutureFeature, MigratedToJIRA, Triaged
Target Release: ---Flags: pm-rhel: mirror+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Release Note
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-09-25 17:53:24 UTC Type: Story
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Marko Myllynen 2021-12-07 10:37:55 UTC
Description of problem:
dracut allows updating the standard initramfs image for all kernels with:

dracut -f --regenerate-all

Currently "kdumpctl rebuild" can be used to update the kdump.img image only for the running kernel.

It would be helpful in some cases if "kdumpctl rebuild" would provide similar functionality as dracut so to allow creating/updating the kdump.img for all the installed kernel versions.

For instance, when creating a base image this could be used to create the kdump.img during image creation time thus hopefully avoiding the need for each instance creating the kdump.img after the initial boot.

Version-Release number of selected component (if applicable):
RHEL 9.0 Beta

Comment 2 Philipp Rudo 2022-01-19 15:32:53 UTC
Hi Marko,

I'm currently looking into your RFE. Can you please help me to understand your use case a better so I know what needs to be done.

BTW as this targets cloud environments, I'm currently assuming that the system where you create the images and the instances where the images are ran differ substantially. Especially they might want to have different settings in /etc/kdump.conf.

(In reply to Marko Myllynen from comment #0)
> Description of problem:
> dracut allows updating the standard initramfs image for all kernels with:
> 
> dracut -f --regenerate-all
> 
> Currently "kdumpctl rebuild" can be used to update the kdump.img image only
> for the running kernel.

That's not entirely true. You can use a specific kernel by setting KDUMP_KERNELVER in /etc/sysconfig/kdump (Note: exporting KDUMP_KERNELVER before executing kdumpctl won't work as the variable will be overwritten at the beginning of kdumpctl by the value set in the config...). So in theory you could update /etc/sysconfig/kdump (and /etc/kdump.conf) and then call "kdumpctl rebuild" for every installed kernel. But that sounds unnecessarily complicated and quite error prone to me.

> It would be helpful in some cases if "kdumpctl rebuild" would provide
> similar functionality as dracut so to allow creating/updating the kdump.img
> for all the installed kernel versions.

A recent item added a --kernel=<kernel-path> option for an different subcommand, where <kernel-path> can be any path accepted by grubby (including ALL and DEFAULT). My plan is to add the same option for 'rebuild' so that a user can specify for which kernel version(s) the initrd shall be rebuild. In addition I plan to add a '--config' option that allows to specify an alternate config instead of /etc/kdump.conf. 

Would my plans be sufficient for your use case?

> For instance, when creating a base image this could be used to create the
> kdump.img during image creation time thus hopefully avoiding the need for
> each instance creating the kdump.img after the initial boot.

Agree, avoiding the need to rebuild the initrd for every instance what we should aim for.

Thanks
Philipp

> Version-Release number of selected component (if applicable):
> RHEL 9.0 Beta

Comment 3 Marko Myllynen 2022-01-21 16:27:09 UTC
Thanks for looking into this!

(In reply to Philipp Rudo from comment #2)
> 
> I'm currently looking into your RFE. Can you please help me to understand
> your use case a better so I know what needs to be done.
> 
> BTW as this targets cloud environments, I'm currently assuming that the
> system where you create the images and the instances where the images are
> ran differ substantially. Especially they might want to have different
> settings in /etc/kdump.conf.

That's a good point that should be kept in mind, and preferably also mentioned on the man page if this feature is added.

I'm currently building our local base image on VMware which is also where it will be used so here we should have pretty much identical systems in both cases. Some VMs might eventually have different amount of NICs and more disks but all the adapters and drivers should still be the same.

> > Currently "kdumpctl rebuild" can be used to update the kdump.img image only
> > for the running kernel.
> 
> That's not entirely true. You can use a specific kernel by setting
> KDUMP_KERNELVER in /etc/sysconfig/kdump (Note: exporting KDUMP_KERNELVER
> before executing kdumpctl won't work as the variable will be overwritten at
> the beginning of kdumpctl by the value set in the config...).

A-ha, ok, I failed to notice that, I only tried using the environment variable and it didn't help.

I've now managed to build kdump initramfs in a template preparation script for the latest kernel with:

# Create kdump initramfs for the newest kernel
kver_latest=$(rpm -q --qf "%{version}-%{release}.%{arch}\n" kernel | sort -V | tail -n 1)
sed -i -e "s,^KDUMP_KERNELVER=.*,KDUMP_KERNELVER=$kver_latest," /etc/sysconfig/kdump
kdumpctl rebuild
sed -i -e 's,^KDUMP_KERNELVER=.*,KDUMP_KERNELVER="",' /etc/sysconfig/kdump

But as you say this is unnecessarily complicated compared to merely providing an option to kdumpctl.

> A recent item added a --kernel=<kernel-path> option for an different
> subcommand, where <kernel-path> can be any path accepted by grubby
> (including ALL and DEFAULT). My plan is to add the same option for 'rebuild'
> so that a user can specify for which kernel version(s) the initrd shall be
> rebuild. In addition I plan to add a '--config' option that allows to
> specify an alternate config instead of /etc/kdump.conf. 
> 
> Would my plans be sufficient for your use case?

Yes, sounds very good, --kernel=ALL or such would be as easy as it needs to be.

Thanks!

Comment 8 Philipp Rudo 2023-06-19 12:44:47 UTC
Draft for this feature was sent to the mailing list [1]. It became a rather large change so I'm afraid I won't be able to backport it to 8.9/9.3 in time. So deferring this RFE once more.

[1] https://lists.fedoraproject.org/archives/list/kexec@lists.fedoraproject.org/thread/ENTBABCB6OJO3X4ZAP5CLJT5K5FUNYGV/

Comment 13 RHEL Program Management 2023-09-25 17:38:23 UTC
Issue migration from Bugzilla to Jira is in process at this time. This will be the last message in Jira copied from the Bugzilla bug.

Comment 14 RHEL Program Management 2023-09-25 17:53:24 UTC
This BZ has been automatically migrated to the issues.redhat.com Red Hat Issue Tracker. All future work related to this report will be managed there.

Due to differences in account names between systems, some fields were not replicated.  Be sure to add yourself to Jira issue's "Watchers" field to continue receiving updates and add others to the "Need Info From" field to continue requesting information.

To find the migrated issue, look in the "Links" section for a direct link to the new issue location. The issue key will have an icon of 2 footprints next to it, and begin with "RHEL-" followed by an integer.  You can also find this issue by visiting https://issues.redhat.com/issues/?jql= and searching the "Bugzilla Bug" field for this BZ's number, e.g. a search like:

"Bugzilla Bug" = 1234567

In the event you have trouble locating or viewing this issue, you can file an issue by sending mail to rh-issues. You can also visit https://access.redhat.com/articles/7032570 for general account information.