Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
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 1770981

Summary: RHEL 7.7 (RHVH) virt-v2v: error: no kernels were found in the bootloader configuration.
Product: Red Hat Enterprise Linux 7 Reporter: adam.maynard
Component: libguestfsAssignee: Richard W.M. Jones <rjones>
Status: CLOSED DUPLICATE QA Contact: Virtualization Bugs <virt-bugs>
Severity: high Docs Contact:
Priority: unspecified    
Version: 7.7CC: ptoscano
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-11-11 18:09:22 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
virt-v2v command console output none

Description adam.maynard 2019-11-11 16:13:25 UTC
Created attachment 1634942 [details]
virt-v2v command console output

Description of problem:

Not able to convert VM's/OVA's/VMDK's from ESXi 6.5u3 to Red Hat Virtualization.


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

Red Hat Virtualization Host 4.3.6 (el7.7)
Kernel: 3.10.0-1062.4.1.el7.x86_64

How reproducible:


Steps to Reproduce:
1. Export OVA from VMWare
2. Import with RHVH:
"virt-v2v -x -v -i ova /Exported.ova -o rhv-upload -oc https://virt-engine.host.com/ovirt-engine/api -os ovirt-data -op /tmp/ovirt-admin-password -of qcow2 --compressed -oo rhv-cafile=/root/ca.pem -oo rhv-direct --bridge ovirtmgmt"
OR
"virt-v2v -x -v -i ova /Exported.ova -o rhev -os ovirt-engine:/exports/data -of qcow2 --compressed"
3.

Actual results:

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.

(See full log attached)

Expected results:

Success

Additional info:

Tried removing "boot" entry from grub config

Comment 2 Richard W.M. Jones 2019-11-11 16:22:26 UTC
There's a problem parsing /boot/grub/grub.conf from the guest.  It's not
immediately clear what it is, but if you can attach this file from the
guest it may be possible to see.

Also it'd be interesting to know which version of augeas you are using
(on the host).

Comment 3 adam.maynard 2019-11-11 16:29:35 UTC
Tried with:
libguestfs-1.40.2-5.el7_7.2.x86_64.rpm and libguestfs-1.40.2-8.el7.x86_64

augeas-1.4.0-9.el7.x86_64.rpm


Tried making a /boot/grub/grub.conf symlink to /boot/grub2/grub.cfg

Same results.


Is there a way to create a grub1 config file at /boot/grub/grub.conf?

Comment 4 Richard W.M. Jones 2019-11-11 16:45:17 UTC
This isn't a problem with the file that needs to be fixed, but with the
contents of the file that virt-v2v cannot parse.  Please attach the
original contents of /boot/grub/grub.conf from the guest.

