RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1219216 - virt-v2v fails to match kernel line in grub.conf
Summary: virt-v2v fails to match kernel line in grub.conf
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: augeas
Version: 6.6
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: rc
: ---
Assignee: Dominic Cleal
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-05-06 20:29 UTC by Dylan Gross
Modified: 2019-06-13 08:28 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 1239053 (view as bug list)
Environment:
Last Closed: 2015-07-03 11:40:18 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Knowledge Base (Solution) 1436363 0 None None None Never

Description Dylan Gross 2015-05-06 20:29:54 UTC
Description of problem:

   augeas tool fails to find the kernel line in /boot/grub/grub.conf if unexpected console lines are present when trying to virt-v2v a guest

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

   virt-v2v-0.9.1-5.el6_5.x86_64

How reproducible:  Always

   
Steps to Reproduce:
1.  *note:  This was encountered by customer extracting a VM from an ESX environment, and adding it to a RHEV 3.5 environment, but from what I see that shouldn't matter and I was able to reproduce it by extracting a local kvm guest.

2.  Add the "serial" and "terminal" lines to the grub.conf of a VM guest to be converted.  (Examples at the bottom of this post)

3.  Attempt a virt-v2v of that VM guest:
Example:
# virt-v2v -ic qemu:///session -o rhev -os myrhev.redhat.com:/exportdomain --network rhevm kvmr6n1 


Actual results:

virt-v2v fails with the following two lines in the virt-v2v.log:

virtio configured, but no virtio kernel found at /usr/share/perl5/vendor_perl/Sys/VirtConvert/Converter/RedHat.pm line 1007.
virt-v2v: Transferring storage volume New Virtual Machine_New Virtual Machine: 161061273600 bytes


Expected results:

  Successfully create the VM for import (in this case in the RHEV 3.5 export domain.

Additional info:


Notes from support case is that one of the aug_match() calls in /usr/share/perl5/vendor_perl/Sys/VirtConvert/Converter/RedHat.pm is having problems with those two lines"


"The problem seems the be the augeas tool:

/usr/share/perl5/vendor_perl/Sys/VirtConvert/Converter/RedHat.pm:
...
 141 sub list_kernels
...
 150     # Look for a kernel, starting with the default
 151     my @paths = eval {
 152         # Get a list of all kernels
 153         my @ret = $g->aug_match("/files$grub_conf/title/kernel");

We use aug_match which does not return the value. The problem is the two lines
related to the serial console

    serial -unit=0  -speed=115200 
    terminal -timeout=10 serial console   
"


Example grub.conf with the "serial" and "terminal" lines....

# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE:  You have a /boot partition.  This means that
#          all kernel and initrd paths are relative to /boot/, eg.
#          root (hd0,0)
#          kernel /vmlinuz-version ro root=/dev/mapper/vg00-lv_root
#          initrd /initrd-[generic-]version.img
#boot=/dev/sda
serial -unit=0 -speed=115200
terminal -timeout=10 serial console
default=0
timeout=10
#splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title Red Hat Enterprise Linux Server (2.6.32-220.23.1.el6.x86_64)
root (hd0,0)
kernel /vmlinuz-2.6.32-220.23.1.el6.x86_64 ro root=/dev/mapper/vg00-lv_root 
	initrd /initramfs-2.6.32-220.23.1.el6.x86_64.img

Comment 2 Dominic Cleal 2015-05-07 09:40:45 UTC
(In reply to Dylan Gross from comment #0)
> We use aug_match which does not return the value. The problem is the two
> lines
> related to the serial console
> 
>     serial -unit=0  -speed=115200 
>     terminal -timeout=10 serial console   
> "

Are these actually valid and working configuration directives?

The documentation suggests it must be two hyphens, not one:

https://www.gnu.org/software/grub/manual/legacy/Serial-terminal.html
https://www.gnu.org/software/grub/manual/legacy/serial.html
https://www.gnu.org/software/grub/manual/legacy/terminal.html

I see nothing there to suggest that "-unit=0" is valid.

Comment 3 Dominic Cleal 2015-05-07 11:05:03 UTC
Checked the GRUB 0.97 source code too, and it doesn't parse options with only one hyphen, which makes me believe this is a configuration error.  Augeas generally only tries to parse valid configs, not be tolerant of errors.

Comment 4 Dylan Gross 2015-05-28 13:56:58 UTC
Customer confirmed that we he did remedy those incorrect arguments with double-hyphens, the virt-v2v no longer failed.  If that is the intended behaviour of augeas when parsing, then this is probably "NOTABUG".   

Perhaps the error about not being able to match a kernel line could be more specific about failing on a different line.  Or maybe not.  I don't know enough about how the parsing is being done to know if it can get that granular.

Comment 5 Dominic Cleal 2015-05-28 14:05:04 UTC
(In reply to Dylan Gross from comment #4)
> Customer confirmed that we he did remedy those incorrect arguments with
> double-hyphens, the virt-v2v no longer failed.  If that is the intended
> behaviour of augeas when parsing, then this is probably "NOTABUG".   

Indeed.

> Perhaps the error about not being able to match a kernel line could be more
> specific about failing on a different line.  Or maybe not.  I don't know
> enough about how the parsing is being done to know if it can get that
> granular.

Yeah, it looks like virt-v2v isn't showing that Augeas hasn't managed to parse the file.  It should be possible to report Augeas' own error output (from /augeas//error), like we did here for netcf: https://lists.fedorahosted.org/pipermail/netcf-devel/2014-September/000907.html

or Puppet: https://github.com/puppetlabs/puppet/blob/4.1.0/lib/puppet/provider/augeas/augeas.rb#L327-L354

I don't know whether you'd prefer to move this bug or recreate one against v2v.


Note You need to log in before you can comment on or make changes to this bug.