Bug 1234351

Summary: virt-v2v Support for Fedora virtio-win drivers
Product: Red Hat Enterprise Linux 7 Reporter: Shahar Havivi <shavivi>
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: juzhou, michal.skrivanek, mzhan, ptoscano, redhat-bugzilla, rjones, shavivi, sherold, tzheng, xiaodwan
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: V2V
Fixed In Version: libguestfs-1.28.1-1.40.el7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-11-19 07:02:00 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:

Description Shahar Havivi 2015-06-22 12:14:26 UTC
Currently virt-v2v support singed virtio-win drivers that was installed via virtio-win RHEL package.
There is another version for virtio-win drivers (un-signed) distributed at the Fedora project: https://fedoraproject.org/wiki/Windows_Virtio_Drivers

The Fedora package come in a form of an iso and the relevant drivers (netkvm and viostor) are in a different location for each Windows architecture from the RHEL packages.

virt-v2v need to support the Fedora iso as an optional parameter mount it and fetch the relevant drivers.

Comment 2 Richard W.M. Jones 2015-06-22 14:35:08 UTC
I posted a patch here:

https://www.redhat.com/archives/libguestfs/2015-June/msg00200.html

TBH it's a bit invasive for RHEL 7.2.  Could be 7.3 material
instead.  I'm still testing it anyway.