Comment 5 Pino Toscano 2019-11-11 16:50:07 UTC
(In reply to adam.maynard from comment #3)
> Tried making a /boot/grub/grub.conf symlink to /boot/grub2/grub.cfg
> 
> Same results.

The guest is SUSE 12.3, which has grub 1.  Hence, symlinking the grub 1 to the grub 2 location/naming will not work (and actually it will be worse, in case virt-v2v detects that the guest uses grub 2 while it actually does not).

In the guest there are two grub 1 configuration files, /boot/grub/grub.conf and /boot/grub/menu.lst, and both of them cannot be parsed. Actually, since the error is the same, it makes me think that one is either the copy of or a symlink to the other.

As Rich said, we need any of them to check why they cannot be parsed.

Comment 6 adam.maynard 2019-11-11 17:47:35 UTC
(In reply to Richard W.M. Jones from comment #4)
> This isn't a problem with the file that needs to be fixed, but with the
> contents of the file that virt-v2v cannot parse.  Please attach the
> original contents of /boot/grub/grub.conf from the guest.

The guest actually has grub2 installed, but residual files from an old grub1 install

/boot/grub/grub.conf:

timeout 10
gfxmenu (hd0,0)/boot/message
title RSA Authentication Manager 8.4 _[_VMX_]
 kernel (hd0,0)/boot/linux.upgrade root=/dev/sda1 disk=/dev/sda upgrade=1 autoupgrade=1 namescheme= autoyast=file:///mnt1/autoinst.xml install=hd:/RSA_SLES12_SP3.iso splash=silent quiet show Textmode=1 nomodeset dud=hd:/am_upgrade.dud
 initrd (hd0,0)/boot/initrd.upgrade

title RSA_Authentication_Manager_[_VMX_]
 kernel (hd0,0)/boot/vmlinuz-3.0.101-108.18-default root=/dev/sda1 disk=/dev/sda  vga=0x314   quiet showopts
 initrd (hd0,0)/boot/initrd-3.0.101-108.18-default
title Failsafe_--_RSA_Authentication_Manager_[_VMX_]
 kernel (hd0,0)/boot/vmlinuz-3.0.101-108.18-default root=/dev/sda1 disk=/dev/sda  vga=0x314   ide=nodma apm=off noresume edd=off powersaved=off nohz=off highres=off processsor.max+cstate=1 nomodeset x11failsafe quiet showopts
 initrd (hd0,0)/boot/initrd-3.0.101-108.18-default



/boot/grub2/grub.cfg:

#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub2-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#

### BEGIN /etc/grub.d/00_header ###
if [ -f ${config_directory}/grubenv ]; then
  load_env -f ${config_directory}/grubenv
elif [ -s $prefix/grubenv ]; then
  load_env
fi

if [ "${env_block}" ] ; then
  load_env -f "${env_block}"
fi

if [ "${next_entry}" ] ; then
   set default="${next_entry}"
   set next_entry=
   save_env next_entry
   if [ "${env_block}" ] ; then
     save_env -f "${env_block}" next_entry
   fi
   set boot_once=true
else
   set default="${saved_entry}"
fi

if [ x"${feature_menuentry_id}" = xy ]; then
  menuentry_id_option="--id"
else
  menuentry_id_option=""
fi

export menuentry_id_option

if [ "${prev_saved_entry}" ]; then
  set saved_entry="${prev_saved_entry}"
  save_env saved_entry
  set prev_saved_entry=
  save_env prev_saved_entry
  set boot_once=true
fi

function savedefault {
  if [ -z "${boot_once}" ]; then
    saved_entry="${chosen}"
    save_env saved_entry
    if [ "${env_block}" ] ; then
      save_env -f "${env_block}" saved_entry
    fi

  fi
}

function load_video {
  if [ x$feature_all_video_module = xy ]; then
    insmod all_video
  else
    insmod efi_gop
    insmod efi_uga
    insmod ieee1275_fb
    insmod vbe
    insmod vga
    insmod video_bochs
    insmod video_cirrus
  fi
}

if [ x$feature_default_font_path = xy ] ; then
   font=unicode
else
insmod part_msdos
insmod ext2
set root='hd0,msdos1'
if [ x$feature_platform_search_hint = xy ]; then
  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 --hint='hd0,msdos1'  1891e641-197c-4abf-9769-d40627a6f132
else
  search --no-floppy --fs-uuid --set=root 1891e641-197c-4abf-9769-d40627a6f132
fi
    font="/usr/share/grub2/unicode.pf2"
fi

if loadfont $font ; then
  set gfxmode=auto
  load_video
  insmod gfxterm
  set locale_dir=$prefix/locale
  set lang=en_US
  insmod gettext
fi
terminal_output gfxterm
insmod part_msdos
insmod ext2
set root='hd0,msdos1'
if [ x$feature_platform_search_hint = xy ]; then
  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 --hint='hd0,msdos1'  1891e641-197c-4abf-9769-d40627a6f132
else
  search --no-floppy --fs-uuid --set=root 1891e641-197c-4abf-9769-d40627a6f132
fi
insmod gfxmenu
loadfont ($root)/boot/grub2/themes/SLE/ascii.pf2
loadfont ($root)/boot/grub2/themes/SLE/DejaVuSans10.pf2
loadfont ($root)/boot/grub2/themes/SLE/DejaVuSans12.pf2
loadfont ($root)/boot/grub2/themes/SLE/DejaVuSans-Bold14.pf2
insmod png
set theme=($root)/boot/grub2/themes/SLE/theme.txt
export theme
if [ x${boot_once} = xtrue ]; then
  set timeout=0
elif [ x$feature_timeout_style = xy ] ; then
  set timeout_style=menu
  set timeout=8
# Fallback normal timeout code in case the timeout_style feature is
# unavailable.
else
  set timeout=8
fi
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/10_linux ###
menuentry 'SLES 12-SP3'  --class sles --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-1891e641-197c-4abf-9769-d40627a6f132' {
        load_video
        set gfxpayload=keep
        insmod gzio
        insmod part_msdos
        insmod ext2
        set root='hd0,msdos1'
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 --hint='hd0,msdos1'  1891e641-197c-4abf-9769-d40627a6f132
        else
          search --no-floppy --fs-uuid --set=root 1891e641-197c-4abf-9769-d40627a6f132
        fi
        echo    'Loading Linux 4.4.176-94.88-default ...'
        linux   /boot/vmlinuz-4.4.176-94.88-default root=UUID=1891e641-197c-4abf-9769-d40627a6f132  disk=/dev/sda quiet show nomodeset resume=/dev/sdb1 splash=silent quiet showopts
        echo    'Loading initial ramdisk ...'
        initrd  /boot/initrd-4.4.176-94.88-default
}
submenu 'Advanced options for SLES 12-SP3' --hotkey=1 $menuentry_id_option 'gnulinux-advanced-1891e641-197c-4abf-9769-d40627a6f132' {
        menuentry 'SLES 12-SP3, with Linux 4.4.176-94.88-default' --hotkey=2 --class sles --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.4.176-94.88-default-advanced-1891e641-197c-4abf-9769-d40627a6f132' {
                load_video
                set gfxpayload=keep
                insmod gzio
                insmod part_msdos
                insmod ext2
                set root='hd0,msdos1'
                if [ x$feature_platform_search_hint = xy ]; then
                  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 --hint='hd0,msdos1'  1891e641-197c-4abf-9769-d40627a6f132
                else
                  search --no-floppy --fs-uuid --set=root 1891e641-197c-4abf-9769-d40627a6f132
                fi
                echo    'Loading Linux 4.4.176-94.88-default ...'
                linux   /boot/vmlinuz-4.4.176-94.88-default root=UUID=1891e641-197c-4abf-9769-d40627a6f132  disk=/dev/sda quiet show nomodeset resume=/dev/sdb1 splash=silent quiet showopts
                echo    'Loading initial ramdisk ...'
                initrd  /boot/initrd-4.4.176-94.88-default
        }
        menuentry 'SLES 12-SP3, with Linux 4.4.176-94.88-default (recovery mode)' --hotkey=3 --class sles --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.4.176-94.88-default-recovery-1891e641-197c-4abf-9769-d40627a6f132' {
                load_video
                set gfxpayload=keep
                insmod gzio
                insmod part_msdos
                insmod ext2
                set root='hd0,msdos1'
                if [ x$feature_platform_search_hint = xy ]; then
                  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 --hint='hd0,msdos1'  1891e641-197c-4abf-9769-d40627a6f132
                else
                  search --no-floppy --fs-uuid --set=root 1891e641-197c-4abf-9769-d40627a6f132
                fi
                echo    'Loading Linux 4.4.176-94.88-default ...'
                linux   /boot/vmlinuz-4.4.176-94.88-default root=UUID=1891e641-197c-4abf-9769-d40627a6f132
                echo    'Loading initial ramdisk ...'
                initrd  /boot/initrd-4.4.176-94.88-default
        }
        menuentry 'SLES 12-SP3, with Linux 4.4.156-94.64-default'  --class sles --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.4.156-94.64-default-advanced-1891e641-197c-4abf-9769-d40627a6f132' {
                load_video
                set gfxpayload=keep
                insmod gzio
                insmod part_msdos
                insmod ext2
                set root='hd0,msdos1'
                if [ x$feature_platform_search_hint = xy ]; then
                  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 --hint='hd0,msdos1'  1891e641-197c-4abf-9769-d40627a6f132
                else
                  search --no-floppy --fs-uuid --set=root 1891e641-197c-4abf-9769-d40627a6f132
                fi
                echo    'Loading Linux 4.4.156-94.64-default ...'
                linux   /boot/vmlinuz-4.4.156-94.64-default root=UUID=1891e641-197c-4abf-9769-d40627a6f132  disk=/dev/sda quiet show nomodeset resume=/dev/sdb1 splash=silent quiet showopts
                echo    'Loading initial ramdisk ...'
                initrd  /boot/initrd-4.4.156-94.64-default
        }
        menuentry 'SLES 12-SP3, with Linux 4.4.156-94.64-default (recovery mode)' --hotkey=1 --class sles --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.4.156-94.64-default-recovery-1891e641-197c-4abf-9769-d40627a6f132' {
                load_video
                set gfxpayload=keep
                insmod gzio
                insmod part_msdos
                insmod ext2
                set root='hd0,msdos1'
                if [ x$feature_platform_search_hint = xy ]; then
                  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 --hint='hd0,msdos1'  1891e641-197c-4abf-9769-d40627a6f132
                else
                  search --no-floppy --fs-uuid --set=root 1891e641-197c-4abf-9769-d40627a6f132
                fi
                echo    'Loading Linux 4.4.156-94.64-default ...'
                linux   /boot/vmlinuz-4.4.156-94.64-default root=UUID=1891e641-197c-4abf-9769-d40627a6f132
                echo    'Loading initial ramdisk ...'
                initrd  /boot/initrd-4.4.156-94.64-default
        }
}

### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/20_linux_xen ###

### END /etc/grub.d/20_linux_xen ###

### BEGIN /etc/grub.d/20_memtest86+ ###
### END /etc/grub.d/20_memtest86+ ###

### BEGIN /etc/grub.d/30_os-prober ###
### END /etc/grub.d/30_os-prober ###

### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.
### END /etc/grub.d/40_custom ###

### BEGIN /etc/grub.d/41_custom ###
if [ -f  ${config_directory}/custom.cfg ]; then
  source ${config_directory}/custom.cfg
elif [ -z "${config_directory}" -a -f  $prefix/custom.cfg ]; then
  source $prefix/custom.cfg;
fi
### END /etc/grub.d/41_custom ###

### BEGIN /etc/grub.d/90_persistent ###
### END /etc/grub.d/90_persistent ###

### BEGIN /etc/grub.d/95_textmode ###
### END /etc/grub.d/95_textmode ###






would deleting /boot/grub/grub.conf from the guest be the way to go?

Comment 7 Richard W.M. Jones 2019-11-11 18:09:22 UTC
I see processsor.max+cstate=1 on line 11, so I think it's a duplicate of
https://bugzilla.redhat.com/show_bug.cgi?id=1758357

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

Comment 8 Richard W.M. Jones 2019-11-11 18:12:47 UTC
BTW you can probably hack the fix into /usr/share/augeas/lenses/dist/grub.aug:
https://github.com/hercules-team/augeas/commit/2ba77589baee1bf2d43d3a49f8e6f3eb522e5bba#diff-fcca520f6a297eeea23440f432f4e6ad

> would deleting /boot/grub/grub.conf from the guest be the way to go?

Why does this guest have grub and grub2 configurations?  Virt-v2v thinks this
is a grub1 guest and is reading the bootloader configuration from there.

Comment 9 adam.maynard 2019-11-12 19:11:14 UTC
I'm not sure why it had residual grub1 files.

manually patching those .aug files, removing /boot/grub/grub.conf from the guest, and re-exporting the ova worked for me. Thanks Richard