Bug 1171130

Summary: virt-v2v conversion of RHEL 3 guest fails with: All of your loopback devices are in use
Product: Red Hat Enterprise Linux 7 Reporter: Richard W.M. Jones <rjones>
Component: libguestfsAssignee: Richard W.M. Jones <rjones>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.2CC: codong, dyuan, juzhou, mbooth, mzhan, ptoscano, tzheng
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: V2V
Fixed In Version: libguestfs-1.28.1-1.15.el7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-03-05 13:47:44 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:
Bug Depends On: 1170685    
Bug Blocks:    
Attachments:
Description Flags
virt-v2v -v -x output none

Description Richard W.M. Jones 2014-12-05 13:17:55 UTC
Created attachment 965095 [details]
virt-v2v -v -x output

Description of problem:

[NB: You must have the fix for bug 1170685 before testing this bug]

$ virt-builder rhel-3.9

$ virt-v2v -i disk rhel-3.9.img -o null
[   0.0] Opening the source -i disk rhel-3.9.img
[   0.0] Creating an overlay to protect the source from being modified
[   0.0] Opening the overlay
[  11.0] Initializing the target -o null
[  11.0] Inspecting the overlay
[  14.0] Checking for sufficient free disk space in the guest
[  14.0] Estimating space required on target for each disk
[  14.0] Converting Red Hat Enterprise Linux AS release 3 (Taroon Update 9) to run on KVM
virt-v2v: error: libguestfs error: command: All of your loopback devices 
are in use.

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

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


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

libguestfs 1.29.12, but probably also happens in 1.28.1

How reproducible:

100%

Steps to Reproduce:
1. See steps above.

Comment 2 Richard W.M. Jones 2014-12-05 13:25:24 UTC
It turns out that I'd already diagnose this before.  It happens
because the mkinitrd in RHEL 3 runs a command called 'findlodev'.
This command isn't compatible with modern kernels (such as the one
used by libguestfs).  Not sure what we can do about this -- perhaps
a hairy patch of findlodev in the guest.

Anyway, moving to RHEL 7.2 because we don't much care about conversion
of RHEL 3 guests.

Comment 3 Richard W.M. Jones 2014-12-05 13:54:49 UTC
Actually, I changed my mind, since fixing this proved to be quite simple:

https://github.com/libguestfs/libguestfs/commit/1bd779c983d62f36bf50ad613928cf209f98fbce

And now conversion of RHEL 3 is successful:

$ virt-v2v -i disk rhel-3.9.img -o null
[   0.0] Opening the source -i disk rhel-3.9.img
[   0.0] Creating an overlay to protect the source from being modified
[   0.0] Opening the overlay
[  15.0] Initializing the target -o null
[  15.0] Inspecting the overlay
[  17.0] Checking for sufficient free disk space in the guest
[  17.0] Estimating space required on target for each disk
[  17.0] Converting Red Hat Enterprise Linux AS release 3 (Taroon Update 9) to run on KVM
virt-v2v: This guest does not have virtio drivers installed.
[  19.0] Mapping filesystem data to avoid copying unused and blank areas
[  19.0] Closing the overlay
[  19.0] Copying disk 1/1 to /home/rjones/d/libguestfs/tmp/null.Tb3naa/sda (raw)
    (100.00/100%)
[  20.0] Creating output metadata
[  20.0] Finishing off

Comment 4 zhoujunqin 2014-12-08 06:00:54 UTC
I can reproduce this issue with package:
virt-v2v-1.28.1-1.14.el7.x86_64
libguestfs-1.28.1-1.14.el7.x86_64

Steps:
# virt-v2v -i disk xen-hvm-rhel3.9-x86_64.img -o null
[   0.0] Opening the source -i disk xen-hvm-rhel3.9-x86_64.img
[   0.0] Creating an overlay to protect the source from being modified
[   0.0] Opening the overlay
[   4.0] Initializing the target -o null
[   4.0] Inspecting the overlay
[   9.0] Checking for sufficient free disk space in the guest
[   9.0] Estimating space required on target for each disk
[   9.0] Converting Red Hat Enterprise Linux AS release 3 (Taroon Update 9) to run on KVM
virt-v2v: error: libguestfs error: command: All of your loopback devices 
are in use.

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

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

Then try to verify with new build:

Comment 5 zhoujunqin 2014-12-08 06:38:15 UTC
(In reply to zhoujunqin from comment #4)
> I can reproduce this issue with package:
> virt-v2v-1.28.1-1.14.el7.x86_64
> libguestfs-1.28.1-1.14.el7.x86_64
> 
> Steps:
> # virt-v2v -i disk xen-hvm-rhel3.9-x86_64.img -o null
> [   0.0] Opening the source -i disk xen-hvm-rhel3.9-x86_64.img
> [   0.0] Creating an overlay to protect the source from being modified
> [   0.0] Opening the overlay
> [   4.0] Initializing the target -o null
> [   4.0] Inspecting the overlay
> [   9.0] Checking for sufficient free disk space in the guest
> [   9.0] Estimating space required on target for each disk
> [   9.0] Converting Red Hat Enterprise Linux AS release 3 (Taroon Update 9)
> to run on KVM
> virt-v2v: error: libguestfs error: command: All of your loopback devices 
> are in use.
> 
> If reporting bugs, run virt-v2v with debugging enabled and include the 
> complete output:
> 
>   virt-v2v -v -x [...]
> 
> Then try to verify with new build:

Go on verifying this bug:
virt-v2v-1.28.1-1.15.el7.x86_64
libguestfs-1.28.1-1.15.el7.x86_64

steps:
# virt-v2v -i disk xen-hvm-rhel3.9-x86_64.img 
[   0.0] Opening the source -i disk xen-hvm-rhel3.9-x86_64.img
[   0.0] Creating an overlay to protect the source from being modified
[   0.0] Opening the overlay
[   4.0] Initializing the target -o libvirt -os default
[   4.0] Inspecting the overlay
[   8.0] Checking for sufficient free disk space in the guest
[   8.0] Estimating space required on target for each disk
[   8.0] Converting Red Hat Enterprise Linux AS release 3 (Taroon Update 9) to run on KVM
virt-v2v: This guest does not have virtio drivers installed.
[  10.0] Mapping filesystem data to avoid copying unused and blank areas
[  11.0] Closing the overlay
[  11.0] Copying disk 1/1 to /var/lib/libvirt/images/xen-hvm-rhel3.9-x86_64-sda (raw)
    (100.00/100%)
[  52.0] Creating output metadata
Pool default refreshed

Domain xen-hvm-rhel3.9-x86_64 defined from /tmp/v2vlibvirt9e375a.xml

[  59.0] Finishing off

Result: Conversion finished successfully and guest can boot up with no error.

so move this bug to VERIFIED.

Comment 9 errata-xmlrpc 2015-03-05 13:47:44 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2015-0303.html