Comment 3 Michal Skrivanek 2015-06-23 07:05:36 UTC
(In reply to Richard W.M. Jones from comment #2)
> I posted a patch here:
> 
> https://www.redhat.com/archives/libguestfs/2015-June/msg00200.html
> 
> TBH it's a bit invasive for RHEL 7.2.  Could be 7.3 material
> instead.  I'm still testing it anyway.

Would it help to help you out with testing so it can get to 7.2?

Comment 4 Richard W.M. Jones 2015-06-23 08:05:17 UTC
I've been running the test cases here last night.  Some fail, but
it doesn't seem to be because of the drivers, but for other reasons.

Comment 5 Richard W.M. Jones 2015-06-23 09:20:55 UTC
v2 patch:
https://www.redhat.com/archives/libguestfs/2015-June/thread.html#00208

Comment 6 Richard W.M. Jones 2015-06-25 11:48:06 UTC
This is now upstream:

https://github.com/libguestfs/libguestfs/commit/47b5f245bec908f803f0a89c3b1e3166cfe33aad

Testing this has been a bit of an uphill struggle because of
failures in my test suite (not related to this bug, I don't
believe).

Comment 8 zhoujunqin 2015-07-06 09:20:37 UTC
Try to verify this bug with new build:
libvirt-1.2.17-1.el7.x86_64
libguestfs-1.28.1-1.43.el7.x86_64
virt-v2v-1.28.1-1.43.el7.x86_64
virtio-win-1.7.4-1.el7.noarch

Steps:
1. Check virt-v2v manual page for support loading virtio-win drivers from virtio-win.iso

# man virt-v2v
...
ENABLING VIRTIO
...
        Windows        Drivers are installed from the directory pointed to by
                       "VIRTIO_WIN" environment variable
                       (/usr/share/virtio-win by default) if present
...
ENVIRONMENT VARIABLES
...
       "VIRTIO_WIN"
           This is where VirtIO drivers for Windows are searched for (/usr/share/virtio-win if unset).  It can be a directory or point to virtio-win.iso (CD ROM image containing drivers).

           See "ENABLING VIRTIO".

2. Run virt-v2 cmd for testing:

Scenario 1: Unset VIRTIO_WIN_DIR and without virtio-win pkg installed.

# unset VIRTIO_WIN_DIR

# echo $VIRTIO_WIN_DIR

# virt-v2v -ic vpx://root.4.103/tzheng-demo/10.66.106.63/?no_verify=1 --password-file /tmp/passwd2 esx5.5-win7-x86_64  -on esx5.5-win7-x86_64-unset 
[   0.0] Opening the source -i libvirt -ic vpx://root.4.103/tzheng-demo/10.66.106.63/?no_verify=1 esx5.5-win7-x86_64
[   1.0] Creating an overlay to protect the source from being modified
[   1.0] Opening the overlay
[  10.0] Initializing the target -o libvirt -os default
[  10.0] Inspecting the overlay
[  58.0] Checking for sufficient free disk space in the guest
[  58.0] Estimating space required on target for each disk
[  58.0] Converting Windows 7 Ultimate to run on KVM
virt-v2v: warning: there are no virtio drivers available for this version 
of Windows (6.1 x86_64 Client).  virt-v2v looks for drivers in 
/usr/share/virtio-win

The guest will be configured to use slower emulated devices.
virt-v2v: This guest does not have virtio drivers installed.
[  67.0] Mapping filesystem data to avoid copying unused and blank areas
[  67.0] Closing the overlay
[  67.0] Copying disk 1/1 to /var/lib/libvirt/images/esx5.5-win7-x86_64-unset-sda (raw)
    (100.00/100%)
[ 881.0] Creating output metadata
Pool default refreshed

Domain esx5.5-win7-x86_64-unset defined from /tmp/v2vlibvirtadb392.xml

[ 882.0] Finishing off

Result: Conversion finished without installing virtio-win driver to guest.

Scenario 2: Using default setting for VIRTIO_WIN_DIR

# ls  /usr/share/virtio-win/
drivers  guest-agent  virtio-win-1.7.4_amd64.vfd  virtio-win-1.7.4.iso  virtio-win-1.7.4_x86.vfd  virtio-win_amd64.vfd  virtio-win.iso  virtio-win_x86.vfd

# virt-v2v -ic vpx://root.4.103/tzheng-demo/10.66.106.63/?no_verify=1 --password-file /tmp/passwd2 esx5.5-win7-x86_64 -on esx5.5-win7-x86_64-withvirtio
[   0.0] Opening the source -i libvirt -ic vpx://root.4.103/tzheng-demo/10.66.106.63/?no_verify=1 esx5.5-win7-x86_64
[   1.0] Creating an overlay to protect the source from being modified
[   1.0] Opening the overlay
[ 143.0] Initializing the target -o libvirt -os default
[ 143.0] Inspecting the overlay
[ 190.0] Checking for sufficient free disk space in the guest
[ 190.0] Estimating space required on target for each disk
[ 190.0] Converting Windows 7 Ultimate to run on KVM
virt-v2v: This guest has virtio drivers installed.
[ 200.0] Mapping filesystem data to avoid copying unused and blank areas
[ 201.0] Closing the overlay
[ 201.0] Copying disk 1/1 to /var/lib/libvirt/images/esx5.5-win7-x86_64-withvirtio-sda (raw)
    (100.00/100%)
[ 768.0] Creating output metadata
Pool default refreshed

Domain esx5.5-win7-x86_64-withvirtio defined from /tmp/v2vlibvirt20fab7.xml

[ 770.0] Finishing off

Result: Conversion finished with installing virtio-win driver to guest.


Scenario 3: Testing with virtio-win.iso without virtio-win pkg installed.

3.1 with virtio-win.iso mounted

# mount virtio-win.iso /opt -oloop 
mount: /dev/loop0 is write-protected, mounting read-only

# export VIRTIO_WIN_DIR=/opt

# virt-v2v -ic vpx://root.4.103/tzheng-demo/10.66.106.63/?no_verify=1 --password-file /tmp/passwd2 esx5.5-win7-x86_64 
[   0.0] Opening the source -i libvirt -ic vpx://root.4.103/tzheng-demo/10.66.106.63/?no_verify=1 esx5.5-win7-x86_64
[   1.0] Creating an overlay to protect the source from being modified
[   2.0] Opening the overlay
[  13.0] Initializing the target -o libvirt -os default
[  13.0] Inspecting the overlay
[  65.0] Checking for sufficient free disk space in the guest
[  65.0] Estimating space required on target for each disk
[  65.0] Converting Windows 7 Ultimate to run on KVM
virt-v2v: This guest has virtio drivers installed.
[  82.0] Mapping filesystem data to avoid copying unused and blank areas
[  84.0] Closing the overlay
[  84.0] Copying disk 1/1 to /var/lib/libvirt/images/esx5.5-win7-x86_64-sda (raw)
    (100.00/100%)
[ 984.0] Creating output metadata
Pool default refreshed

Domain esx5.5-win7-x86_64 defined from /tmp/v2vlibvirta4c80e.xml

[ 984.0] Finishing off

Result: Conversion finished with installing virtio-win driver to guest.

OR # export VIRTIO_WIN=/opt

# virt-v2v -ic vpx://root.4.103/tzheng-demo/10.66.106.63/?no_verify=1 --password-file /tmp/passwd2 esx5.5-win7-x86_64 -on esx5.5-win7-x86_64-aa -o null
[   0.0] Opening the source -i libvirt -ic vpx://root.4.103/tzheng-demo/10.66.106.63/?no_verify=1 esx5.5-win7-x86_64
[   1.0] Creating an overlay to protect the source from being modified
[   2.0] Opening the overlay
[  10.0] Initializing the target -o null
[  10.0] Inspecting the overlay
[  56.0] Checking for sufficient free disk space in the guest
[  56.0] Estimating space required on target for each disk
[  56.0] Converting Windows 7 Ultimate to run on KVM
virt-v2v: This guest has virtio drivers installed.
[  64.0] Mapping filesystem data to avoid copying unused and blank areas
[  65.0] Closing the overlay
[  65.0] Copying disk 1/1 to /var/tmp/null.dyuzOH/sda (raw)
    (100.00/100%)
[ 631.0] Creating output metadata
[ 631.0] Finishing off

Result: Conversion finished with installing virtio-win driver to guest.

3.2 without mounting virtio-win.iso

# export VIRTIO_WIN=./virtio-win.iso

# echo $VIRTIO_WIN
./virtio-win.iso

# virt-v2v -ic vpx://root.4.103/tzheng-demo/10.66.106.63/?no_verify=1 --password-file /tmp/passwd2 esx5.5-win7-x86_64 -on esx5.5-win7-x86_64-iso -o null
[   0.0] Opening the source -i libvirt -ic vpx://root.4.103/tzheng-demo/10.66.106.63/?no_verify=1 esx5.5-win7-x86_64
[   1.0] Creating an overlay to protect the source from being modified
[   1.0] Opening the overlay
[  10.0] Initializing the target -o null
[  10.0] Inspecting the overlay
[  58.0] Checking for sufficient free disk space in the guest
[  58.0] Estimating space required on target for each disk
[  58.0] Converting Windows 7 Ultimate to run on KVM
virt-v2v: This guest has virtio drivers installed.
[  71.0] Mapping filesystem data to avoid copying unused and blank areas
[  72.0] Closing the overlay
[  72.0] Copying disk 1/1 to /var/tmp/null.jZikhV/sda (raw)
    (100.00/100%)
[ 628.0] Creating output metadata
[ 628.0] Finishing off

Result: Conversion finished with installing virtio-win driver to guest.

Since loading virtio-win drivers from virtio-win.iso is supported by virt-v2v, move this bug from ON_QA to VERIFIED.

Comment 10 errata-xmlrpc 2015-11-19 07:02:00 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-2183.html