Red Hat Bugzilla – Bug 1296606
virt-v2v doesn't remove VirtualBox additions correctly because of file quoting
Last modified: 2016-11-03 13:57:51 EDT
Description of problem: virt-v2v conversion fails with the following message: guestfsd: error: is_file_stub: path must start with a / character^M libguestfs: trace: is_file = -1 (error) virt-v2v: error: libguestfs error: is_file: is_file_stub: path must start with a / character Version-Release number of selected component (if applicable): RHEL 7.2 virt-v2v-1.28.1-1.55.el7.x86_64 libguestfs-1.28.1-1.55.el7.x86_64 qemu-kvm-rhev-2.1.2-23.el7_1.10.x86_64 or qemu-kvm-rhev-2.3.0-31.el7_2.4.x86_64 , both show the same behavior How reproducible: Run virt-v2v conversion and observe the error. virt-v2v -v -x -i disk ./disk1.img -o rhev -os RHEV1:/domains/export --network rhevm Steps to Reproduce: 1. 2. 3. Actual results: virt-v2v fails with error. Expected results: virt-v2v should complete without errors. Additional info:
To reproduce this bug (a little bit involved I'm afraid!) (1) Download the latest VirtualBox Guest Additions ISO from http://download.virtualbox.org/virtualbox/ eg: http://download.virtualbox.org/virtualbox/5.0.10/VBoxGuestAdditions_5.0.10.iso (2) Install a CentOS 7.2 VM: $ virt-builder centos-7.2 (3) Boot CentOS 7.2 VM with the ISO attached: $ virt-install --import --name tmp-bz1296606 --ram 4096 --disk path=centos-7.2.img,format=raw --os-variant rhel7 --disk device=cdrom,path=VBoxGuestAdditions_5.0.10.iso,format=raw --boot hd (4) Log in as root (using the password printed in step 2). (5) Mount the VBox Additions in the guest: # mount /dev/cdrom /mnt (6) Run the VBox Additions script to install them in the guest: # yum install bzip2 # /mnt/VBoxLinuxAdditions.run This should create /opt/VBoxGuestAdditions-XXX and /var/lib/VBoxGuestAdditions/config. (7) Shut down the guest and delete the libvirt config: $ virsh undefine tmp-bz1296606 (8) You will now have a guest image containing VirtualBox Guest Additions that you can try to convert using virt-v2v: $ ll centos-7.2.img -rw-r--r--. 1 rjones rjones 6442450944 Jan 11 11:52 centos-7.2.img $ virt-v2v -i disk centos-7.2.img -o null [...] [ 16.1] Converting CentOS Linux release 7.2.1511 (Core) to run on KVM virt-v2v: error: libguestfs error: is_file: is_file_stub: path must start with a / character
Interestingly this bug existed in old virt-v2v too. I have pushed a commit upstream: https://github.com/libguestfs/libguestfs/commit/64af88a1b766edddeb1dcf845019f1ed01202d0b
I can reproduce it following the steps in comment 7. # rpm -q libguestfs virt-v2v libguestfs-1.28.1-1.55.el7.x86_64 virt-v2v-1.28.1-1.55.el7.x86_64 steps: 1) Download the latest VirtualBox Guest Additions ISO from http://download.virtualbox.org/virtualbox/ eg: http://download.virtualbox.org/virtualbox/5.0.10/VBoxGuestAdditions_5.0.10.iso 2) Prepare a guest image which has rhel7 installed. 3) Create a temp guest by the image in step2 and with VBos ISO attached. $ virt-install --import --name tmp-bz1296606 --ram 4096 --disk path=centos-7.2.img,format=raw --os-variant rhel7 --disk device=cdrom,path=VBoxGuestAdditions_5.0.10.iso,format=raw --boot hd 4) Log in the guest as root. 5) Mount the VBox Additions in the guest: # mount /dev/cdrom /mnt 6) Run the VBox Additions script to install them in the guest: # yum install bzip2 # /mnt/VBoxLinuxAdditions.run This should create /opt/VBoxGuestAdditions-XXX and /var/lib/VBoxGuestAdditions/config. 7) Shut down the guest and delete the libvirt config. $ virsh undefine tmp-bz1296606 8) You will now have a guest image containing VirtualBox Guest Additions that you can try to convert using virt-v2v: # virt-v2v -i disk rhel7.2-1030-clone.qcow2 -o null [ 0.0] Opening the source -i disk rhel7.2-1030-clone.qcow2 [ 0.0] Creating an overlay to protect the source from being modified [ 0.0] Opening the overlay [ 105.0] Initializing the target -o null [ 105.0] Inspecting the overlay [ 114.0] Checking for sufficient free disk space in the guest [ 114.0] Estimating space required on target for each disk [ 114.0] Converting Red Hat Enterprise Linux Server release 7.2 (Maipo) to run on KVM virt-v2v: error: libguestfs error: is_file: is_file_stub: path must start with a / character If reporting bugs, run virt-v2v with debugging enabled and include the complete output: virt-v2v -v -x [...] And the try it with latest libguestfs. # rpm -q libguestfs virt-v2v libguestfs-1.32.2-6.el7.x86_64 virt-v2v-1.32.2-6.el7.x86_64 # virt-v2v -i disk rhel7.2-1030-clone.qcow2 -o null [ 0.0] Opening the source -i disk rhel7.2-1030-clone.qcow2 [ 0.1] Creating an overlay to protect the source from being modified [ 0.5] Initializing the target -o null [ 0.5] Opening the overlay [ 55.4] Inspecting the overlay [ 64.6] Checking for sufficient free disk space in the guest [ 64.6] Estimating space required on target for each disk [ 64.6] Converting Red Hat Enterprise Linux Server 7.2 (Maipo) to run on KVM virt-v2v: warning: /files/boot/grub2/device.map/hd0 references unknown device "vda". You may have to fix this entry manually after conversion. virt-v2v: This guest has virtio drivers installed. [ 91.0] Mapping filesystem data to avoid copying unused and blank areas [ 92.2] Closing the overlay [ 92.5] Checking if the guest needs BIOS or UEFI to boot [ 92.5] Assigning disks to buses [ 92.5] Copying disk 1/1 to /var/tmp/null.Z660lw/sda (qcow2) (100.00/100%) [ 125.1] Creating output metadata [ 125.1] Finishing off So move the bug to VERIFIED.
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/RHSA-2016-2576.html