Bug 2125556

Summary: Guests won't have network after v2v conversion if source vmware guest's network is attached to standard switch but no entry 'ethernet0.networkName'
Product: Red Hat Enterprise Linux 9 Reporter: mxie <mxie>
Component: virt-v2vAssignee: Virtualization Maintenance <virt-maint>
Status: CLOSED MIGRATED QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 9.1CC: chhu, hongzliu, juzhou, lersek, mzhan, rjones, tyan, tzheng, vwu, xiaodwan
Target Milestone: rcKeywords: MigratedToJIRA, Triaged
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-07-07 19:20:04 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
guest-has-no-network-after-conversion.png none

Description mxie@redhat.com 2022-09-09 09:53:22 UTC
Created attachment 1910638 [details]
guest-has-no-network-after-conversion.png

Description of problem:
Guests won't have network after v2v conversion if source vmware guest's network is attached to standard switch but no entry 'ethernet0.networkName'

Version-Release number of selected component (if applicable):
virt-v2v-2.0.7-6.el9.x86_64
libguestfs-1.48.4-2.el9.x86_64
libvirt-libs-8.7.0-1.el9.x86_64
qemu-img-7.1.0-1.el9.x86_64
nbdkit-server-1.30.8-1.el9.x86_64
libnbd-1.12.6-1.el9.x86_64
guestfs-tools-1.48.2-5.el9.x86_64



How reproducible:
100%

Steps to Reproduce:
1. Prepare a VMware guest and assign a network which is connected to a standard switch of ESXi host to the guest, but the guest vmx file doesn't have entry 
'ethernet0.networkName' 

#cat esx7.0-rhel9.1-x86_64-uefi-without-secureboot.vmx |grep ethernet
ethernet0.virtualDev = "vmxnet3"
ethernet0.addressType = "vpx"
ethernet0.generatedAddress = "00:50:56:96:4d:83"
ethernet0.uptCompatibility = "TRUE"
ethernet0.present = "TRUE"
ethernet0.pciSlotNumber = "192"
ethernet0.exposeLargeBAR = "TRUE"

2. Use virsh to dump the guest xml from VMware
#   virsh -c vpx://root.213.107/data/10.73.212.38/?no_verify=1 dumpxml Auto-esx7.0-rhel9.1-x86_64-uefi-without-network-name
Enter root's password for 10.73.213.107: 
<domain type='vmware' xmlns:vmware='http://libvirt.org/schemas/domain/vmware/1.0'>
  <name>Auto-esx7.0-rhel9.1-x86_64-uefi-without-network-name</name>
....
    <interface type='null'>
      <mac address='00:50:56:96:4d:83' type='generated'/>
      <model type='vmxnet3'/>
    </interface>
.....


3. Convert the guest from VMware to rhv by v2v
virt-v2v -ic vpx://root.213.107/data/10.73.212.38/?no_verify=1 -it vddk -io vddk-libdir=/home/vddk7.0.3 -io  vddk-thumbprint=87:F9:29:E7:33:DE:34:68:74:3F:6A:C9:61:96:C3:51:E2:1E:EA:2B -o rhv-upload -oc https://dell-per740-22.lab.eng.pek2.redhat.com/ovirt-engine/api  -op /home/rhvpasswd  -os nfs_data -ip /home/passwd Auto-esx7.0-rhel9.1-x86_64-uefi-without-network-name --mac 00:50:56:96:4d:83:bridge:ovirtmgmt -v -x |& tee > v2v-convert-guest-with-standard-switch-no-entry-network-name.log
█ 100% [****************************************]

4. Check the guest after conversion, found guest has no network, pls refer to attached screenshot

Actual results:
As above description

Expected results:
Guests have network after v2v conversion or v2v gives a warning about network during conversion if source vmware guest's network is attched to standard switch but no entry 'ethernet0.networkName'

Additional info:

Comment 2 mxie@redhat.com 2022-09-23 03:54:07 UTC
How to create a vmware guest's network is attached to standard switch but no entry 'ethernet0.networkName' 

1. Use 'Remove from inventory' to remove a guest from ESXi host on vsphere web client
2. Edit vmx file of above vmware guest to delete entry 'ethernet0.networkName' on the server where vmware guest files are stored
3. Register a new guest from above edited vmx file on vsphere web client, then can find network name is empty in guest's settings, pls refer to screenshot 'vmware-guest-without-network-name.png'

Comment 4 Laszlo Ersek 2022-09-23 07:53:23 UTC
(In reply to mxie from comment #2)

> 2. Edit vmx file of above vmware guest to delete entry
> 'ethernet0.networkName' on the server where vmware guest files are stored

Is this a valid / supported configuration step (by vmware), or does it just work by chance / luck?

What is the purpose of this step? What goal does it serve for a normal vmware user?

Thanks!

Comment 5 mxie@redhat.com 2022-09-23 08:54:01 UTC
(In reply to Laszlo Ersek from comment #4)
> (In reply to mxie from comment #2)
> 
> > 2. Edit vmx file of above vmware guest to delete entry
> > 'ethernet0.networkName' on the server where vmware guest files are stored
> 
> Is this a valid / supported configuration step (by vmware), or does it just
> work by chance / luck?
> 
> What is the purpose of this step? What goal does it serve for a normal
> vmware user?
> 
> Thanks!

This is just the way I used to reproduce the bug, in actual customer scenarios, the network name of vmware guest can be empty without editing vmx file. Such as, our another ESXi7.0 host has both standard switch and distributed switch, then open the setting of a guest on this ESXi7.0 host, add a new network device, don't select any network, setting can be saved successfully even if network name is empty. I can send you the VMware env info by mail if you want to try this scenario.

Comment 6 Laszlo Ersek 2022-09-23 09:57:25 UTC
Thanks for explaining!