Bug 1257895
| Summary: | [RHEV][V2V] virt-v2v ignores NIC if interface source/@network or source/@bridge is an empty string | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 7 | Reporter: | Anand Nande <anande> |
| Component: | libguestfs | Assignee: | Richard W.M. Jones <rjones> |
| Status: | CLOSED ERRATA | QA Contact: | Virtualization Bugs <virt-bugs> |
| Severity: | high | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 7.2 | CC: | aperotti, juzhou, mxie, mzhan, ptoscano, tzheng, xiaodwan |
| Target Milestone: | rc | ||
| Target Release: | --- | ||
| Hardware: | x86_64 | ||
| OS: | Linux | ||
| Whiteboard: | V2V | ||
| Fixed In Version: | libguestfs-1.28.1-1.50.el7 | Doc Type: | Bug Fix |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2015-11-19 07:03:20 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
Anand Nande
2015-08-28 10:59:11 UTC
What's happening is the source guest has a network interface defined:
<interface type='bridge'>
<mac address='xx:xx:xx:xx:xx:xx'/>
<source bridge=''/>
<model type='vmxnet3'/>
</interface>
but because the <source bridge=''/> attribute is an empty string
that hits a corner case in the code where it ignores the interface
completely.
Here's a small reproducer of the bug:
$ cat > vnic.xml <<"EOF"
<domain type='vmware'>
<name>BZ1257895</name>
<devices>
<disk type='file' device='disk'>
<source file='/dev/null'/>
<target dev='sda' bus='scsi'/>
</disk>
<interface type='bridge'>
<mac address='00:01:02:03:04:05:06'/>
<source bridge=''/>
</interface>
</devices>
</domain>
EOF
$ virt-v2v -i libvirtxml vnic.xml -o null --print-source
[ 0.0] Opening the source -i libvirtxml vnic.xml
Source guest information (--print-source option):
source name: BZ1257895
hypervisor type: vmware
memory: 1073741824 (bytes)
nr vCPUs: 1
CPU features:
firmware: unknown
display:
sound:
disks:
/dev/null [scsi]
removable media:
NICs:
Notice that the 'NICs' section is empty. It should contain 1 NIC.
After applying those patches, the output of the reproducer (comment 3) is: [ 0.0] Opening the source -i libvirtxml vnic.xml Source guest information (--print-source option): source name: BZ1257895 hypervisor type: vmware memory: 1073741824 (bytes) nr vCPUs: 1 CPU features: firmware: unknown display: sound: disks: /dev/null [scsi] removable media: NICs: Bridge "eth0" mac: 00:01:02:03:04:05:06 Note the "eth0" network interface has appeared. Upstream commits: 00e1260d343e1f70d6541347ba61ecb072fef799 261d05749fb75e60d56d3c2d92589de9dca7ca09 18b019e3dd808393cda510b6d80212ff5bdbed76 I can reproduce this bug with:
libguestfs-1.28.1-1.49.el7.x86_64
virt-v2v-1.28.1-1.49.el7.x86_64
1.Prepare a guest with network source as empty.
<interface type='network'>
<mac address='52:54:00:22:b6:17'/>
<source network=''/>
<model type='virtio'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
</interface>
# virt-v2v -o null --print-source rhel7.2
[ 0.0] Opening the source -i libvirt rhel7.2
Source guest information (--print-source option):
source name: rhel7.2
hypervisor type: kvm
memory: 1073741824 (bytes)
nr vCPUs: 1
CPU features: apic,acpi
firmware: unknown
display: spice
sound: ich6
disks:
/var/lib/libvirt/images/rhel7.2.qcow2 (qcow2) [virtio]
removable media:
NICs:
2.Use virt-v2v to convert the above guest to rhev.
3.Import the guest to rhev,there is no network showed.
Tested the bug with
libguestfs-1.28.1-1.51.el7.x86_64
virt-v2v-1.28.1-1.51.el7.x86_64
# virt-v2v -o null --print-source rhel7.2
[ 0.0] Opening the source -i libvirt rhel7.2
Source guest information (--print-source option):
source name: rhel7.2
hypervisor type: kvm
memory: 1073741824 (bytes)
nr vCPUs: 1
CPU features: apic,acpi
firmware: unknown
display: spice
sound: ich6
disks:
/var/lib/libvirt/images/rhel7.2.qcow2 (qcow2) [virtio]
removable media:
NICs:
Network "eth0" mac: 52:54:00:22:b6:17
Tried the above steps with bridge type of interface,the NICs can show network.
Use virt-v2v to convert guest to rhev,network shows in rhev GUI.
Refer to the above comments,move this 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/RHBA-2015-2183.html |