Bug 1602353

Summary: virt-inspector can't inspect LUKS-encrypted RHEL7 guest image
Product: Red Hat Enterprise Linux 7 Reporter: Xianghua Chen <xchen>
Component: libguestfsAssignee: Richard W.M. Jones <rjones>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.6CC: ptoscano
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: libguestfs-1.38.2-10.el7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-10-30 07:47:00 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:
Attachments:
Description Flags
log.virt-inspector.rhel7-luks none

Description Xianghua Chen 2018-07-18 09:17:29 UTC
Created attachment 1459677 [details]
log.virt-inspector.rhel7-luks

Description of problem:
virt-inspector can't inspect LUKS-encrypted RHEL7 guest image

Version-Release number of selected component (if applicable):
libguestfs-1.38.2-7.el7.x86_64

How reproducible:
100%

Steps:
1.Prepare a LUKS-encrypted RHEL7 guest image:
rhel7.6-LUKS.qcow2

2.
$ echo REDHAT | virt-inspector -a rhel7.6-LUKS.qcow2  --keys-from-stdin 
<?xml version="1.0"?>
<operatingsystems/>


Please check the -v -x log in attachment.


Actual results:
Failed to inspect luks image.

Expected results:
Can inspect luks image successfully.


Additional info:
virt-tail, virt-get-kernel... with luks image also failed.
on rhel8, it's ok.

Comment 1 Richard W.M. Jones 2018-07-18 11:32:55 UTC
Interesting that the LUKS command to open the encrypted
partition doesn't fail, yet the subsequent vgscan returns
nothing.  I wonder a few things:

(1) Kernel prints an odd message which might be relevant:

[   25.558293] alg: No test for fips(ansi_cprng) (fips_ansi_cprng)

(2) I discovered recently that the commands to rescan PVs
have changed.  Also maybe our use of lvmetad changed things too.
See:

https://github.com/libguestfs/libguestfs/commit/dd162d2cd56a2ecf4bcd40a7f463940eaac875b8

But I agree this is clearly a regression.

Comment 2 Richard W.M. Jones 2018-07-18 11:34:09 UTC
Also we don't have a regression test upstream for this but
clearly we should do.

Comment 3 Richard W.M. Jones 2018-07-18 13:37:54 UTC
Patch series posted:
https://www.redhat.com/archives/libguestfs/2018-July/msg00039.html

Comment 6 Xianghua Chen 2018-07-31 03:06:00 UTC
Verified with package:
libguestfs-1.38.2-10.el7.x86_64

Steps:
1.Prepare a LUKS-encrypted RHEL7 guest image:
rhel7.6-LUKS.qcow2

2.
# echo REDHAT | virt-inspector -a rhel7.6-LUKS.qcow2  --keys-from-stdin 
<?xml version="1.0"?>
<operatingsystems>
  <operatingsystem>
    <root>/dev/rhel/root</root>
    <name>linux</name>
    <arch>x86_64</arch>
    <distro>rhel</distro>
    <product_name>Red Hat Enterprise Linux Server 7.6 Beta (Maipo)</product_name>
    <major_version>7</major_version>
    <minor_version>6</minor_version>
    <package_format>rpm</package_format>
    <package_management>yum</package_management>
    <hostname>localhost.localdomain</hostname>
    <osinfo>rhel7.6</osinfo>
    <mountpoints>
      <mountpoint dev="/dev/rhel/root">/</mountpoint>
      <mountpoint dev="/dev/sda1">/boot</mountpoint>
    </mountpoints>
    <filesystems>
... ...

Comment 8 errata-xmlrpc 2018-10-30 07:47:00 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, 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/RHEA-2018:3021