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 1152369 - virt-v2v failed to convert RHEL 6.7 UEFI guest: no grub1/grub-legacy or grub2 configuration file was found
Summary: virt-v2v failed to convert RHEL 6.7 UEFI guest: no grub1/grub-legacy or grub2...
Keywords:
Status: CLOSED DEFERRED
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libguestfs
Version: 7.1
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: ---
Assignee: Richard W.M. Jones
QA Contact: Virtualization Bugs
URL:
Whiteboard: V2V
: 1368008 (view as bug list)
Depends On:
Blocks: 1288337 1401400 1473046 1558351
TreeView+ depends on / blocked
 
Reported: 2014-10-14 02:59 UTC by zhoujunqin
Modified: 2018-11-06 12:29 UTC (History)
16 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-11-06 12:29:08 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
guest's xml file (3.86 KB, text/plain)
2014-10-14 02:59 UTC, zhoujunqin
no flags Details
virt-v2v debug info (127.31 KB, text/plain)
2014-10-14 03:00 UTC, zhoujunqin
no flags Details
rhel6u7rc1.2-OVMF.deubg (132.04 KB, text/plain)
2015-07-07 10:00 UTC, zhoujunqin
no flags Details
virt-v2v-conversion-log.txt from a failed RHEL 6.8 UEFI conversion (949.86 KB, text/plain)
2016-08-18 08:11 UTC, Richard W.M. Jones
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1112275 1 None None None 2023-03-24 13:29:13 UTC
Red Hat Bugzilla 1184690 1 None None None 2021-01-20 06:05:38 UTC

Internal Links: 1112275 1184690

Description zhoujunqin 2014-10-14 02:59:45 UTC
Created attachment 946642 [details]
guest's xml file

Description of problem:
virt-v2v failed to convert guest with UEFI firmware

Version-Release number of selected component (if applicable):
OVMF-20140822-1.git9ece15a.el7test.x86_64
libvirt-1.2.8-5.el7.x86_64
virt-install-1.1.0-4.el7.noarch
libguestfs-1.27.62-1.1.el7.x86_64
virt-v2v-1.27.62-1.1.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
1. Prepare a guest with UEFI firmware
# virsh dumpxml uefi
...
  <os>
    <type arch='x86_64' machine='pc-i440fx-rhel7.1.0'>hvm</type>
    <loader readonly='yes' type='pflash'>/usr/share/OVMF/OVMF_CODE.fd</loader>
    <nvram>/var/lib/libvirt/qemu/nvram/uefi_VARS.fd</nvram>
    <boot dev='hd'/>
  </os>
...

2. Use virt-v2v command convert guest 'uefi' to rhevm server:
# virt-v2v -o rhev -os 10.66.90.115:/vol/v2v_auto/auto_export --network rhevm uefi
[   0.0] Opening the source -i libvirt uefi
[   0.0] Creating an overlay to protect the source from being modified
[   0.0] Opening the overlay
[   2.0] Initializing the target -o rhev -os 10.66.90.115:/vol/v2v_auto/auto_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.
[   2.0] Inspecting the overlay
[  10.0] Checking for sufficient free disk space in the guest
[  10.0] Estimating space required on target for each disk
[  10.0] Converting Red Hat Enterprise Linux Server release 6.6 (Santiago) to run on KVM
virt-v2v: error: no grub1/grub-legacy or grub2 configuration file was found

If reporting bugs, run virt-v2v with debugging enabled and include the
complete output:

  virt-v2v -v -x [...]


Actual results:
virt-v2v failed to convert guest with UEFI firmware

Expected results:
virt-v2v should support OVMF since virt-manager and libvirt can support OVMF now, and can convert such guest successfully.


Additional info:
1. Guest uefi's xml file.
2. Detail debug info for virt-v2v cmd.

Comment 1 zhoujunqin 2014-10-14 03:00:28 UTC
Created attachment 946643 [details]
virt-v2v  debug info

Comment 3 Richard W.M. Jones 2014-10-20 09:49:14 UTC
This is likely to be a regression, but there's no realistic chance
that we can fix it before RHEL 7.1, so I'm deferring it to 7.2.

Comment 4 Richard W.M. Jones 2015-04-30 15:43:56 UTC

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

Comment 5 zhoujunqin 2015-07-07 08:11:27 UTC
I can also reproduce this issue with new build:
libguestfs-1.28.1-1.44.el7.x86_64
virt-v2v-1.28.1-1.44.el7.x86_64
libvirt-1.2.17-1.el7.x86_64

