Bug 1637410

Summary: KVM VM import failed when source or destination NFS version is lower than NFSv4.2 (no fallback from sparse streams to non-sparse)
Product: [oVirt] vdsm Reporter: Nisim Simsolo <nsimsolo>
Component: GeneralAssignee: Steven Rosenberg <srosenbe>
Status: CLOSED CURRENTRELEASE QA Contact: Nisim Simsolo <nsimsolo>
Severity: high Docs Contact:
Priority: unspecified    
Version: 4.20.23CC: bugs, lveyde, michal.skrivanek, nsimsolo, rbarry
Target Milestone: ovirt-4.2.7Keywords: Regression
Target Release: ---Flags: rule-engine: ovirt-4.2+
rule-engine: blocker+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: vdsm v4.20.43 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-11-02 14:29:29 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Virt RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1628477    
Attachments:
Description Flags
vdsm.log
none
import.log none

Description Nisim Simsolo 2018-10-09 08:41:49 UTC
Description of problem:
When importing KVM VM with NFS 4.1 (or lower) or the destination NFS is lower than 4.2, the import failed with the next import.log error: 

Traceback (most recent call last):
  File "/usr/libexec/vdsm/kvm2ovirt", line 22, in <module>
    kvm2ovirt.main()
  File "/usr/lib/python2.7/site-packages/vdsm/kvm2ovirt.py", line 247, in main
    handle_volume(con, diskno, src, dst, options)
  File "/usr/lib/python2.7/site-packages/vdsm/kvm2ovirt.py", line 192, in handle_volume
    options.bufsize)
  File "/usr/lib/python2.7/site-packages/vdsm/kvm2ovirt.py", line 160, in download_disk_sparse
    stream.finish()
  File "/usr/lib64/python2.7/site-packages/libvirt.py", line 5905, in finish
    if ret == -1: raise libvirtError ('virStreamFinish() failed')
libvirt.libvirtError: Unable to seek to data: Operation not supported
-----------------------------

Since sparse is supported only from NFSv4.2 (https://tools.ietf.org/html/draft-ietf-nfsv4-minorversion2-39#section-1.3) there should be a fall back from sparse to non-sparse method in order to complete the import. 

Version-Release number of selected component (if applicable):
ovirt-engine-4.2.7.2-0.1.el7ev
vdsm-4.20.42-1.el7ev.x86_64
libvirt-client-4.5.0-10.el7.x86_64
qemu-kvm-rhev-2.12.0-18.el7.x86_64
sanlock-3.6.0-1.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
1. Import KVM VM with source NFS lower than NFSv4.2, or with destination NFS lower than NFSv4.2
2.
3.

Actual results:
Import failed.

Expected results:
in case of sparse stream failure, import should continue with the old method of importing VM from KVM. 

Additional info:
vdsm.log and import.log attached.

Comment 1 Nisim Simsolo 2018-10-09 08:43:21 UTC
Created attachment 1491993 [details]
vdsm.log

Comment 2 Nisim Simsolo 2018-10-09 08:43:46 UTC
Created attachment 1491994 [details]
import.log

Comment 3 Nisim Simsolo 2018-10-16 11:24:36 UTC
verified_upstream:
RHV env: 
ovirt-engine-4.2.7.3-0.0.master.20181012152958.gitfc1595b.el7
vdsm-4.20.42-5.gita80c592.el7.x86_64
qemu-kvm-rhev-2.12.0-18.el7_6.1.x86_64
libvirt-client-4.5.0-10.el7.x86_64
sanlock-3.6.0-1.el7.x86_64

KVM env 1:
libvirt-3.2.0-14.el7.x86_64

KVM env 2:
libvirt-4.5.0-10.el7.x86_64

1. Verified import of KVM VM when libvirt version is < 3.4.0 and NFS version is NFSv4.1
2. Verified import of KVM VM when libvirt version is > 3.4.0 and NFS version is NFSv4.1
3. Verified import of KVM VM when libvirt version is < 3.4.0 and NFS version is NFSv4.2
4. Verifed import of KVM VM is using libvirt sparse stream when libvirt version is > 3.4.0 and NFS version is NFSv4.2.

Comment 4 Raz Tamir 2018-10-18 11:49:06 UTC
QE verification bot: the bug was verified upstream

Comment 5 Sandro Bonazzola 2018-11-02 14:29:29 UTC
This bugzilla is included in oVirt 4.2.7 release, published on November 2nd 2018.

Since the problem described in this bug report should be
resolved in oVirt 4.2.7 release, it has been closed with a resolution of CURRENT RELEASE.

If the solution does not work for you, please open a new bug report.