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 1618916 - Grub lens cannot parse view entries after menu entries
Summary: Grub lens cannot parse view entries after menu entries
Keywords:
Status: CLOSED DUPLICATE of bug 1582236
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: augeas
Version: 7.5
Hardware: x86_64
OS: Linux
unspecified
unspecified
Target Milestone: pre-dev-freeze
: ---
Assignee: Pino Toscano
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-08-18 07:37 UTC by Guillaume Pavese
Modified: 2018-11-13 09:28 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-11-13 09:28:43 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
v2v log - import fails (823.25 KB, text/plain)
2018-08-18 07:37 UTC, Guillaume Pavese
no flags Details

Description Guillaume Pavese 2018-08-18 07:37:15 UTC
Created attachment 1476738 [details]
v2v log - import fails

I try to import a Centos 6.6 vm running on RHEL 5.11 Xen host. 
It fails with the following error in virt-v2v log (full log attached to this bug report):

installed kernel packages in this guest:
* kernel 2.6.32-504.el6.x86_64 (x86_64)
        /boot/vmlinuz-2.6.32-504.el6.x86_64
        /boot/initramfs-2.6.32-504.el6.x86_64.img
        /boot/config-2.6.32-504.el6.x86_64
        /lib/modules/2.6.32-504.el6.x86_64
        2022 modules found
        virtio: blk=true net=true
        xen=false debug=false
libguestfs: trace: v2v: aug_match "/files/boot/grub/grub.conf/title/kernel"
guestfsd: main_loop: proc 51 (command_lines) took 0.11 seconds
guestfsd: main_loop: new request, len 0x54
guestfsd: main_loop: proc 24 (aug_match) took 0.00 seconds
libguestfs: trace: v2v: aug_match = []
libguestfs: trace: v2v: aug_get "/files/boot/grub/grub.conf/default"
guestfsd: main_loop: new request, len 0x50
guestfsd: error: no matching node
guestfsd: main_loop: proc 19 (aug_get) took 0.00 seconds
libguestfs: trace: v2v: aug_get = NULL (error)
kernels offered by the bootloader in this guest (first in list is default):
virt-v2v: error: no kernels were found in the bootloader configuration.

This probably indicates that virt-v2v was unable to parse the bootloader 
configuration of this guest.
rm -rf '/var/tmp/null.O2ALYm'

---------------------------

- vm's xen config file : 
[root@ps-inf-int-xen-fr-301 ~]# cat /etc/xen/vs-int-prd-kib-fr-301 
name = "vs-int-prd-kib-fr-301"
uuid = "a7c484d3-87d2-55d5-f2e3-62f2d1424262"
maxmem = 2048
memory = 2048
vcpus = 1
builder = "hvm"
kernel = "/usr/lib/xen/boot/hvmloader"
boot = "c"
pae = 1
acpi = 1
apic = 1
localtime = 0
on_poweroff = "destroy"
on_reboot = "restart"
on_crash = "restart"
device_model = "/usr/lib64/xen/bin/qemu-dm"
usb = 1
usbdevice = "tablet"
disk = [ "file:/vm/vs-int-prd-kib-fr-301.img,hda,w" ]
vif = [ "mac=00:16:3e:1f:a6:85,bridge=xenbr0_8,script=vif-bridge",
	"mac=00:16:3e:1f:a6:86,bridge=xenbr0_40,script=vif-bridge",
	"mac=00:16:3e:1f:a6:87,bridge=xenbr0_50,script=vif-bridge",
	"mac=00:16:3e:1f:a6:8f,bridge=xenbr0_5,script=vif-bridge" ]
parallel = "none"
serial = "pty"
[root@ps-inf-int-xen-fr-301 ~]# 


- vm's fdisk -l :
[root@vs-int-prd-kib-fr-301 ~]# fdisk -l

Disk /dev/xvda: 41.9 GB, 41875931136 bytes
255 heads, 63 sectors/track, 5091 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0008d86c

    Device Boot      Start         End      Blocks   Id  System
/dev/xvda1   *           1          26      204800   83  Linux
Partition 1 does not end on cylinder boundary.
/dev/xvda2              26        2637    20971520   83  Linux
/dev/xvda3            2637        3420     6291456   83  Linux
/dev/xvda4            3420        5092    13425664    5  Extended
/dev/xvda5            3420        4073     5242880   83  Linux
/dev/xvda6            4073        4595     4194304   83  Linux
/dev/xvda7            4596        4857     2097152   82  Linux swap / Solaris
[root@vs-int-prd-kib-fr-301 ~]# 



- vm's grub :
[root@vs-int-prd-kib-fr-301 ~]# cat /boot/grub/grub.conf 
# 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/xvda3
#          initrd /initrd-[generic-]version.img
#boot=/dev/xvda
default=0
timeout=5
serial --unit=0 --speed=115200
terminal --timeout=5 serial console
title CentOS 6 (2.6.32-504.el6.x86_64)
	root (hd0,0)
	kernel /vmlinuz-2.6.32-504.el6.x86_64 ro root=UUID=1b9cb00b-2af5-4024-a973-3f1722e96013 rd_NO_LUKS  KEYBOARDTYPE=pc KEYTABLE=fr LANG=en_US.UTF-8 rd_NO_MD SYSFONT=latarcyrheb-sun16 crashkernel=auto console=tty0 rd_NO_LVM rd_NO_DM console=ttyS0,115200n8
	initrd /initramfs-2.6.32-504.el6.x86_64.img
