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 2218203 - Virt-what does not return correct result when running inside an openshift container
Summary: Virt-what does not return correct result when running inside an openshift con...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: virt-what
Version: 9.3
Hardware: All
OS: Linux
unspecified
medium
Target Milestone: rc
: ---
Assignee: Richard W.M. Jones
QA Contact: YongkuiGuo
URL:
Whiteboard:
Depends On: 2217407
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-06-28 12:43 UTC by Richard W.M. Jones
Modified: 2023-11-07 11:40 UTC (History)
9 users (show)

Fixed In Version: virt-what-1.25-5.el9
Doc Type: If docs needed, set a value
Doc Text:
Clone Of: 2217407
Environment:
Last Closed: 2023-11-07 08:56:22 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RHELPLAN-161074 0 None None None 2023-06-28 12:44:44 UTC
Red Hat Product Errata RHBA-2023:6704 0 None None None 2023-11-07 08:56:23 UTC

Description Richard W.M. Jones 2023-06-28 12:43:02 UTC
+++ This bug was initially created as a clone of Bug #2217407 +++

[RWMJ: Cloning for RHEL 9 so that we don't create a regression
when upgrading]

Description of problem:

It's impossible to request a virtual subscription of RedHat OS while running in a Openshift container. That's due to the fact that virt-what doesn't detect CRI-O based containers.

Version-Release number of selected component (if applicable): 8.8


How reproducible:
Run a container registry.access.redhat.com/ubi8/ubi-init:8.8 on openshift

Steps to Reproduce:
1. Launch a container registry.access.redhat.com/ubi8/ubi-init:8.8 on openshift
2. Run #virt-what

Actual results:
#virt-what
Return code 0

Expected results:
#virt-what
crio

Additional info:

--- Additional comment from Richard W.M. Jones on 2023-06-27 13:17:11 UTC ---

Can you tell us the precise version of virt-what?  rpm -q virt-what

--- Additional comment from Richard W.M. Jones on 2023-06-27 13:21:42 UTC ---

Also what's the version of OpenShift (if known).

What is the contents of /proc/1/environ ?

--- Additional comment from  on 2023-06-27 13:48:26 UTC ---

Thank you for the quick reply!

$ rpm -q virt-what
virt-what-1.25-3.el8.x86_64

$cat /proc/1/environ # I just kept the part related to the container because I'm not sure how much of the file I am allowed to share
container=crio

Openshift Version: 4.13.1

--- Additional comment from Xiaodai Wang on 2023-06-27 15:09:03 UTC ---

I can reproduce it in an OCP cluster which is installed on baremetal.

I also tried the cluster which is installed on a VM, the result is
# virt-what
kvm

I tried it again in podman, the result is
# podman exec -it 392a422ca3b2 virt-what
oci

--- Additional comment from Richard W.M. Jones on 2023-06-27 16:24:13 UTC ---

(In reply to Xiaodai Wang from comment #4)
> I can reproduce it in an OCP cluster which is installed on baremetal.
> 
> I also tried the cluster which is installed on a VM, the result is
> # virt-what
> kvm

I believe we are expecting output like:

# virt-what
kvm
crio      ; or maybe "oci" here, being discussed on tech-list

Note "kvm" is still printed because of the KVM VM you're running it in.

> I tried it again in podman, the result is
> # podman exec -it 392a422ca3b2 virt-what
> oci

Yes, this is correct.

--- Additional comment from Richard W.M. Jones on 2023-06-28 08:59:49 UTC ---

(In reply to Xiaodai Wang from comment #4)
> I can reproduce it in an OCP cluster which is installed on baremetal.

Xiaodai, can I get remote access to this?  (Email me the creds if possible)

--- Additional comment from Richard W.M. Jones on 2023-06-28 12:27:28 UTC ---

Upstream fix:
http://git.annexia.org/?p=virt-what.git;a=commitdiff;h=95d18c02038f44bc3e8ff264079f8b697eecf1bd

# virt-what
crio

--- Additional comment from Richard W.M. Jones on 2023-06-28 12:29:38 UTC ---

I've suggested a potential fix in ITM 20 for RHEL 8.9, although it's a bit late in
the process.  Let's see what QE want to do.

--- Additional comment from YongkuiGuo on 2023-06-28 12:31:02 UTC ---

Thanks xiaodai for reproducing this issue.

Comment 1 YongkuiGuo 2023-07-03 10:07:15 UTC
Tested with the following package:
virt-what-1.25-5.el9.x86_64

Steps:

1. Install OCP 4.13 in a VM and launch a container registry.access.redhat.com/ubi9/ubi-init:latest

sh-5.1# cat /etc/redhat-release 
Red Hat Enterprise Linux release 9.2 (Plow)
sh-5.1# rpm -q virt-what
virt-what-1.25-5.el9.x86_64
sh-5.1# virt-what
crio
kvm

The 'crio' is printed as expected.

Comment 5 YongkuiGuo 2023-08-21 10:41:25 UTC
Hi Laszlo,

Could you help add this bug to the erratum? Thanks.

Comment 8 YongkuiGuo 2023-08-25 01:37:07 UTC
Ignore comment 5 as this bug has been added to erratum automatically.

Comment 9 YongkuiGuo 2023-08-25 01:40:21 UTC
Verified this bug per comment 1.

Comment 11 errata-xmlrpc 2023-11-07 08:56:22 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (virt-what bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2023:6704


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