Steps:
# virt-v2v -o rhev -os 10.66.90.115:/vol/v2v_auto/iscsi_export --network rhevm  rhel6u7rc1.2-OVMF -on rhel6u7rc1.2-OVMF-juzhoutest
[   0.0] Opening the source -i libvirt rhel6u7rc1.2-OVMF
[   0.0] Creating an overlay to protect the source from being modified
[   0.0] Opening the overlay
[  95.0] Initializing the target -o rhev -os 10.66.90.115:/vol/v2v_auto/iscsi_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.
[  96.0] Inspecting the overlay
[ 108.0] Checking for sufficient free disk space in the guest
[ 108.0] Estimating space required on target for each disk
[ 108.0] Converting Red Hat Enterprise Linux Server release 6.7 (Santiago) to run on KVM
virt-v2v: error: no grub1/grub-legacy or grub2 configuration file was found

If reporting bugs, run virt-v2v with debugging enabled and include the 
complete output:

  virt-v2v -v -x [...]

But i can get expected error message with build version:

libguestfs-1.28.1-1.43.el7.x86_64
virt-v2v-1.28.1-1.43.el7.x86_64

# virt-v2v -o rhev -os 10.66.90.115:/vol/v2v_auto/iscsi_export --network rhevm  rhel6u7rc1.2-OVMF -on rhel6u7rc1.2-OVMF-juzhoutest
[   0.0] Opening the source -i libvirt rhel6u7rc1.2-OVMF
[   0.0] Creating an overlay to protect the source from being modified
[   0.0] Opening the overlay
[  95.0] Initializing the target -o rhev -os 10.66.90.115:/vol/v2v_auto/iscsi_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.
[  95.0] Inspecting the overlay
virt-v2v: error: this guest cannot run on the target, because the target 
does not support uefi firmware (supported firmware on target: bios)

If reporting bugs, run virt-v2v with debugging enabled and include the 
complete output:

  virt-v2v -v -x [...]

So rjones, shall we reopen this bug now to track this issue, thanks.

Comment 6 Richard W.M. Jones 2015-07-07 09:30:16 UTC
The patch added to -1.44.el7 moved this test:

  virt-v2v: error: this guest cannot run on the target

to later on, exposing the error:

  virt-v2v: error: no grub1/grub-legacy or grub2 configuration file was found

I'm reopening this bug.  Please can you supply the full -v -x
output with -1.44.el7 (or -1.45.el7 if it gets built in time).

