Bug 2035177

Summary: v2v conversion is failed with PCI: slot 2 function 0 not available for virtio-scsi-pci, in use by virtio-net-pci [code=1 int1=-1]
Product: Red Hat Enterprise Linux 8 Reporter: Xiaodai Wang <xiaodwan>
Component: libguestfsAssignee: Richard W.M. Jones <rjones>
Status: CLOSED ERRATA QA Contact: YongkuiGuo <yoguo>
Severity: urgent Docs Contact:
Priority: urgent    
Version: 8.6CC: chhu, coli, hongzliu, jen, jinzhao, juzhang, juzhou, kkiwi, lersek, mxie, mzhan, rjones, tyan, tzheng, virt-maint, vwu, xiaodwan, ymankad, yoguo
Target Milestone: rcKeywords: Regression, TestBlocker, Triaged
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard:
Fixed In Version: libguestfs-1.44.0-5.module+el8.6.0+13732+b2b9b31d Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 2034160 Environment:
Last Closed: 2022-05-10 13:24:21 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:
Bug Depends On: 2034160    
Bug Blocks:    

Description Xiaodai Wang 2021-12-23 07:44:17 UTC
Clone it to RHEL8.6.

+++ This bug was initially created as a clone of Bug #2034160 +++

Description of problem:
v2v conversion is failed with PCI: slot 2 function 0 not available for virtio-scsi-pci, in use by virtio-net-pci [code=1 int1=-1]


Version-Release number of selected component (if applicable):
qemu-img-6.2.0-1.el9.x86_64
virt-v2v-1.45.95-1.el9.x86_64
libvirt-libs-7.10.0-1.el9.x86_64

How reproducible:
100%

Steps to Reproduce:
1.Convert a guest from VMware by v2v
# virt-v2v -ic vpx://root.73.141/data/10.73.196.89/?no_verify=1 -it vddk -io vddk-libdir=/home/vddk6.7 -io vddk-thumbprint=1F:97:34:5F:B6:C2:BA:66:46:CB:1A:71:76:7D:6B:50:1E:03:00:EA   -ip /home/passwd  -o rhv-upload -oc https://dell-per740-22.lab.eng.pek2.redhat.com/ovirt-engine/api  -op /home/rhvpasswd  -os nfs_data -b ovirtmgmt esx6.5-win11-x86_64 -v -x ^C
[root@dell-per740-53 ~]# virt-v2v -ic vpx://root.198.169/data/10.73.199.217/?no_verify=1 -it vddk -io vddk-libdir=/home/vddk7.0.2 -io  vddk-thumbprint=B5:52:1F:B4:21:09:45:24:51:32:56:F6:63:6A:93:5D:54:08:2D:78  -ip /home/passwd  -o rhv-upload -oc https://dell-per740-22.lab.eng.pek2.redhat.com/ovirt-engine/api  -op /home/rhvpasswd  -os nfs_data -b ovirtmgmt esx7.0-win11-x86_64  
[  22.4] Opening the source
virt-v2v: error: libguestfs error: could not create appliance through 
libvirt.

Try running qemu directly without libvirt using this environment variable:
export LIBGUESTFS_BACKEND=direct

Original error from libvirt: internal error: qemu unexpectedly closed the 
monitor: 2021-12-20T03:46:39.698837Z qemu-kvm: -device 
{"driver":"virtio-scsi-pci","id":"scsi0","bus":"pci.0","addr":"0x2"}: PCI: 
slot 2 function 0 not available for virtio-scsi-pci, in use by 
virtio-net-pci [code=1 int1=-1]

If reporting bugs, run virt-v2v with debugging enabled and include the 
complete output:

  virt-v2v -v -x [...]

Actual results:


Expected results:
As above description

Additional info:
1.Can't reproduce the bug with qemu-img-6.1.0-8.el9.x86_64, so this is a regression bug
# rpm -q qemu-img
qemu-img-6.1.0-8.el9.x86_64

# virt-v2v -ic vpx://root.198.169/data/10.73.199.217/?no_verify=1 -it vddk -io vddk-libdir=/home/vddk7.0.2 -io  vddk-thumbprint=B5:52:1F:B4:21:09:45:24:51:32:56:F6:63:6A:93:5D:54:08:2D:78  -ip /home/passwd  -o rhv-upload -oc https://dell-per740-22.lab.eng.pek2.redhat.com/ovirt-engine/api  -op /home/rhvpasswd  -os nfs_data -b ovirtmgmt esx7.0-win11-x86_64  
[  22.3] Opening the source
[  29.4] Inspecting the source
[  35.1] Checking for sufficient free disk space in the guest
[  35.1] Converting Windows 10 Enterprise to run on KVM
virt-v2v: This guest has virtio drivers installed.
[  39.9] Mapping filesystem data to avoid copying unused and blank areas
[  41.4] Closing the overlay
[  41.7] Assigning disks to buses
[  41.7] Checking if the guest needs BIOS or UEFI to boot
[  41.7] Copying disk 1/1

