Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 2137135

Summary: virt-sysprep fails to mount a Oracle Linux 8 XFS image
Product: Red Hat Enterprise Virtualization Manager Reporter: Christopher Pereira <kripper>
Component: libguestfsAssignee: Tomáš Golembiovský <tgolembi>
Status: CLOSED DUPLICATE QA Contact: Lukas Svaty <lsvaty>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: unspecified   
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-10-25 12:31:22 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:

Description Christopher Pereira 2022-10-23 18:07:25 UTC
Description of problem:

virt-sysprep fails to mount a Oracle Linux 8 XFS image


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

virt-sysprep 1.40.2rhel=7,release=10.el7,libvirt

How reproducible:

Easy/always

Steps to Reproduce:
1. Try with OL8 image

Actual results:

...
check_for_filesystem_on: /dev/ol/root (xfs)
command: mount '-o' 'ro' '/dev/ol/root' '/sysroot//'
[    2.104583] XFS (dm-1): Superblock has unknown read-only compatible features (0x4) enabled.
[    2.105796] XFS (dm-1): Superblock has unknown incompatible features (0x2) enabled.
[    2.105796] Filesystem can not be safely mounted by this kernel.
[    2.107599] XFS (dm-1): SB validate failed with error -22.
command: mount returned 32
command: mount: stderr:
mount: wrong fs type, bad option, bad superblock on /dev/mapper/ol-root,
       missing codepage or helper program, or other error

       In some cases useful info is found in syslog - try
       dmesg | tail or so.
inspect_os: fses:
inspect_get_roots: roots:
guestfsd: => inspect_os (0x1e0) took 0.52 secs
virt-sysprep: error: no operating systems were found in the guest image

Comment 1 Casper (RHV QE bot) 2022-10-23 18:30:40 UTC
This bug has low overall severity and is not going to be further verified by QE. If you believe special care is required, feel free to properly align relevant severity, flags and keywords to raise PM_Score or use one of the Bumps ('PrioBumpField', 'PrioBumpGSS', 'PrioBumpPM', 'PrioBumpQA') in Keywords to raise it's PM_Score above verification threashold (1000).

Comment 2 Christopher Pereira 2022-10-23 18:32:35 UTC
BTW, the host is RHEL7.
I have read that the RHEL7 kernel cannot mount a RHEL8 XFS fs, but isn't guestfish supposed to do this from a virtual environment?
Besides, the RHEL8 guest is running fine on the RHEL7 host so I don't understand why guestfish won't work.

Comment 3 Tomáš Golembiovský 2022-10-25 12:31:22 UTC
Yes, this is exactly the problem. libguestfs appliance uses same kernel as host (not guest kernel) which in your case is RHEL7 version. Please refer to KB[1] article for possible resolution.

[1] https://access.redhat.com/solutions/3914591

*** This bug has been marked as a duplicate of bug 1739583 ***

Comment 4 Christopher Pereira 2022-10-25 14:38:20 UTC
(In reply to Tomáš Golembiovský from comment #3)
> Yes, this is exactly the problem. libguestfs appliance uses same kernel as
> host (not guest kernel) which in your case is RHEL7 version.

Thanks.

Looks like a WON'T FIX, so there is still something I don't understand:

Why can't libguestfs support a different kernel (compatible with the guest) considering it's a virtual appliance (libguestfs is running inside a virtual machine, and a rhel8 VM runs fine on a rhel7 host)?

When sysprep'ing a window guest on a Linux host, isn't that the case too?
Well, maybe not, but anyway, a rhel7 should be able to mount and modify any guest filesystem using a compatible kernel/OS.

Comment 5 Tomáš Golembiovský 2022-10-26 07:18:00 UTC
> Why can't libguestfs support a different kernel (compatible with the guest)
> considering it's a virtual appliance (libguestfs is running inside a virtual
> machine, and a rhel8 VM runs fine on a rhel7 host)?

This is described in the KB article. It is possible to use fixed appliance from libguestfs upstream. As far as I know there is no fixed appliance distributed downstream. However, it may be tricky to convince RHV to actually use the appliance. I don't know if there is any documentation for that.