Bug 1230412

Summary: virt-v2v should ignore bogus kernel entries in grub config
Product: Red Hat Enterprise Linux 7 Reporter: Richard W.M. Jones <rjones>
Component: libguestfsAssignee: Richard W.M. Jones <rjones>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.1CC: juzhou, mxie, mzhan, ptoscano, tzheng, xiaodwan
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: V2V
Fixed In Version: libguestfs-1.28.1-1.50.el7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-11-19 07:01:50 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 Richard W.M. Jones 2015-06-10 20:38:03 UTC
Description of problem:

The attached virt-v2v log comes from a customer case where
a RHEL 6 guest has a /boot/grub/menu.lst file containing a
bogus kernel:

  title [...]
    kernel /vmlinuz-2.6.32-431.11.2.el6.x86_64.x86_64 [...]

This entry is the second entry in the grub config so it is
probably not used.

In this situation virt-v2v fails with:

virt-v2v: error: libguestfs error: statns: /boot/vmlinuz-2.6.32-431.11.2.el6.x86_64.x86_64: No such file or directory

It should instead warn on this but continue.

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

virt-v2v 1.28.1-1.18.el7.x86_64

How reproducible:

100%

Steps to Reproduce:
1. Create a RHEL 6 guest.
2. Add a second entry to /boot/grub/menu.lst which contains a
   bogus kernel.
3. Try to convert the guest using virt-v2v.

Reported by: James Mighion

Comment 3 Pino Toscano 2015-08-25 08:58:33 UTC
Fixed upstream with commits
649f439cb78f12bb04ef90d83b81e1fa23495852
baa4ec6e4536be971d482af76f7dca89e74573a7
74f0b45ddf35f1cb1684702e9d3318d77fc3b520 (the actual fix)

Comment 5 mxie@redhat.com 2015-09-01 08:13:46 UTC
Bug 1230412
I can reproduce the bug with build:
libguestfs-1.28.1-1.49.el7

Try to verify this bug with package:
libguestfs-1.28.1-1.50.el7

Steps:
1. Create a RHEL 6.7 guest, name:rhel6.7-mxie. 

2. Add a second entry to /boot/grub/menu.lst which contains a
    bogus kernel:
title [...]
    kernel /vmlinuz-2.6.32-431.11.2.el6.x86_64.x86_64 [...]

3. Try to convert the guest using virt-v2v. It is converted with warning as below
   # virt-v2v -o rhev -os 10.66.90.115:/vol/v2v_auto/nfs_export -b rhevm -n rhevm rhel6.7-mxie
[   0.0] Opening the source -i libvirt rhel6.7-mxie
[   0.0] Creating an overlay to protect the source from being modified
[   0.0] Opening the overlay
[  93.0] Initializing the target -o rhev -os 10.66.90.115:/vol/v2v_auto/nfs_export
virt-v2v: warning: cannot write files to the NFS server as 36:36, even 
though we appear to be running as root. This probably means the NFS client 
or idmapd is not configured properly.

You will have to chown the files that virt-v2v creates after the run, 
otherwise RHEV-M will not be able to import the VM.
[  93.0] Inspecting the overlay
[ 106.0] Checking for sufficient free disk space in the guest
[ 106.0] Estimating space required on target for each disk
[ 106.0] Converting Red Hat Enterprise Linux Server release 6.7 Beta (Santiago) to run on KVM
virt-v2v: warning: ignoring kernel 
/boot/vmlinuz-2.6.32-431.11.2.el6.x86_64.x86_64 in grub, as it does not 
exist.
virt-v2v: This guest has virtio drivers installed.
[ 182.0] Mapping filesystem data to avoid copying unused and blank areas
[ 183.0] Closing the overlay
[ 183.0] Checking if the guest needs BIOS or UEFI to boot
[ 183.0] Copying disk 1/1 to /tmp/v2v.gl0cdg/67f39ca5-5198-4da3-aad6-7d05451eee12/images/fb7a8568-4abb-40bb-8522-603ee9b62498/c5b3ea68-b40e-4422-837c-5ced4fb0037c (raw)
    (100.00/100%)
[ 244.0] Creating output metadata
[ 244.0] Finishing off


Result:
 RHEL6 guest could be converted but with warning 
 Move this bug from ON_QA to VERIFIED

Comment 7 errata-xmlrpc 2015-11-19 07:01:50 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/RHBA-2015-2183.html