serial --unit=0 --speed=115200 --word=8 --parity=no --stop=1
terminal --timeout=10 serial console
[root@vs-int-prd-kib-fr-301 ~]# 


- vm's fstab and device.map :
[root@vs-int-prd-kib-fr-301 ~]# cat /etc/fstab
# /etc/fstab
# Created by anaconda on Tue Jan 26 14:41:38 2016
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
UUID=1b9cb00b-2af5-4024-a973-3f1722e96013 /                       ext4    defaults        1 1
UUID=49520c76-0757-44ec-9423-945d60e121e2 /boot                   ext3    defaults        1 2
UUID=8af637c7-8243-4da6-851a-4aca442b11e8 /opt                    ext4    defaults        1 2
UUID=0328aae0-a874-40cc-b8e8-100ac35002c1 /tmp                    ext4    defaults        1 2
UUID=88b7a0f6-46ce-42b6-a58c-24c9ff0ba5b5 /var                    ext4    defaults        1 2
UUID=302aa2e3-f88b-4123-9613-838e0001d003 swap                    swap    defaults        0 0
tmpfs                   /dev/shm                tmpfs   defaults        0 0
devpts                  /dev/pts                devpts  gid=5,mode=620  0 0
sysfs                   /sys                    sysfs   defaults        0 0
proc                    /proc                   proc    defaults        0 0
[root@vs-int-prd-kib-fr-301 ~]# 

[root@vs-int-prd-kib-fr-301 ~]# cat /boot/grub/device.map 
# this device map was generated by anaconda
(hd0)     /dev/xvda
[root@vs-int-prd-kib-fr-301 ~]#

Comment 2 Pino Toscano 2018-08-20 08:35:36 UTC
(In reply to Guillaume Pavese from comment #0)
> libguestfs: trace: v2v: aug_match "/files/boot/grub/grub.conf/title/kernel"
> guestfsd: main_loop: proc 51 (command_lines) took 0.11 seconds
> guestfsd: main_loop: new request, len 0x54
> guestfsd: main_loop: proc 24 (aug_match) took 0.00 seconds
> libguestfs: trace: v2v: aug_match = []
> libguestfs: trace: v2v: aug_get "/files/boot/grub/grub.conf/default"
> guestfsd: main_loop: new request, len 0x50
> guestfsd: error: no matching node
> guestfsd: main_loop: proc 19 (aug_get) took 0.00 seconds
> libguestfs: trace: v2v: aug_get = NULL (error)
> kernels offered by the bootloader in this guest (first in list is default):
> virt-v2v: error: no kernels were found in the bootloader configuration.
> 
> This probably indicates that virt-v2v was unable to parse the bootloader 
> configuration of this guest.

This is correct, indeed augeas was not able to parse /boot/grub/grub.conf as also virt-v2v logs:

augeas failed to parse /boot/grub/grub.conf:
 error "Lenses @Grub and grub.lns could be used to load this file"
augeas failed to parse /boot/grub/menu.lst:
 error "Get did not match entire input" at line 18 char 0 in lens /usr/share/augeas/lenses/dist/grub.aug:286.14-287.43:
augeas failed to parse /etc/grub.conf:
 error "Get did not match entire input" at line 18 char 0 in lens /usr/share/augeas/lenses/dist/grub.aug:286.14-287.43:
augeas failed to parse /etc/security/limits.conf:
 error "Iterated lens matched less than it should" at line 53 char 16 in lens /usr/share/augeas/lenses/dist/limits.aug:66.17-.40:

> - vm's grub :
> [root@vs-int-prd-kib-fr-301 ~]# cat /boot/grub/grub.conf 
> # 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/xvda3
> #          initrd /initrd-[generic-]version.img
> #boot=/dev/xvda
> default=0
> timeout=5
> serial --unit=0 --speed=115200
> terminal --timeout=5 serial console
> title CentOS 6 (2.6.32-504.el6.x86_64)
> 	root (hd0,0)
> 	kernel /vmlinuz-2.6.32-504.el6.x86_64 ro
> root=UUID=1b9cb00b-2af5-4024-a973-3f1722e96013 rd_NO_LUKS  KEYBOARDTYPE=pc
> KEYTABLE=fr LANG=en_US.UTF-8 rd_NO_MD SYSFONT=latarcyrheb-sun16
> crashkernel=auto console=tty0 rd_NO_LVM rd_NO_DM console=ttyS0,115200n8
> 	initrd /initramfs-2.6.32-504.el6.x86_64.img
> serial --unit=0 --speed=115200 --word=8 --parity=no --stop=1
> terminal --timeout=10 serial console

The "problem" in this case are the last two lines, which are general configuration lines and not menu entries.
Commenting them, or simply moving them before the first "title", makes augeas able to parse it.
(Note that "serial", and "terminal" are actually duplicated...)
Can you please try to edit the grub.conf in the guest as I mentioned above?

I'm reassigning this bug to augeas in the meanwhile.

Comment 3 Guillaume Pavese 2018-08-20 13:13:18 UTC
Yes I confirm moving terminal and serial entries to the top (I also commented the redundant ones) did the trick.

This vm is successfully imported now.
Will that step be unnecessary if augeas can be fixed?

Thanks

Comment 4 Pino Toscano 2018-11-13 09:28:43 UTC
Similar case of bug 1582236: invalid grub.conf file that grub silently accepts anyway.

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


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