Bug 1661070 - KVM import fails if doing sparse disk to block storage
Summary: KVM import fails if doing sparse disk to block storage
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: vdsm
Version: 4.2.7
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: ---
: ---
Assignee: Dan Kenigsberg
QA Contact: Lukas Svaty
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-12-20 03:33 UTC by Germano Veit Michel
Modified: 2018-12-20 03:50 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-12-20 03:49:36 UTC
oVirt Team: Virt
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Knowledge Base (Solution) 3766471 0 None None None 2018-12-20 03:50:38 UTC

Description Germano Veit Michel 2018-12-20 03:33:30 UTC
Description of problem:

Importing from KVM to RHV fails:

2018-12-20 12:52:39,255+1000 ERROR (v2v/f5c91f71) [root] Job u'f5c91f71-19d0-4381-805e-58f0d2f7b094' failed (v2v:865)
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/vdsm/v2v.py", line 860, in _run
    self._import()
  File "/usr/lib/python2.7/site-packages/vdsm/v2v.py", line 879, in _import
    self._watch_process_output()
  File "/usr/lib/python2.7/site-packages/vdsm/v2v.py", line 904, in _watch_process_output
    for event in parser.parse(out):
  File "/usr/lib/python2.7/site-packages/vdsm/v2v.py", line 961, in parse
    for chunk in self._iter_progress(stream):
  File "/usr/lib/python2.7/site-packages/vdsm/v2v.py", line 980, in _iter_progress
    raise OutputParserError('copy-disk stream closed unexpectedly')
OutputParserError: copy-disk stream closed unexpectedly

Image on Source:
$ sudo qemu-img info fedora29.img 
image: fedora29.img
file format: qcow2
virtual size: 30G (32212254720 bytes)
disk size: 1.9G
cluster_size: 65536
Format specific information:
    compat: 1.1
    lazy refcounts: true
    refcount bits: 16
    corrupt: false

Source Host:
RHEL7
libvirt-3.9.0-14.el7_5.8.x86_64

Proxy Host:
RHEL7
vdsm-4.20.43-1.el7.x86_64
libvirt-3.9.0-14.el7_5.8.x86_64

Proxy Host (Test 2):
CentOS
vdsm-4.30.4-6.gitbb2a5fd.el7.x86_64
libvirt-4.5.0-10.el7_6.3.x86_64

Version-Release number of selected component (if applicable):
vdsm-4.20.43-1.el7.x86_64
vdsm-4.30.4-6.gitbb2a5fd.el7.x86_64

How reproducible:
Always, on both vdsm versions

Steps to Reproduce:
1. Install VM on KVM using qcow2 disk
2. Attempt to import VM to RHV on Block SD using KVM Import

Actual results:
Fails

Expected results:
Succeeds

Additional info:
[1] https://access.redhat.com/documentation/en-us/red_hat_virtualization/4.2/html/virtual_machine_management_guide/sect-exporting_and_importing_virtual_machines_and_templates#Importing_a_Virtual_Machine_from_KVM

I added some debug, it seems the problem is trying to os.ftruncate() a logical volume (LVM), don't think this works.

[    0.4] fd=/rhev/data-center/mnt/blockSD/f7eeca0e-b360-4d88-959a-1e0e0730f846/images/acf66501-659f-4bd0-bf60-955d70fc6871/1549f851-0517-472f-93ef-9e68319284be
[    0.4] estimated_size=32212254720, size=None
[    0.4] cur=262144
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 257, in main
    handle_volume(con, diskno, src, dst, options)
  File "/usr/lib/python2.7/site-packages/vdsm/kvm2ovirt.py", line 198, in handle_volume
    options.bufsize)
  File "/usr/lib/python2.7/site-packages/vdsm/kvm2ovirt.py", line 161, in download_disk_sparse
    stream.sparseRecvAll(bytesWriteHandler, recvSkipHandler, op)
  File "/usr/lib64/python2.7/site-packages/libvirt.py", line 6122, in sparseRecvAll
    ret = holeHandler(self, length, opaque)
  File "/usr/lib/python2.7/site-packages/vdsm/kvm2ovirt.py", line 83, in recvSkipHandler
    return os.ftruncate(fd, cur)
OSError: [Errno 22] Invalid argument

Comment 1 Germano Veit Michel 2018-12-20 03:37:09 UTC
This limitation is actually documented. Closing.


Note You need to log in before you can comment on or make changes to this bug.