Bug 1161575

Summary: Failed to import guest with "rtl8139" nic to openstack server after converted by v2v
Product: Red Hat Enterprise Linux 7 Reporter: zhoujunqin <juzhou>
Component: libguestfsAssignee: Richard W.M. Jones <rjones>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.1CC: berrange, codong, dyuan, kchamart, mbooth, mzhan, ptoscano, tzheng
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: V2V
Fixed In Version: libguestfs-1.28.1-1.10.el7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-03-05 13:47:15 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:
Attachments:
Description Flags
nova-scheduler.log none

Description zhoujunqin 2014-11-07 11:18:21 UTC
Created attachment 954904 [details]
nova-scheduler.log

Description of problem:
Failed to import guest with "rtl8139" nic to openstack server after converted by v2v

Version-Release number of selected component (if applicable):
libguestfs-1.28.1-1.7.el7.x86_64
virt-v2v-1.28.1-1.7.el7.x86_64
openstack-nova-novncproxy-2014.1.3-4.el7ost.noarch
repo link: http://download.eng.rdu2.redhat.com/rel-eng/OpenStack/5.0-RHEL-7/latest/RH7-RHOS-5.0/x86_64/os/


How reproducible:
100%

Steps to Reproduce:
1. Prepare a guest with "rtl8139" nic.
# virsh dumpxml win2k8r2 
...
    <interface type='network'>
      <mac address='52:54:00:be:b9:46'/>
      <source network='default'/>
      <model type='rtl8139'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </interface>
...

2. Use virt-v2v convert this guest to openstack server:

# virt-v2v  -i disk  "/var/lib/libvirt/images/win2k8r2.qcow2" -o glance  
[   0.0] Opening the source -i disk /var/lib/libvirt/images/win2k8r2.qcow2
[   0.0] Creating an overlay to protect the source from being modified
[   0.0] Opening the overlay
[   2.0] Initializing the target -o glance
[   3.0] Inspecting the overlay
[   4.0] Checking for sufficient free disk space in the guest
[   4.0] Estimating space required on target for each disk
[   4.0] Converting Windows Server 2008 R2 Standard to run on KVM
virt-v2v: warning: there are no virtio drivers available for this version 
of Windows (6.1 x86_64 Server).  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.
[   4.0] Mapping filesystem data to avoid copying unused and blank areas
[   6.0] Closing the overlay
[   6.0] Copying disk 1/1 to /var/tmp/glance.ITxt8v/sda (qcow2)
    (100.00/100%)
[ 255.0] Creating output metadata
+------------------+--------------------------------------+
| Property         | Value                                |
+------------------+--------------------------------------+
| checksum         | 3dd30e1595e46833535c0819a22693a6     |
| container_format | bare                                 |
| created_at       | 2014-11-07T11:02:29                  |
| deleted          | False                                |
| deleted_at       | None                                 |
| disk_format      | qcow2                                |
| id               | b662f0d8-1cf5-4d6f-a52e-6432b8ca71cc |
| is_public        | False                                |
| min_disk         | 0                                    |
| min_ram          | 0                                    |
| name             | win2k8r2                             |
| owner            | c3a9c07d56aa401b84da161f28cfc06f     |
| protected        | False                                |
| size             | 6988365824                           |
| status           | active                               |
| updated_at       | 2014-11-07T11:04:10                  |
| virtual_size     | None                                 |
+------------------+--------------------------------------+
+----------------------------+--------------------------------------+
| Property                   | Value                                |
+----------------------------+--------------------------------------+
| Property 'architecture'    | x86_64                               |
| Property 'hw_disk_bus'     | rtl8139                              |
| Property 'hw_vif_model'    | ide                                  |
| Property 'hypervisor_type' | kvm                                  |
| Property 'os_distro'       | windows                              |
| Property 'os_type'         | windows                              |
| Property 'os_version'      | 6.1                                  |
| Property 'vm_mode'         | hvm                                  |
| checksum                   | 3dd30e1595e46833535c0819a22693a6     |
| container_format           | bare                                 |
| created_at                 | 2014-11-07T11:02:29                  |
| deleted                    | False                                |
| deleted_at                 | None                                 |
| disk_format                | qcow2                                |
| id                         | b662f0d8-1cf5-4d6f-a52e-6432b8ca71cc |
| is_public                  | False                                |
| min_disk                   | 0                                    |
| min_ram                    | 2048                                 |
| name                       | win2k8r2                             |
| owner                      | c3a9c07d56aa401b84da161f28cfc06f     |
| protected                  | False                                |
| size                       | 6988365824                           |
| status                     | active                               |
| updated_at                 | 2014-11-07T11:04:11                  |
| virtual_size               | None                                 |
+----------------------------+--------------------------------------+
[ 360.0] Finishing off

3. Login openstack server and try to import.

Actual results:
Import guest image file failed:
File "/usr/lib/python2.7/site-packages/nova/scheduler/filter_scheduler.py", line 108, in schedule_run_instance raise exception.NoValidHost(reason="") 

Expected results:
Import guest successfully.

Additional info:
1. Will attach nova-scheduler.log.

Comment 2 Richard W.M. Jones 2014-11-07 11:21:46 UTC
Hey Dan:

Do you know if we are disabling the rtl8139 driver in RHOS?

Comment 3 Richard W.M. Jones 2014-11-07 11:23:15 UTC
I should note that when Junquin looked into one of the Nova
log files, she found:

u"UnsupportedHardware: Requested hardware 'rtl8139' is not supported by the 'kvm' virt driver\n"

which is the reason we think the NIC specifically is to blame here.

