Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1703400

Summary: RFE: virt-v2v should do something with <interface type='direct'> (either virtualize it or give an error)
Product: Red Hat Enterprise Linux Advanced Virtualization Reporter: Pino Toscano <ptoscano>
Component: libguestfsAssignee: Libvirt Maintainers <libvirt-maint>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 8.0CC: dyuan, juzhou, knoel, mbooth, mtessun, mxie, mzhan, ptoscano, rjones, tzheng, virt-bugs, zili
Target Milestone: rcKeywords: FutureFeature
Target Release: ---Flags: knoel: mirror+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: V2V
Fixed In Version: libguestfs-1.40.2-4.module+el8.0.1+3188+cd3de524 Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: 1151902 Environment:
Last Closed: 2019-08-07 10:41:34 UTC Type: Feature Request
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: 1151902    
Bug Blocks:    

Description Pino Toscano 2019-04-26 10:44:55 UTC
+++ This bug was initially created as a clone of Bug #1151902 +++

Description
virt-v2v:Network interface disappear after conversion of guest with interface type direct

Version:
libguestfs-1.27.61-1.1.el7.x86_64
virt-v2v-1.27.61-1.1.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
1.Prepare a guest with interface type direct.
# virsh dumpxml rhel6.5-test
    <interface type='direct'>
      <mac address='52:54:00:6c:01:c5'/>
      <source dev='enp0s25' mode='vepa'/>
      <model type='rtl8139'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </interface>

2.Use virt-v2v to convert the guest to rhev.
# virt-v2v -o rhev -os 10.66.90.115:/vol/v2v_auto/auto_export --network rhevm macvtap-test -v -x |& tee /tmp/macvtap-test.log

3.Import the guest to rhev,from rhev GUI,no network shows.

4.Check the ovf file of the guest,there is no content in netework section.
  <Section xsi:type='ovf:NetworkSection_Type'>
    <Info>List of networks</Info>
  </Section>

Actual results:
Network interface disappear after conversion of guest with interface type direct

Expected results:
Network interface exists after conversion by virt-v2v.

Additional info:

--- Additional comment from Richard W.M. Jones on 2014-10-20 11:53:34 CEST ---

Old virt-v2v would have also ignored these interfaces, so this
is a feature request (although I'm not sure how much sense it
makes to convert such a guest -- probably it should give an error).

--- Additional comment from Richard W.M. Jones on 2015-09-23 16:45:01 CEST ---

Since it's not completely clear from the docs, <interface type='direct'>
is a macvtap device.
http://virt.kernelnewbies.org/MacVTap

--- Additional comment from liuzi on 2018-11-28 09:03:39 CET ---

I can reproduce it on rhel8 with builds:
virt-v2v-1.38.4-5.module+el8+2173+537e5cb5.x86_64
libguestfs-1.38.4-5.module+el8+2173+537e5cb5.x86_64
kernel-4.18.0-32.el8.x86_64

Steps to Reproduce:
1.Prepare a guest with interface type direct.
# virsh dumpxml rhel8.0
    </interface>
    <interface type='direct'>
      <mac address='52:54:00:62:1c:4a'/>
      <source dev='em1' mode='bridge'/>
      <target dev='macvtap0'/>
      <model type='e1000e'/>
      <alias name='net2'/>
      <address type='pci' domain='0x0000' bus='0x09' slot='0x00' function='0x0'/>
    </interface>
2.Use virt-v2v to convert the guest to rhev.
# virt-v2v rhel8.0 -o rhv -os 10.66.144.40:/home/nfs_export --password-file /tmp/passwd

3.Import the guest to rhev,from rhev GUI,no network is shows.

--- Additional comment from Pino Toscano on 2019-04-15 10:27:20 CEST ---

Fixed upstream with
https://github.com/libguestfs/libguestfs/commit/1629ec6a5639cf5e226e80bcee749ae8851b1fae
which is in libguestfs >= 1.41.1.

In short: virt-v2v will produce a warning, as these host passthrough devices cannot be converted.

Comment 2 liuzi 2019-05-16 06:04:22 UTC
Verify bug with builds:
virt-v2v-1.40.2-4.module+el8+3201+fd6ac632.x86_64
libvirt-5.0.0-7.module+el8+3023+072e7fc8.x86_64
libguestfs-1.40.2-4.module+el8+3201+fd6ac632.x86_64
qemu-kvm-3.1.0-25.module+el8+3153+f1590ef7.x86_64

Steps:
1.Prepare a guest with interface type direct.
# virsh dumpxml rhel7.6
<...>
    <interface type='direct'>
      <mac address='52:54:00:e4:71:43'/>
      <source dev='eno1' mode='bridge'/>
      <model type='virtio'/>
      <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/>
    </interface>

2.Use virt-v2v to convert the guest to rhev.
# virt-v2v rhel7.6 -o rhv-upload -oc https://ibm-x3250m5-03.rhts.eng.pek2.redhat.com/ovirt-engine/api -os nfs_data -op /tmp/rhvpasswd -oo rhv-cafile=/home/ca.pem -oo rhv-direct=true -oo rhv-cluster=nfs -of raw
[   0.3] Opening the source -i libvirt rhel7.6
virt-v2v: warning: this guest has a direct network interface which will be 
ignored
[   0.3] Creating an overlay to protect the source from being modified
[   0.4] Opening the overlay
[   5.8] Inspecting the overlay
[  24.8] Checking for sufficient free disk space in the guest
[  24.8] Estimating space required on target for each disk
[  24.8] Converting Red Hat Enterprise Linux Server 7.6 (Maipo) to run on KVM
virt-v2v: warning: guest tools directory ‘linux/el7’ is missing from 
the virtio-win directory or ISO.

Guest tools are only provided in the RHV Guest Tools ISO, so this can 
happen if you are using the version of virtio-win which contains just the 
virtio drivers.  In this case only virtio drivers can be installed in the 
guest, and installation of Guest Tools will be skipped.
virt-v2v: This guest has virtio drivers installed.
[ 145.8] Mapping filesystem data to avoid copying unused and blank areas
[ 146.4] Closing the overlay
[ 146.6] Assigning disks to buses
[ 146.6] Checking if the guest needs BIOS or UEFI to boot
[ 146.6] Initializing the target -o rhv-upload -oc https://ibm-x3250m5-03.rhts.eng.pek2.redhat.com/ovirt-engine/api -op /tmp/rhvpasswd -os nfs_data
[ 148.0] Copying disk 1/1 to qemu URI json:{ "file.driver": "nbd", "file.path": "/var/tmp/rhvupload.MSHvcf/nbdkit0.sock", "file.export": "/" } (raw)
    (100.00/100%)
[ 771.0] Creating output metadata
virt-v2v: warning: oVirt cannot emulate ‘ich9’ sound cards.  This sound 
card will be dropped from the output.
[ 789.8] Finishing off

3.The conversion can be finished successfully and boot the guest in rhv.
3.1 From rhev GUI network interface shows nothing. 
3.2 The guest can pass all regular checkpoints.

Result:Virt-v2v will give a warning info when convert a guest with interface type direct,so change the bug from ON_QA to VERIFIED.

Comment 4 errata-xmlrpc 2019-08-07 10:41:34 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:2395