Bug 1741166 - Cannot pass block device as virtio-win ISO path
Summary: Cannot pass block device as virtio-win ISO path
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux Advanced Virtualization
Classification: Red Hat
Component: libguestfs
Version: 8.1
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: 8.1
Assignee: Libvirt Maintainers
QA Contact: Virtualization Bugs
URL:
Whiteboard: V2V
Depends On: 1727164
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-08-14 11:57 UTC by Pino Toscano
Modified: 2020-11-14 06:09 UTC (History)
11 users (show)

Fixed In Version: libguestfs-1.40.2-13.module+el8.1.0+3975+96069438
Doc Type: If docs needed, set a value
Doc Text:
Clone Of: 1727164
Environment:
Last Closed: 2019-11-06 07:18:29 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Conversion log (154.45 KB, text/plain)
2019-08-19 02:58 UTC, liuzi
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2019:3723 0 None None None 2019-11-06 07:18:50 UTC

Description Pino Toscano 2019-08-14 11:57:25 UTC
+++ This bug was initially created as a clone of Bug #1727164 +++

It is not possible to pass block device (directly or via symbolic link) to virt-v2v for virtio-win ISO. It accepts only regular files, but one may want to use real CD or SAN volume.

There is already patch upstream but RHV would appreciate having it in RHEL7 too.

One can easily test it using loop device. Quoting Rich's test flow:


$ sudo losetup /dev/loop0 `pwd`/fake-virtio-win.iso

$ ll /dev/loop0 
brw-rw----. 1 root disk 7, 0 Jul  4 16:01 /dev/loop0
$ sudo blockdev --getsize64 /dev/loop0 
2738176

Now run the same command as above but pointing to /dev/loop0, and
of course virt-v2v will now need to be run as root:

sudo VIRTIO_WIN=/dev/loop0 \
../run virt-v2v -vx -i disk test-data/phony-guests/windows.img -o null |&
  tee /tmp/log

To show that it used the block device:

$ grep copy_from_virtio_win /tmp/log
windows: copy_from_virtio_win: guest tools source ISO /dev/loop0

To clean up:

$ sudo losetup -d /dev/loop0

--- Additional comment from Richard W.M. Jones on 2019-07-04 23:24:39 CEST ---

Upstream commit c22a8b68fe5729d3a8907b41eef287cd9f3a55c0.

--- Additional comment from Richard W.M. Jones on 2019-07-04 23:27:57 CEST ---

Let's see if we can get this as first z-stream (7.7.1).

--- Additional comment from Richard W.M. Jones on 2019-07-08 10:09:52 CEST ---

I've set the flag to 7.8 with the hope we can get a z-stream for this to get it
into an early 7.7.x.

Comment 2 liuzi 2019-08-16 07:11:42 UTC
Test bug with builds:
virt-v2v-1.40.2-12.module+el8.1.0+3908+8a8c5ed4.x86_64
libguestfs-1.40.2-12.module+el8.1.0+3908+8a8c5ed4.x86_64
virtio-win-1.9.8-7.el8.noarch

Steps:
1.Prepare a rhel8 conversion server,and create a block device as virtio-win ISO path.
#losetup /dev/loop0 /usr/share/virtio-win/virtio-win.iso

# ll /dev/loop0
brw-rw----. 1 root disk 7, 0 Aug 16 02:33 /dev/loop0

# blockdev --getsize64 /dev/loop0
258799616


# export VIRTIO_WIN=/dev/loop0

2.Use virt-v2v to convert a windows guest and check whether install virtio-drivers during the conversion.
# virt-v2v  -ic vpx://root.75.182/data/10.73.3.19/?no_verify=1  esx5.5-win2012-x86_64 -o null --password-file /home/passwd
[   0.0] Opening the source -i libvirt -ic vpx://root.75.182/data/10.73.3.19/?no_verify=1 esx5.5-win2012-x86_64
[  29.8] Creating an overlay to protect the source from being modified
[  30.7] Opening the overlay
[  69.5] Inspecting the overlay
[ 242.4] Checking for sufficient free disk space in the guest
[ 242.4] Estimating space required on target for each disk
[ 242.4] Converting Windows Server 2012 Datacenter to run on KVM
virt-v2v: warning: /usr/share/virt-tools/pnp_wait.exe is missing.  
Firstboot scripts may conflict with PnP.
virt-v2v: warning: there are no virtio drivers available for this version 
of Windows (6.2 x86_64 Server).  virt-v2v looks for drivers in /dev/loop0

The guest will be configured to use slower emulated devices.
virt-v2v: This guest does not have virtio drivers installed.
^C

Result:virt-v2v cannot find drivers from block device.

Hi,Pino
This bug isn't fixed on rhel8.1 AV.maybe the bug only fixed on rhel7.8,please refer to bug1727164

Comment 3 Richard W.M. Jones 2019-08-16 07:34:11 UTC
zili: I would expect this to work.  Do you have the full virt-v2v -v -x log?

Comment 4 liuzi 2019-08-19 02:58:40 UTC
Created attachment 1605627 [details]
Conversion log

Comment 5 Pino Toscano 2019-08-22 08:22:06 UTC
(In reply to liuzi from comment #2)
> Test bug with builds:
> virt-v2v-1.40.2-12.module+el8.1.0+3908+8a8c5ed4.x86_64
> libguestfs-1.40.2-12.module+el8.1.0+3908+8a8c5ed4.x86_64

This version does not have the fix -- you need at least virt-v2v-1.40.2-13 (see the Fixed-In field of this bug).

Comment 6 liuzi 2019-08-22 08:40:18 UTC
Verify bug with builds:
virt-v2v-1.40.2-13.module+el8.1.0+3975+96069438.x86_64
libguestfs-1.40.2-13.module+el8.1.0+3975+96069438.x86_64
virtio-win-1.9.8-7.el8.noarch

Steps:
1.Prepare a rhel8 conversion server,and create a block device as virtio-win ISO path.
#losetup /dev/loop0 /usr/share/virtio-win/virtio-win.iso

# ll /dev/loop0
brw-rw----. 1 root disk 7, 0 Aug 21 23:29 /dev/loop0

# blockdev --getsize64 /dev/loop0
258799616


# export VIRTIO_WIN=/dev/loop0

2.Use virt-v2v to convert a windows guest and check whether install virtio-drivers during the conversion.
#  virt-v2v  -ic vpx://root.75.182/data/10.73.3.19/?no_verify=1  esx5.5-win2012-x86_64 -o null --password-file /home/passwd 
[   0.0] Opening the source -i libvirt -ic vpx://root.75.182/data/10.73.3.19/?no_verify=1 esx5.5-win2012-x86_64
[  30.7] Creating an overlay to protect the source from being modified
[  31.6] Opening the overlay
[  71.2] Inspecting the overlay
[ 251.8] Checking for sufficient free disk space in the guest
[ 251.8] Estimating space required on target for each disk
[ 251.8] Converting Windows Server 2012 Datacenter to run on KVM
virt-v2v: warning: /usr/share/virt-tools/pnp_wait.exe is missing.  
Firstboot scripts may conflict with PnP.
virt-v2v: warning: there is no QXL driver for this version of Windows (6.2 
x86_64).  virt-v2v looks for this driver in /dev/loop0

The guest will be configured to use a basic VGA display driver.
virt-v2v: This guest has virtio drivers installed.
^C

Result:virt-v2v can find drivers from block device.so change the bug from ON_QA to VERIFIED.

Comment 8 errata-xmlrpc 2019-11-06 07:18:29 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://access.redhat.com/errata/RHBA-2019:3723


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