Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1636042

Summary: KVM VM import failed when libvirt version in KVM server is older than 3.4.0 (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: urgent Docs Contact:
Priority: unspecified    
Version: 4.20.23CC: bugs, lsurette, lveyde, michal.skrivanek, nsimsolo, rbarry, srevivo, srosenbe, ycui
Target Milestone: ovirt-4.2.7Flags: rule-engine: ovirt-4.2+
rule-engine: blocker+
Target Release: ---   
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:32:32 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
libvirtd.log
none
import log 1
none
import log 2 none

Description Nisim Simsolo 2018-10-04 10:32:50 UTC
Description of problem:
When trying to import KVM VM and the KVM server is not RHEL 7.6 (in my case, RHEL 7.4 and libvirt-3.2.0-14.el7.x86_64), 
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 188, in handle_volume
    libvirt.VIR_STORAGE_VOL_DOWNLOAD_SPARSE_STREAM)
  File "/usr/lib64/python2.7/site-packages/libvirt.py", line 3416, in download
    if ret == -1: raise libvirtError ('virStorageVolDownload() failed', vol=self)
libvirt.libvirtError: unsupported flags (0x1) in function storageVolDownload
-----------------------

In such case, 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):
RHV environment:
ovirt-engine-4.2.7.1-0.1.el7ev
vdsm-4.20.40-1.el7ev.x86_64
qemu-kvm-rhev-2.12.0-18.el7.x86_64
libvirt-client-4.5.0-10.el7.x86_64
sanlock-3.6.0-1.el7.x86_64

KVM server: 
RHEL 7.4
libvirt-3.2.0-14.el7.x86_64
qemu-kvm-1.5.3-141.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
1. Import KVM VM from KVM environment with libvirt version older than 3.4.0
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 (look at 2018-10-04 10:27:36,054+0300), libvirt.log (in debug level) and import.log attached

Comment 1 Nisim Simsolo 2018-10-04 10:37:49 UTC
Created attachment 1490455 [details]
vdsm.log

Comment 2 Nisim Simsolo 2018-10-04 10:38:23 UTC
Created attachment 1490456 [details]
libvirtd.log

Comment 3 Nisim Simsolo 2018-10-04 10:38:47 UTC
Created attachment 1490457 [details]
import log 1

Comment 4 Nisim Simsolo 2018-10-04 10:39:19 UTC
Created attachment 1490459 [details]
import log 2

Comment 5 Michal Skrivanek 2018-10-04 11:20:27 UTC
steven, you should probably add some basic version check to kvm2ovirt

Comment 6 Steven Rosenberg 2018-10-15 11:37:52 UTC
There is a patch that referrers to this issue and a more complete one for the Storage Domains that do not support Sparseness: https://bugzilla.redhat.com/show_bug.cgi?id=1637410

Comment 7 Nisim Simsolo 2018-10-16 11:24:04 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 8 Raz Tamir 2018-10-18 11:49:24 UTC
QE verification bot: the bug was verified upstream

Comment 9 Sandro Bonazzola 2018-11-02 14:32:32 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.