Comment 3 Richard W.M. Jones 2021-12-23 08:29:30 UTC
> 1. What is the scope of harm if this BZ is not resolved in this release?  Reviewers want to know which RHEL features or customers are affected and if it will impact any Layered Product or Hardware partner plans.

Everything related to virt-v2v & libguestfs will be broken.  We need to fix whatever
is the issue.

> 2. What are the risks associated with resolving this BZ?  Reviewers want to know the scope of retesting, potential regressions

Retesting, but nothing else.

> 3. Provide any other details that meet blocker criteria or should be weighed in making a decision (Other releases affected, upstream status, business impacts, etc).

See discussion in https://bugzilla.redhat.com/show_bug.cgi?id=2034160 since
it seems to be caused by the same issue (upgrading to qemu 6.2).

Comment 4 Richard W.M. Jones 2021-12-23 11:34:15 UTC
Same comment as here:
https://bugzilla.redhat.com/show_bug.cgi?id=2034160#c35

"I ACKed the patch.  Do you want to do the build?  If it's urgent and you can't
do it then I could do it today, but would prefer to wait until Jan.  There is
a workaround (downgrading to qemu 6.1) but that's not too nice because we
ought to be testing if there are any other problems with 6.2."

Comment 6 YongkuiGuo 2021-12-27 06:22:14 UTC
Reproduce with packages:
libguestfs-1.44.0-4.module+el8.6.0+12969+f61072d9.x86_64
qemu-kvm-6.2.0-1.module+el8.6.0+13725+61ae1949.x86_64

Steps:

1. On rhel8.6 host
# guestfish --network run
libguestfs: error: could not create appliance through libvirt.

Try running qemu directly without libvirt using this environment variable:
export LIBGUESTFS_BACKEND=direct

Original error from libvirt: internal error: qemu unexpectedly closed the monitor: 2021-12-27T06:09:49.081270Z qemu-kvm: -device {"driver":"virtio-scsi-pci","id":"scsi0","bus":"pci.0","addr":"0x2"}: PCI: slot 2 function 0 not available for virtio-scsi-pci, in use by virtio-net-pci [code=1 int1=-1]

2.
# virt-customize -a RHEL-Server-8.3.0-64-hvm.raw --mkdir /root/test1
[   0.0] Examining the guest ...
virt-customize: error: libguestfs error: could not create appliance through 
libvirt.

Try running qemu directly without libvirt using this environment variable:
export LIBGUESTFS_BACKEND=direct

Original error from libvirt: internal error: qemu unexpectedly closed the 
monitor: 2021-12-27T06:12:02.108822Z qemu-kvm: -device 
{"driver":"virtio-scsi-pci","id":"scsi0","bus":"pci.0","addr":"0x2"}: PCI: 
slot 2 function 0 not available for virtio-scsi-pci, in use by 
virtio-net-pci [code=1 int1=-1]



Test with fixed packages:
libguestfs-1.44.0-5.module+el8.6.0+13732+b2b9b31d.x86_64
qemu-kvm-6.2.0-1.module+el8.6.0+13725+61ae1949.x86_64


Steps:

1.
# guestfish --network run 

2.
# virt-customize -a RHEL-Server-8.3.0-64-hvm.raw --mkdir /root/test1
[   0.0] Examining the guest ...
[   6.4] Setting a random seed
[   6.4] Making directory: /root/test1
[   6.5] Finishing off

No error output

Comment 7 YongkuiGuo 2021-12-28 02:29:36 UTC
Reset Verified:Tested as errata_automation bot ran into issues.

Comment 8 YongkuiGuo 2021-12-28 03:18:12 UTC
Seems the errata_automation bot needs a whole fixed version.

Comment 11 YongkuiGuo 2022-01-20 03:25:58 UTC
Verified this bug since it is fixed when running libguestfs autotest with the latest RHEL9 compose

Comment 14 errata-xmlrpc 2022-05-10 13:24:21 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 (Moderate: virt:rhel and virt-devel:rhel security, bug fix, and enhancement update), 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/RHSA-2022:1759