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 2094260 - RHEL 9 kernel panic on Packer launched qemu-kvm
Summary: RHEL 9 kernel panic on Packer launched qemu-kvm
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: kernel
Version: 9.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Virtualization Maintenance
QA Contact: liunana
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-06-07 09:57 UTC by Marko Myllynen
Modified: 2022-06-29 04:02 UTC (History)
12 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-06-27 09:49:04 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
installer kernel panic (16.31 KB, image/png)
2022-06-07 09:57 UTC, Marko Myllynen
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RHELPLAN-124448 0 None None None 2022-06-07 10:13:39 UTC

Description Marko Myllynen 2022-06-07 09:57:22 UTC
Created attachment 1887429 [details]
installer kernel panic

Description of problem:
When trying to create a RHEL 9 VM with Packer + Qemu builder running on RHEL 7.9, the installer fails due to kernel panic. See the attached screenshot for the output. The relevant part of qemu-kvm command line is:

/usr/libexec/qemu-kvm -m 4096M ... -machine type=pc,accel=kvm -smp cpus=2,sockets=2

If configuring Packer to add "-cpu host" to qemu-kvm command line then the installer starts normally. Another user reported the same issue elsewhere and fixed this slightly differently: https://discuss.hashicorp.com/t/packer-qemu-kvm-redhat-9-kernel-panic/39886.

I'm not sure what's the root cause for this so I'm filing the issue for both Red Hat and Packer, hopefully either or both sides can be tweaked to fix this issue. Thanks.

Version-Release number of selected component (if applicable):
RHEL 9.0 / Packer 1.8.1

Comment 1 Marko Myllynen 2022-06-07 09:58:56 UTC
This is the corresponding issue at Packer GitHub:

https://github.com/hashicorp/packer/issues/11839

Comment 8 Nitesh Narayan Lal 2022-06-16 15:59:34 UTC
Summarizing the above private discussion:

The reported kernel panic is a result of using the default CPU model with qemu which is 'qemu64' which is deprecated.

From Daniel's private comment above:
Direct invocation of qemu-kvm is not supported in RHEL. We expect the user to launch the VM via libvirt, usually recommended with an mgmt tool which should only enable/use the supported option.
For more details please refer to:
https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/9/html/configuring_and_managing_virtualization/introducing-virtualization-in-rhel_configuring-and-managing-virtualization

[quote]
While QEMU is an essential component of the architecture, it is not intended to be used directly on RHEL 9 systems, due to security concerns. Therefore, using qemu-* commands is not supported by Red Hat, and it is highly recommended to interact with QEMU using libvirt. 
[/quote]


We do have Bug#2060839 to deprecate CPU models like "kvm64" / "qemu64" on 9.1 from RHEL.

Hence, I think we can close the bug as "NOTABUG" or as DUP of Bug#2060839.

Any thoughts/concerns?
Also, adding Igor to see if he has any additional thoughts.

Comment 9 Marko Myllynen 2022-06-21 17:32:00 UTC
Thanks for looking into this.

The above statement sounds good however in case if it's not possible to use libvirt (in all situations or in the short-term), would we have a suggestion how to invoke qemu-kvm to avoid kernel panic? I suspect using libvirt instead of qemu-kvm might require longer discussion and larger effort with Packer so I wonder do we have a temporary solution to allow Packer to build RHEL 9 images while they consider using libvirt?

In any case, once we close this BZ I'll pass the info to the Packer/Qemu upstream ticket mentioned above.

Thanks.

Comment 10 Dr. David Alan Gilbert 2022-06-21 17:41:30 UTC
(In reply to Marko Myllynen from comment #9)
> Thanks for looking into this.
> 
> The above statement sounds good however in case if it's not possible to use
> libvirt (in all situations or in the short-term), would we have a suggestion
> how to invoke qemu-kvm to avoid kernel panic? I suspect using libvirt
> instead of qemu-kvm might require longer discussion and larger effort with
> Packer so I wonder do we have a temporary solution to allow Packer to build
> RHEL 9 images while they consider using libvirt?
> 
> In any case, once we close this BZ I'll pass the info to the Packer/Qemu
> upstream ticket mentioned above.
> 
> Thanks.

As you said in the initial comment, -cpu host  works; that should generally be fine
unless they plan live migration in a hetoregenous environment.

Comment 11 Marko Myllynen 2022-06-21 18:03:53 UTC
(In reply to Dr. David Alan Gilbert from comment #10)
> 
> As you said in the initial comment, -cpu host  works; that should generally
> be fine unless they plan live migration in a hetoregenous environment.

Thanks for confirming. Packer definitely does not migrate anything, it's just an image building tool.

Comment 15 Nitesh Narayan Lal 2022-06-24 12:59:59 UTC
Thanks, Daniel. 
Marko, are we good in closing this BZ now? If so, can you please in closing it?

Thanks

Comment 16 Marko Myllynen 2022-06-27 09:49:04 UTC
Thanks all, based on the above comments and the earlier BZ#2060839 I'm closing this as NOTABUG. I'll also provide a summary to the Packer upstream issue about this.


Note You need to log in before you can comment on or make changes to this bug.