Bug 1388407

Summary: virt-sysprep will fail detecting OS if "/usr" is a distinct partition mounted in "/" via fstab
Product: Red Hat Enterprise Linux 6 Reporter: Wu Siu Wa <siwu>
Component: libguestfsAssignee: Pino Toscano <ptoscano>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: unspecified Docs Contact: Yehuda Zimmerman <yzimmerm>
Priority: unspecified    
Version: 6.8CC: gchakkar, jherrman, ptoscano, rjones, xchen
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: libguestfs-1.20.11-20.el6 Doc Type: Bug Fix
Doc Text:
_libguestfs_ now identifies operating systems in virtual machines where `/usr/` is not in the same partition as `/` Previously, _libguestfs_ did not recognize guest operating systems where the `/usr/` directory was not in the same partition as `/`. As a result, _libguestfs_ tools such as *virt-sysprep* did not perform as expected. With this update, _libguestfs_ recognizes guest operating systems even when the `/usr/` directory is not located in the same partition as `/`. Consequently, _libguestfs_ tools such as *virt-sysprep* perform as expected.
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-03-21 08:56:21 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:
Bug Depends On: 1186935    
Bug Blocks:    
Attachments:
Description Flags
virt-sysprep -a -v output for the failed case. none

Description Wu Siu Wa 2016-10-25 09:32:25 UTC
Created attachment 1213796 [details]
virt-sysprep -a -v output for the failed case.

Description of problem:

This is a bug for RHEL6, which has the same issue with BZ 1318440.

Version-Release number of selected component (if applicable):
libguestfs-1.20.11-17.el6.x86_64

How reproducible:
1. Install a RHEL7 VM guest, in RHEL6 kvm host.
2. During installation, set `/usr` as a separated partition/LV.
3. Perform `virt-sysprep` in rhel6.


Actual results:
~~~
# virt-sysprep -a /home/vm/feichashao_RHEL72_ks_sysprep.qcow2
Examining the guest ...
virt-sysprep: no operating systems were found in the guest image
~~~

Expected results:
~~~
# virt-sysprep -a /home/vm/feichashao_RHEL72_ks_sysprep_nousr-corrupt.qcow2
Examining the guest ...
Performing "yum-uuid" ...
Performing "utmp" ...
Performing "udev-persistent-net" ...
Performing "tmp-files" ...
Performing "sssd-db-log" ...
Performing "ssh-userdir" ...
...........
~~~

Additional info:

1. Attached debug log of `virt-sysprep -a xxx -v` for the failed case.

2. Customer need to create/run RHEL7 guests on RHEL6 hosts, so customer need this tool to make templates.

Comment 1 Richard W.M. Jones 2016-10-25 10:03:54 UTC
Fixed in RHEL 7.3 (bug 1318440)

You can get the preview packages from

  https://people.redhat.com/~rjones/libguestfs-RHEL-7.3-preview/

or wait a few days for the official release.

For RHEL 6 (this bug) the patch seems backport-able.  I'll see
what Pino thinks because he is RHEL 6 maintainer.

Comment 4 Pino Toscano 2016-10-26 14:05:08 UTC
(In reply to Richard W.M. Jones from comment #1)
> For RHEL 6 (this bug) the patch seems backport-able.  I'll see
> what Pino thinks because he is RHEL 6 maintainer.

Yes, the patch for the inspection API is easy enough.

Comment 6 Xianghua Chen 2016-11-01 08:49:30 UTC
Verified with packages:
libguestfs-1.20.11-20.el6.x86_64

Verify steps:
1. On RHEL6 host ,install a RHEL7 VM guest(set `/usr` as a separated partition/LV during installation):
RHEL7.2-usr.img
2.
# virt-sysprep -a RHEL7.2-usr.img 
Examining the guest ...
Performing "yum-uuid" ...
Performing "utmp" ...
Performing "udev-persistent-net" ...
Performing "tmp-files" ...
Performing "sssd-db-log" ...
Performing "ssh-userdir" ...
Performing "ssh-hostkeys" ...
Performing "smolt-uuid" ...
Performing "script" ...
Performing "samba-db-log" ...
Performing "rpm-db" ...
Performing "rhn-systemid" ...
Performing "random-seed" ...
Performing "puppet-data-log" ...
Performing "password" ...
Performing "pam-data" ...
Performing "package-manager-cache" ...
Performing "pacct-log" ...
Performing "net-hwaddr" ...
Performing "net-hostname" ...
Performing "mail-spool" ...
Performing "machine-id" ...
Performing "logfiles" ...
Performing "hostname" ...
Performing "firstboot" ...
Performing "dovecot-data" ...
Performing "dhcp-server-state" ...
Performing "dhcp-client-state" ...
Performing "delete" ...
Performing "cron-spool" ...
Performing "crash-data" ...
Performing "blkid-tab" ...
Performing "bash-history" ...
Performing "abrt-data" ...
Performing "lvm-uuids" ...


So verified.

Comment 13 errata-xmlrpc 2017-03-21 08:56:21 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://rhn.redhat.com/errata/RHSA-2017-0564.html