Bug 2155233
Summary: | Virt-what does not return correct result when running inside a container using podman | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | Red Hat Enterprise Linux 8 | Reporter: | Alessandro Valentini <alessandro.valentini> | ||||||
Component: | virt-what | Assignee: | Richard W.M. Jones <rjones> | ||||||
Status: | CLOSED ERRATA | QA Contact: | YongkuiGuo <yoguo> | ||||||
Severity: | medium | Docs Contact: | |||||||
Priority: | unspecified | ||||||||
Version: | 8.7 | CC: | palo.simo, qzhang, rjones, virt-maint, ymao | ||||||
Target Milestone: | rc | Keywords: | Triaged | ||||||
Target Release: | --- | ||||||||
Hardware: | All | ||||||||
OS: | Linux | ||||||||
Whiteboard: | |||||||||
Fixed In Version: | virt-what-1.25-2.el8 | Doc Type: | If docs needed, set a value | ||||||
Doc Text: | Story Points: | --- | |||||||
Clone Of: | |||||||||
: | 2158431 (view as bug list) | Environment: | |||||||
Last Closed: | 2023-05-16 09:11:18 UTC | Type: | Bug | ||||||
Regression: | --- | Mount Type: | --- | ||||||
Documentation: | --- | CRM: | |||||||
Verified Versions: | Category: | --- | |||||||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||||
Cloudforms Team: | --- | Target Upstream Version: | |||||||
Embargoed: | |||||||||
Bug Depends On: | |||||||||
Bug Blocks: | 2158431 | ||||||||
Attachments: |
|
Hi, Alessandro I can not reproduce this issue with the following steps: On my rhel8.8 host: # podman pull ubi8/ubi-init:8.7 # podman run -it ubi8/ubi-init:8.7 /bin/bash [root@fa4c3c1ba2a1 /]# virt-what podman [root@fa4c3c1ba2a1 /]# rpm -q virt-what virt-what-1.25-1.el8.x86_64 The output of virt-what is podman. I think it's expected according to the man page. # man virt-what ... podman This is a Podman container. Is there anything I missed? Definitely going to need exact steps to reproduce this, so setting needinfo. Created attachment 1934858 [details]
container subscribed as physical system
We face this issue on Fedora 37 with podman, which we use as development. Environment # podman --version podman version 4.3.1 # cat /etc/redhat-release Fedora release 37 (Thirty Seven) Steps to reproduce Run the container: # podman pull ubi8/ubi-init:8.7 # podman run -it ubi8/ubi-init:8.7 /bin/bash Inside the container [root@96d2e63f6cd9 /]# virt-what [root@96d2e63f6cd9 /]# echo $? 0 [root@96d2e63f6cd9 /]# subscription-manager status +-------------------------------------------+ System Status Details +-------------------------------------------+ Overall Status: Unknown System Purpose Status: Unknown If we subscribe the container it is recognized as physical system. (In reply to Alessandro Valentini from comment #5) > We face this issue on Fedora 37 with podman, which we use as development. > > Environment > # podman --version > podman version 4.3.1 > # cat /etc/redhat-release > Fedora release 37 (Thirty Seven) > > Steps to reproduce > > Run the container: > # podman pull ubi8/ubi-init:8.7 > # podman run -it ubi8/ubi-init:8.7 /bin/bash > > Inside the container > [root@96d2e63f6cd9 /]# virt-what > [root@96d2e63f6cd9 /]# echo $? > 0 > [root@96d2e63f6cd9 /]# subscription-manager status > +-------------------------------------------+ > System Status Details > +-------------------------------------------+ > Overall Status: Unknown > System Purpose Status: Unknown > > If we subscribe the container it is recognized as physical system. Thanks. I can reproduce this issue with the following steps: On Fedora 37 host: # cat /etc/redhat-release Fedora release 37 (Thirty Seven) # podman --version podman version 4.3.1 # podman pull ubi8/ubi-init:8.7 # podman run -it ubi8/ubi-init:8.7 /bin/bash Inside the container: [root@2df77826f101 /]# virt-what [root@2df77826f101 /]# rpm -q virt-what virt-what-1.25-1.el8.x86_64 [root@2df77826f101 /]# cat "/proc/1/environ" | tr '\000' '\n' | grep container container=oci After applying your patch in the attachment: [root@2df77826f101 /]# virt-what oci *** Bug 2077879 has been marked as a duplicate of this bug. *** Fixed upstream in: http://git.annexia.org/?p=virt-what.git;a=commit;h=54c2ad4a764658ec8a9aadc52c749eabf1de73a0 Tested with the virt-what-1.25-2.el8.x86_64 package: On Fedora 37 host: # cat /etc/redhat-release Fedora release 37 (Thirty Seven) # podman --version podman version 4.3.1 # podman pull ubi8/ubi-init:8.7 # podman run -it ubi8/ubi-init:8.7 /bin/bash Inside the container: [root@1919a2d450bc ~]# virt-what oci [root@1919a2d450bc ~]# rpm -q virt-what virt-what-1.25-2.el8.x86_64 Verified this bug per comment 9. 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:3033 |
Created attachment 1933763 [details] Add oci environment to virt-what cases Description of problem: When running a ubi8/ubi-init:8.7 container using podman virt-what does not detect that RHEL is running inside a container when we try to register the system using the subscription manager the system is registered as physical machine. Version-Release number of selected component (if applicable): This behavior does not happen on ubi8/ubi-init:8.7 container. IT happens only using virt-what 1.25 How reproducible: run a ubi8/ubi-init:8.7 using podman and execute virt-what Steps to Reproduce: 1.Start a ubi8/ubi-init:8.7 2.Run virt-what Actual results: #virt-what returns empty output and return code 0 Expected results: #virt-what oci returns oci (or other container engine) and return code 0 Additional info: This behavior happens only using podman, the container workss properly using docker-ce. A patch for the issue is attached, it simply adds oci among other possible options.