Comment 7 zhoujunqin 2015-07-07 09:59:25 UTC
(In reply to Richard W.M. Jones from comment #6)

Hi rjones:

Always using following package version:

libvirt-1.2.17-1.el7.x86_64
libguestfs-1.28.1-1.44.el7.x86_64
virt-v2v-1.28.1-1.44.el7.x86_64

Steps:

# virt-v2v -o rhev -os 10.66.90.115:/vol/v2v_auto/iscsi_export --network rhevm  rhel6u7rc1.2-OVMF -on rhel6u7rc1.2-OVMF-juzhoutest -v -x |& tee >rhel6u7rc1.2-OVMF.deubg

I will attach debug log.

Comment 8 zhoujunqin 2015-07-07 10:00:25 UTC
Created attachment 1049194 [details]
rhel6u7rc1.2-OVMF.deubg

Comment 18 Richard W.M. Jones 2016-06-23 14:46:07 UTC
Insufficient information to proceed on this bug, so moving
to RHEL 7.4.

Comment 19 Richard W.M. Jones 2016-08-18 08:10:05 UTC
*** Bug 1368008 has been marked as a duplicate of this bug. ***

Comment 20 Richard W.M. Jones 2016-08-18 08:11:15 UTC
Created attachment 1191816 [details]
virt-v2v-conversion-log.txt from a failed RHEL 6.8 UEFI conversion

Comment 21 Pino Toscano 2016-08-18 09:44:21 UTC
zhoujunqin, mxie:

can you please attach the output of `ls -lR /boot`, executed on the guests that cannot be currently converted with v2v?

Thanks in advance.

Comment 22 mxie@redhat.com 2016-08-18 10:08:37 UTC
Hi Pino, 

I check the output of `ls -lR /boot` on rhel6.8-UEFI host for your reference

# ls -lR /boot
/boot:
total 41216
-rw-r--r--. 1 root root   108103 Apr 13 00:55 config-2.6.32-642.el6.x86_64
drwx------. 3 root root     4096 Dec 31  1969 efi
-rw-r--r--. 1 root root   184688 Feb 12  2016 elf-memtest86+-5.01
drwxr-xr-x. 2 root root     4096 Aug 18 03:03 grub
-rw-------. 1 root root 25793466 Aug 17 08:19 initramfs-2.6.32-642.el6.x86_64.img
-rw-------. 1 root root  8812066 Aug 17 22:27 initrd-2.6.32-642.el6.x86_64kdump.img
-rw-r--r--. 1 root root   183012 Feb 12  2016 memtest86+-5.01
-rw-r--r--. 1 root root   215559 Apr 13 00:55 symvers-2.6.32-642.el6.x86_64.gz
-rw-r--r--. 1 root root  2615003 Apr 13 00:55 System.map-2.6.32-642.el6.x86_64
-rwxr-xr-x. 1 root root  4265904 Apr 13 00:55 vmlinuz-2.6.32-642.el6.x86_64

/boot/efi:
total 4
drwx------. 3 root root 4096 Aug 17 07:56 EFI

/boot/efi/EFI:
total 4
drwx------. 2 root root 4096 Aug 17 22:24 redhat

/boot/efi/EFI/redhat:
total 256
-rwx------. 1 root root    884 Aug 17 22:24 grub.conf
-rwx------. 1 root root 254279 Feb 24 07:45 grub.efi

/boot/grub:
total 8
-rw-r--r--. 1 root root   63 Aug 17 08:23 device.map
-rw-r--r--. 1 root root 1341 May  6  2010 splash.xpm.gz

Comment 23 Pino Toscano 2016-08-18 10:33:24 UTC
Hi mxie:

can you please try a simple test?

a) in the guest, as root do:
  # ln -s /boot/efi/EFI/redhat/grub.conf /boot/grub/grub.conf

b) convert the guest with v2v

If the conversion works (v2v finished successfully, and the guest boots fine), then it's a simple one-liner.

Thanks.

Comment 24 mxie@redhat.com 2016-08-19 02:37:17 UTC
Hi Pino,

After trying your method, the conversion will still be failed with below error:

libguestfs: trace: v2v: aug_match "/files/boot/grub/grub.conf/title/kernel"
guestfsd: main_loop: proc 51 (command_lines) took 0.21 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)
grub kernels in this guest (first in list is default):
virt-v2v: error: no kernels were found in the grub configuration.

This probably indicates that virt-v2v was unable to parse the grub 
configuration of this guest.

Comment 25 Pino Toscano 2016-08-25 16:07:39 UTC
Thanks for the hints, mxie.

Hopefully fixed by upstream commits
https://github.com/libguestfs/libguestfs/commit/cf5915aee3b33a7889d34901be08608deab5c179
https://github.com/libguestfs/libguestfs/commit/035533d67a922e7690e340fb95fb1981f4c966a6
which are in libguestfs >= 1.35.2.

Comment 27 Christopher Brown 2017-03-03 16:58:25 UTC
(In reply to Pino Toscano from comment #23)
> Hi mxie:
> 
> can you please try a simple test?
> 
> a) in the guest, as root do:
>   # ln -s /boot/efi/EFI/redhat/grub.conf /boot/grub/grub.conf

FWIW, I found something similar fixed my problem for me, or at least allowed me to bypass the error and get a converted image to work with.

