Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 2066655

Summary: nbdkit: vddk[1]: error: plugin must set preferred block size to a power of 2 (only with VDDK < 7)
Product: Red Hat Enterprise Linux 9 Reporter: Xiaodai Wang <xiaodwan>
Component: nbdkitAssignee: Richard W.M. Jones <rjones>
Status: CLOSED ERRATA QA Contact: Xiaodai Wang <xiaodwan>
Severity: high Docs Contact:
Priority: high    
Version: 9.1CC: eblake, kkiwi, lersek, mxie, rjones, tyan, tzheng, virt-maint, vwu
Target Milestone: rcKeywords: Automation, Regression, Triaged
Target Release: ---Flags: pm-rhel: mirror+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: nbdkit-1.30.8-1.el9 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-11-15 09:50:17 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 Xiaodai Wang 2022-03-22 09:47:20 UTC
Description of problem:
nbdkit: vddk[1]: error: plugin must set preferred block size to a power of 2

Version-Release number of selected component (if applicable):
virt-v2v-2.0.0-2.el9.x86_64
nbdkit-server-1.30.1-1.el9.x86_64

How reproducible:
100%

Steps to Reproduce:
Convert a guest by vddk6.7 from vmware.

# virt-v2v -ic vpx://root.x.x/data/x.x.x.x/?no_verify=1 -o null -of raw esx6.5-rhel8.5-x86_64 -it vddk -io vddk-libdir=/root/vddk_libdir/latest -io vddk-thumbprint=1F:97:34:5F:B6:C2:BA:66:46:CB:1A:71:76:7D:6B:50:1E:03:00:EA -on esx6.5-rhel8.5-x86_64Qvo -ip /root/v2v_vpx_passwd
[   0.0] Setting up the source: -i libvirt -ic vpx://root.x.x/data/x.x.x.x/?no_verify=1 -it vddk esx6.5-rhel8.5-x86_64
[   2.0] Opening the source
nbdkit: vddk[1]: error: plugin must set preferred block size to a power of 2
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: process exited while 
connecting to monitor: 2022-03-22T09:42:30.316853Z qemu-kvm: -blockdev 
{"driver":"nbd","server":{"type":"unix","path":"/tmp/v2v.4jZ9G1/in0"},"node-name":"libvirt-2-storage","cache":{"direct":false,"no-flush":true},"auto-read-only":true,"discard":"unmap"}: 
Requested export not available [code=1 int1=-1]

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

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

Actual results:
As the description

Expected results:
v2v should run successfully.

Additional info:

Comment 2 Klaus Heinrich Kiwi 2022-03-22 10:50:38 UTC
Looks like a simple regression, where in recent versions we may need to provide alignment to the underlying libnbd layer?

Assigning to Rich since he's probably familiar with what is needed, but feel free to re-assign if Eric or Laszlo can take this as an opportunity to learn more about v2v-modular.

Comment 3 Richard W.M. Jones 2022-03-22 11:16:22 UTC
Oops, using unitialized memory ...

Fixed in:
https://gitlab.com/nbdkit/nbdkit/-/commit/31bc5322b179545bef827022e1ae3b7859387b1b

As this is quite serious I'll do a build now.
This doesn't affect RHEL 9.0.

Comment 4 Xiaodai Wang 2022-03-22 13:51:45 UTC
The new nbdkit-server-1.30.1-2.el9.x86_64 works well.

# virt-v2v -ic vpx://root@<ip>/data/<ip>/?no_verify=1 -o null -of raw esx6.5-rhel8.5-x86_64 -it vddk -io vddk-libdir=/root/vddk_libdir/latest -io vddk-thumbprint=1F:97:34:5F:B6:C2:BA:66:46:CB:1A:71:76:7D:6B:50:1E:03:00:EA -on esx6.5-rhel8.5-x86_64Qvo -ip /root/v2v_vpx_passwd
[   0.0] Setting up the source: -i libvirt -ic vpx://root.73.141/data/10.73.196.89/?no_verify=1 -it vddk esx6.5-rhel8.5-x86_64
[   1.8] Opening the source
[  10.1] Inspecting the source
[  16.8] Checking for sufficient free disk space in the guest
[  16.8] Converting Red Hat Enterprise Linux 8.5 (Ootpa) to run on KVM
virt-v2v: This guest has virtio drivers installed.
[  82.6] Mapping filesystem data to avoid copying unused and blank areas
[  83.2] Closing the overlay
[  83.4] Assigning disks to buses
[  83.4] Checking if the guest needs BIOS or UEFI to boot
[  83.4] Setting up the destination: -o null
[  88.6] Copying disk 1/1
█ 100% [****************************************]
[1849.0] Creating output metadata
[1849.0] Finishing off

Comment 7 Xiaodai Wang 2022-03-23 04:18:05 UTC
The script can run successfully by nbdkit-server-1.30.1-2.el9.x86_64.

# avocado run --vt-type v2v --vt-machine-type q35 convert_vm_to_ovirt.esx.vm.6_5.linux.latest8.arch_x86_64.raw_f.NFS.rhv_upload.rhv_direct.rhv_verifypeer.preallocated.it_vddk
JOB ID     : 3ed1032fd2536d2825dae82212b167b1d6178fde
JOB LOG    : /root/avocado/job-results/job-2022-03-22T23.10-3ed1032/job.log
 (1/1) type_specific.io-github-autotest-libvirt.convert_vm_to_ovirt.esx.vm.6_5.linux.latest8.arch_x86_64.raw_f.NFS.rhv_upload.rhv_direct.rhv_verifypeer.preallocated.it_vddk: STARTED
█ 100% [****************************************]
 (1/1) type_specific.io-github-autotest-libvirt.convert_vm_to_ovirt.esx.vm.6_5.linux.latest8.arch_x86_64.raw_f.NFS.rhv_upload.rhv_direct.rhv_verifypeer.preallocated.it_vddk: PASS (1947.97 s)
RESULTS    : PASS 1 | ERROR 0 | FAIL 0 | SKIP 0 | WARN 0 | INTERRUPT 0 | CANCEL 0
JOB TIME   : 1948.89 


So move the bug to VERIFIED.

Comment 11 errata-xmlrpc 2022-11-15 09:50:17 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 (nbdkit 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/RHBA-2022:7945