Comment 4 Richard W.M. Jones 2014-11-07 11:24:11 UTC
Urrggh, I'm stupid.  Spot the deliberate error:

| Property 'hw_disk_bus'     | rtl8139                              |
| Property 'hw_vif_model'    | ide                                  |

Comment 6 Kashyap Chamarthy 2014-11-07 12:45:11 UTC
(In reply to Richard W.M. Jones from comment #2)
> Hey Dan:
> 
> Do you know if we are disabling the rtl8139 driver in RHOS?


I'll let Dan reply, but I saw this from RHOS (and upstream) Nova code:

commit 40f3724bec5cc9883af7597af6c33c480b7d3c97
Author: Daniel P. Berrange <berrange>
Date:   Mon Dec 17 15:04:18 2012 +0000

    Make libvirt driver default to virtio for KVM/QEMU NICs
    
    Currently users of KVM/QEMU must set libvirt_use_virtio_for_bridges
    to true to get a virtio based NIC, instead of the awful rtl8139
    that QEMU defaults to.
    
    Switch libvirt_use_virtio_for_bridges to default to enabled, but
    ensure it only takes effect if libvirt_type is 'kvm' or 'qemu'.
    
    Although it is possible that some guest OS do not support virtio
    drivers, currently Nova hardcodes use of 'virtio' for disks, so
    this change doesn't make the current guest OS support situation
    worse.
    
    Obviously in the future, both NIC & disk models will have to be
    made fully configurable
    
    Change-Id: I7c0d306921f554ac2d06b5bdb1f9017ab7f9c643
    Signed-off-by: Daniel P. Berrange <berrange>

Comment 8 zhoujunqin 2014-11-14 03:07:42 UTC
Try to verify this bug with new build:

steps:
1. Convert a guest with no virtio driver installed on it:

# virt-v2v -i disk /var/lib/libvirt/images/win2k8r2.qcow2  -o glance
[   0.0] Opening the source -i disk /var/lib/libvirt/images/win2k8r2.qcow2
[   0.0] Creating an overlay to protect the source from being modified
[   0.0] Opening the overlay
[  67.0] Initializing the target -o glance
[  67.0] Inspecting the overlay
[  69.0] Checking for sufficient free disk space in the guest
[  69.0] Estimating space required on target for each disk
[  69.0] Converting Windows Server 2008 R2 Standard to run on KVM
virt-v2v: warning: there are no virtio drivers available for this version 
of Windows (6.1 x86_64 Server).  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.
[  69.0] Mapping filesystem data to avoid copying unused and blank areas
[  71.0] Closing the overlay
[  71.0] Copying disk 1/1 to /var/tmp/glance.Q9Dlvs/sda (qcow2)
    (100.00/100%)
[ 271.0] Creating output metadata
+------------------+--------------------------------------+
| Property         | Value                                |
+------------------+--------------------------------------+
| checksum         | 22cd71522c311443817ddd31b094310d     |
| container_format | bare                                 |
| created_at       | 2014-11-14T02:03:49                  |
| deleted          | False                                |
| deleted_at       | None                                 |
| disk_format      | qcow2                                |
| id               | c8419c0e-0fec-4042-8393-03e4ebb2fca9 |
| is_public        | False                                |
| min_disk         | 0                                    |
| min_ram          | 0                                    |
| name             | win2k8r2                             |
| owner            | c3a9c07d56aa401b84da161f28cfc06f     |
| protected        | False                                |
| size             | 6986596352                           |
| status           | active                               |
| updated_at       | 2014-11-14T02:05:09                  |
| virtual_size     | None                                 |
+------------------+--------------------------------------+
+----------------------------+--------------------------------------+
| Property                   | Value                                |
+----------------------------+--------------------------------------+
| Property 'architecture'    | x86_64                               |
| Property 'hw_disk_bus'     | ide                                  |
| Property 'hw_vif_model'    | rtl8139                              |
| Property 'hypervisor_type' | kvm                                  |
| Property 'os_distro'       | windows                              |
| Property 'os_type'         | windows                              |
| Property 'os_version'      | 6.1                                  |
| Property 'vm_mode'         | hvm                                  |
| checksum                   | 22cd71522c311443817ddd31b094310d     |
| container_format           | bare                                 |
| created_at                 | 2014-11-14T02:03:49                  |
| deleted                    | False                                |
| deleted_at                 | None                                 |
| disk_format                | qcow2                                |
| id                         | c8419c0e-0fec-4042-8393-03e4ebb2fca9 |
| is_public                  | False                                |
| min_disk                   | 0                                    |
| min_ram                    | 2048                                 |
| name                       | win2k8r2                             |
| owner                      | c3a9c07d56aa401b84da161f28cfc06f     |
| protected                  | False                                |
| size                       | 6986596352                           |
| status                     | active                               |
| updated_at                 | 2014-11-14T02:05:10                  |
| virtual_size               | None                                 |
+----------------------------+--------------------------------------+
[ 353.0] Finishing off


Result: conversion finished successfully.
and this part showing is right now:
| Property 'hw_disk_bus'     | ide                                  |
| Property 'hw_vif_model'    | rtl8139                              |

2. Launch images on openstack server and instance can boot up successfully.
3. Always test with win7 guest, can pass also.

See above steps, move this bug from ON_QA to VERIFIED.

Comment 9 zhoujunqin 2014-11-14 03:15:04 UTC
(In reply to zhoujunqin from comment #8)
> Try to verify this bug with new build:
Sorry for forgetting package version, the verification version is:

virt-v2v-1.28.1-1.10.el7.x86_64
libguestfs-1.28.1-1.10.el7.x86_64

Comment 11 errata-xmlrpc 2015-03-05 13:47:15 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