cp -R EFI/* efi/
ln -s ../efi/EFI/redhat/grub.conf grub.conf

I imagine I may have some UEFI hell/grub rebuild to get through but perhaps this will help.

Comment 28 kuwei@redhat.com 2017-03-15 11:20:42 UTC
Verify the bug with builds :

virt-v2v-1.36.2-1.el7.x86_64
libguestfs-1.36.2-1.el7.x86_64
libvirt-3.1.0-2.el7.x86_64
qemu-kvm-rhev-2.8.0-6.el7.x86_64

Verify steps:
1:Convert a guest with uefi to libvirt.
#  virt-v2v  -ic vpx://root.75.182/data/10.73.3.19/?no_verify=1 --password-file /tmp/passwd  rhel73-efi  -on test
[   0.0] Opening the source -i libvirt -ic vpx://root.75.182/data/10.73.3.19/?no_verify=1 rhel73-efi
[   1.1] Creating an overlay to protect the source from being modified
[   1.7] Initializing the target -o libvirt -os default
[   1.7] Opening the overlay
[  25.9] Inspecting the overlay
[ 179.1] Checking for sufficient free disk space in the guest
[ 179.1] Estimating space required on target for each disk
[ 179.1] Converting Red Hat Enterprise Linux Server 7.2 (Maipo) to run on KVM
virt-v2v: This guest has virtio drivers installed.
[ 910.9] Mapping filesystem data to avoid copying unused and blank areas
virt-v2v: warning: fstrim on guest filesystem /dev/sda1 failed.  Usually 
you can ignore this message.  To find out more read "Trimming" in 
virt-v2v(1).

Original message: fstrim: fstrim: /sysroot/: the discard operation is not 
supported
[ 936.9] Closing the overlay
[ 937.1] Checking if the guest needs BIOS or UEFI to boot
virt-v2v: This guest requires UEFI on the target to boot.
[ 937.1] Assigning disks to buses
[ 937.1] Copying disk 1/1 to /var/lib/libvirt/images/test-sda (raw)
    (100.00/100%)
[1059.7] Creating output metadata
Pool default refreshed

Domain test defined from /tmp/v2vlibvirtd10f87.xml

[1059.8] Finishing off


HI,ptoscano.As above command we can see there is no error about "virt-v2v: error: no grub1/grub-legacy or grub2 configuration file was found
" ,but when convert windwos guest to libvirt has a problem.And i has file a new bug: Bug 1431579 - Can't boot os normally after converting windows uefi guest from vmware to kvm by virt-v2.

Comment 29 Pino Toscano 2017-03-15 11:47:54 UTC
(In reply to kuwei from comment #28)
> HI,ptoscano.As above command we can see there is no error about "virt-v2v:
> error: no grub1/grub-legacy or grub2 configuration file was found
> " ,but when convert windwos guest to libvirt has a problem.And i has file a
> new bug: Bug 1431579 - Can't boot os normally after converting windows uefi
> guest from vmware to kvm by virt-v2.

So RHEL guests work fine, but Windows guests not (bug 1431579)?
This bug was about RHEL guests, so I'd consider this done if the conversion of RHEL UEFI guests works.

Comment 34 Richard W.M. Jones 2017-04-12 10:29:35 UTC
Not a customer bug, failed QA, hellishly tricky to fix, so
moving to RHEL 7.5.

Comment 37 mxie@redhat.com 2018-10-26 09:17:48 UTC
Hi rjones,

    For this bug, the current test result: can convert rhel6+uefi guest on both rhel7 host and rhel8 host by virt-v2v successfully, but the converted guest can't boot into os after v2v conversion on rhel7 and rhel8.
    I want to confirm that if rhel6+uefi is supported on Q35? If not support, I think this bug could be closed as NOTBUG

(1)On rhel7 with below builds, the conversion could be finished without error,but guest can't boot into os after conversion
virt-v2v-1.38.2-12.el7_6.1.x86_64
libguestfs-1.38.2-12.el7_6.1.x86_64
libvirt-4.5.0-10.el7_6.2.x86_64
qemu-kvm-rhev-2.12.0-18.el7_6.1.x86_64
kernel-3.10.0-957.el7.x86_64


(2)On rhel8 with below builds, the conversion could be finished without error,but guest can't boot into os after conversion

virt-v2v-1.38.4-5.el8+2078+2754d2d2.x86_64
libguestfs-1.38.4-5.el8+2078+2754d2d2.x86_64
libvirt-4.5.0-12.el8+2115+e415383f.x86_64
qemu-kvm-2.12.0-41.el8+2104+3e32e6f8.x86_64
kernel-4.18.0-27.el8.x86_64

# virt-v2v -ic vpx://root.73.141/data/10.73.75.219/?no_verify=1 -it vddk -io vddk-libdir=/home/vmware-vix-disklib-distrib -io  vddk-thumbprint=1F:97:34:5F:B6:C2:BA:66:46:CB:1A:71:76:7D:6B:50:1E:03:00:EA --password-file /tmp/passwd esx6.7-rhel6.10-x86_64-efi
[   0.2] Opening the source -i libvirt -ic vpx://root.73.141/data/10.73.75.219/?no_verify=1 esx6.7-rhel6.10-x86_64-efi -it vddk  -io vddk-libdir=/home/vmware-vix-disklib-distrib -io vddk-thumbprint=1F:97:34:5F:B6:C2:BA:66:46:CB:1A:71:76:7D:6B:50:1E:03:00:EA
[   2.9] Creating an overlay to protect the source from being modified
[   6.7] Initializing the target -o libvirt -os default
[   6.8] Opening the overlay
[  77.7] Inspecting the overlay
[  97.9] Checking for sufficient free disk space in the guest
[  97.9] Estimating space required on target for each disk
[  97.9] Converting Red Hat Enterprise Linux Server release 6.10 (Santiago) to run on KVM
virt-v2v: This guest has virtio drivers installed.
[ 190.3] Mapping filesystem data to avoid copying unused and blank areas
virt-v2v: warning: fstrim on guest filesystem /dev/sda1 failed.  Usually 
you can ignore this message.  To find out more read "Trimming" in 
virt-v2v(1).

Original message: fstrim: fstrim: /sysroot/: the discard operation is not 
supported
[ 191.2] Closing the overlay
[ 192.0] Checking if the guest needs BIOS or UEFI to boot
virt-v2v: This guest requires UEFI on the target to boot.
[ 192.0] Assigning disks to buses
[ 192.0] Copying disk 1/1 to /var/lib/libvirt/images/esx6.7-rhel6.10-x86_64-efi-sda (raw)
    (100.00/100%)
[ 376.3] Creating output metadata
Pool default refreshed

Domain esx6.7-rhel6.10-x86_64-efi defined from /tmp/v2vlibvirt1d3d58.xml

[ 378.1] Finishing off

Comment 38 Richard W.M. Jones 2018-11-05 12:13:20 UTC
> I want to confirm that if rhel6+uefi is supported on Q35? If not
> support, I think this bug could be closed as NOTBUG

Yes we recently found out that RHEL 6 will *not* work on Q35
chipset (don't know if this has anything to do with UEFI though).

The reason for this is because qemu's Q35 chipset does not emulate
"virtio legacy" drivers (only "virtio modern") and RHEL 6 only supports
virtio legacy.

Comment 39 Laszlo Ersek 2018-11-05 17:41:00 UTC
Side comment:

(In reply to Richard W.M. Jones from comment #38)
> > I want to confirm that if rhel6+uefi is supported on Q35? If not
> > support, I think this bug could be closed as NOTBUG
> 
> Yes we recently found out that RHEL 6 will *not* work on Q35
> chipset (don't know if this has anything to do with UEFI though).

UEFI should be unrelated. RHEL6 has basic UEFI support (as long as the Secure Boot operational mode is not enabled).

https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/6/html/installation_guide/sect-uefi-support-x86

> The reason for this is because qemu's Q35 chipset does not emulate
> "virtio legacy" drivers (only "virtio modern") and RHEL 6 only supports
> virtio legacy.

That's not entirely correct.

- The RHEL-6 guest indeed only supports legacy virtio devices (where "legacy" means the 0.9.5 version of the virtio spec).

The statement about Q35 is a bit more subtle. The virtio devices on a Q35 board are capable of offering legacy support. However, if they are plugged into PCI Express Root Ports or Downstream Ports, then they don't, by default. And, by default, that's exactly where libvirt places those devices. So the end result is the same -- the "sum" of the libvirt domain configuration (= PCIe topology) and the dependent virtio device behavior means that in practice only modern (1.0.0) virtio will be offered from the QEMU side.

Comment 40 mxie@redhat.com 2018-11-06 11:19:35 UTC
> So the end result is the same -- the "sum" of the libvirt domain
> configuration (= PCIe topology) and the dependent virtio device behavior
> means that in practice only modern (1.0.0) virtio will be offered from the
> QEMU side.

Thanks for Richard and Laszlo's confirmation.

Hi,Richard, as comment37 shown, v2v conversion will not be failed during converting rhel6-efi guest on both rhel7 and rhel8 now,could we change this bug description to make the rhel6-efi conversion failed directly with correct error ?

Comment 41 Richard W.M. Jones 2018-11-06 12:29:08 UTC
This bug was filed 4 years ago on what is likely to be a completely
different topic.  Let's do two things:

(1) close this bug per comment 37/38.

(2) if there are other issue(s) which need to be fixed, please
file new bugs with a clear description of what needs to be done.


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