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 1392228 - libguestfs virt-v2v cannot find dracut when migrating fedora 23 or newer OVA
Summary: libguestfs virt-v2v cannot find dracut when migrating fedora 23 or newer OVA
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libguestfs
Version: 7.2
Hardware: Unspecified
OS: Unspecified
unspecified
low
Target Milestone: rc
: ---
Assignee: Richard W.M. Jones
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-11-06 14:35 UTC by Derek Atkins
Modified: 2016-11-07 01:14 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-11-06 22:55:34 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Full log output of virt-v2v (1.19 MB, text/plain)
2016-11-06 22:50 UTC, Derek Atkins
no flags Details

Description Derek Atkins 2016-11-06 14:35:14 UTC
Description of problem:

I was trying to migrate a Fedora-23 VM in OVA format into oVirt 4.0.4 on EL7.2 and received an error (see below).

This bug was reported on the libguestfs list in January, 2016 [0] and was apparently fixed upstream shortly thereafter [1].  However the version of libguestfs in 7.2 does not contain this almost-year-old fix

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

libguestfs-1.28.1-1.55.el7.centos.4.x86_64

How reproducible:

100%


Steps to Reproduce:
1. Get a Fedora-23 VM in OVA format
2. in the Ovirt console [Virtual Machines] -> Import
3. Select OVA and select the file
4. attempt the import
5. Look at the vdsm logs to see the error

Actual results:

Thread-88166::ERROR::2016-11-05 16:36:09,219::v2v::674::root::(_run) Job u'cdb1e
eb7-63f3-46e8-abd5-5292dcc8809a' failed
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/vdsm/v2v.py", line 669, in _run
    self._import()
  File "/usr/lib/python2.7/site-packages/vdsm/v2v.py", line 696, in _import
    self._proc.stderr.read(1024)))
V2VProcessError: Job u'cdb1eeb7-63f3-46e8-abd5-5292dcc8809a' process failed exit
-code: 1, stderr: virt-v2v: error: unable to rebuild initrd 
(/boot/initramfs-4.2.6-301.fc23.x86_64.img) because mkinitrd or dracut was 
not found in the guest

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

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


Expected results:

Fedora 23 (and 24) VMs should import.

Additional info:

[0] https://www.redhat.com/archives/libguestfs/2016-January/msg00138.html
[1] https://github.com/libguestfs/libguestfs/commit/569ad259b4726fbdabf380bdca34da00ca262e1e

This was apparently fixed in libguestfs 1.33.7 on January 28, 2016 (if I'm reading the github page correctly).  Could this patch be backported to 7.2?

Comment 1 Richard W.M. Jones 2016-11-06 19:04:14 UTC
Can you run virt-v2v with the -v -x options?  It should be
sufficient to do:

  virt-v2v -v -x -i ova fedora.ova -o null

Capture the complete output and attach it to this bug.

Comment 2 Derek Atkins 2016-11-06 21:45:18 UTC
Hi,

I'm trying but it's failing on an authentication error.  Running the virt-v2v command as root as you suggest and I get:

[snip]
libguestfs: [00000ms] connect to libvirt
libguestfs: opening libvirt handle: URI = qemu:///system, auth = default+wrapper, flags = 0
libvirt needs authentication to connect to libvirt URI qemu:///system
(see also: http://libvirt.org/auth.html http://libvirt.org/uri.html)
Please enter your authentication name: admin@internal
Please enter your password: 
libvirt: XML-RPC error : authentication failed: authentication failed
libguestfs: trace: launch = -1 (error)
virt-v2v: error: libguestfs error: could not connect to libvirt (URI = 
qemu:///system): authentication failed: authentication failed [code=45 
domain=7]

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

  virt-v2v -v -x [...]
libguestfs: trace: close
libguestfs: closing guestfs handle 0x21df660 (state 0)
libguestfs: command: run: rm
libguestfs: command: run: \ -rf /tmp/libguestfsGjKsKJ


I've tried admin, admin@internal, and 'root', but nothing has been accepted.  I'm not sure what authentication credentials it's looking for?

Comment 3 Derek Atkins 2016-11-06 22:49:32 UTC
After searching a bit I determined the issue is the virt-v2v backend.  If I set it to "direct" then I get past this authentication issue .. but it doesn't like the target, -o null, complaining about the output format.  So I added -of raw, resulting in:

LIBGUESTFS_BACKEND=direct virt-v2v -v -x -i ova file.ova -of raw -o null

This "succeeded" in getting me a complete run, but of course it still complains that it cannot find dracut:

libguestfs: trace: is_file = 0
virt-v2v: error: unable to rebuild initrd 
(/boot/initramfs-4.2.6-301.fc23.x86_64.img) because mkinitrd or dracut was 
not found in the guest

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

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

See the full log (which I'll attach shortly)

Comment 4 Derek Atkins 2016-11-06 22:50:30 UTC
Created attachment 1217837 [details]
Full log output of virt-v2v

Here's the log I got (see my previous comment)

Comment 5 Richard W.M. Jones 2016-11-06 22:55:34 UTC
So this is indeed fixed by the following upstream commit:

https://github.com/libguestfs/libguestfs/commit/569ad259b4726fbdabf380bdca34da00ca262e1e

commit 569ad259b4726fbdabf380bdca34da00ca262e1e
Author: Richard W.M. Jones <rjones>
Date:   Thu Jan 28 13:55:20 2016 +0000

    v2v: linux: Find dracut if it is located in /usr/bin.
    
    In Fedora 23, dracut moved to /usr/bin.  However we only looked for
    /sbin/dracut, so we didn't find it.  You would have seen a failure
    like this:
    
      virt-v2v: error: unable to rebuild initrd
      (/boot/initramfs-4.2.3-300.fc23.x86_64.img) because mkinitrd or dracut was
      not found in the guest
    
    Look for dracut in /usr/bin as well.
    
    Thanks: Arnaud Bougeard.


... as indeed you noted in the description.

I suggest trying the RHEL 7.3 version which should contain this fix.

https://people.redhat.com/~rjones/libguestfs-RHEL-7.3-preview/

Comment 6 Derek Atkins 2016-11-07 01:14:52 UTC
Thanks.  I can confirm that once I updated the packages from your repo the command-line virt-v2v succeeds.  Of course, I suspect I'll need to restart oVirt on this host, now....


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