Bug 1426144

Summary: virt-v2v: trying to import a VM with unreachable cdrom device caused the import to fail with "disk storage error"
Product: [oVirt] ovirt-engine Reporter: Sharon Gratch <sgratch>
Component: BLL.VirtAssignee: Tomáš Golembiovský <tgolembi>
Status: CLOSED CURRENTRELEASE QA Contact: Nisim Simsolo <nsimsolo>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 4.1.0CC: bugs, fsun, nsimsolo
Target Milestone: ovirt-4.2.0Flags: rule-engine: ovirt-4.2+
Target Release: 4.2.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Previously when user tried to import VM with CD image that was unreachable the import was not possible. This has been fixed and CD image is now ignored during import.
Story Points: ---
Clone Of:
: 1485807 (view as bug list) Environment:
Last Closed: 2017-12-20 11:19:41 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: 1485807    

Description Sharon Gratch 2017-02-23 09:58:46 UTC
Description of problem:

When trying to import a VM from one of the external providers that has a CDROM device, v2v treats the CDROM as one of the disk devices and therefore tries to reach the source path and if fail then the import fail with error:
File "/usr/lib/python2.7/site-packages/vdsm/v2v.py", line 1125, in _get_disk_info
 vol = conn.storageVolLookupByPath(disk['alias'])
 File "/usr/lib64/python2.7/site-packages/libvirt.py", line 4770, in storageVolLookupByPath
  if ret is None:raise libvirtError('virStorageVolLookupByPath() failed', conn=self)
libvirtError: Storage volume not found: no storage vol with matching path
2017-02-22 17:36:11,035 WARN  (jsonrpc/3) [root] Cannot add VM win2k12 due to disk storage error (v2v:1067)

The libvirt xml for such a VM is:
.....
<devices>
   <disk type='file' device='disk'>
      <driver name='file'/>
      ...
   </disk>
   <disk type='file' device='cdrom'>
      <driver name='file'/>
      <source file='/var/lib/libvirt/images/nsimsolo_IS /en_windows_server_2012_x64_dvd_915478.iso'/>
      <target dev='hdb' bus='ide'/>
      <readonly/>
   </disk>
....
</devices>

We should decide how to handle CDROM devices in v2v and if to ignore them or not. For that we need to check the "device" property value if it is 'cdrom' or 'disk'.


Version-Release number of selected component (if applicable):
ovirt 4.1 
vdsm Version: 4.19.4

How reproducible:
100%

Steps to Reproduce:
1.run import from an external provider and choose a VM name that has a CDROM device

Actual results:
The VM is skipped in vdsm with the error described above.

Expected results:
If all other disk devices are valid and we decide to ignore the CDROM, then the VM should be imported successfully without the CDROM.

Comment 1 Nisim Simsolo 2017-08-15 10:37:03 UTC
Verified:
ovirt-engine-4.2.0-0.0.master.20170811144920.gita423008.el7.centos
vdsm-4.20.2-64.git072feb0.el7.centos.x86_64
libvirt-client-3.2.0-14.el7_4.2.x86_64
qemu-kvm-rhev-2.9.0-14.el7.x86_64
virt-v2v-1.36.3-6.el7_4.2.x86_64

Verification scenario:
1. Create Vmware VM with attached cdrom.
2. import VM and verify import succeeded (during import verify libvirt.xml is showing cdrom device).
3. Run VM and verify VM is running properly.
4. Repeat steps 1-3 for Xen and KVM environments.

Comment 2 Sandro Bonazzola 2017-12-20 11:19:41 UTC
This bugzilla is included in oVirt 4.2.0 release, published on Dec 20th 2017.

Since the problem described in this bug report should be
resolved in oVirt 4.2.0 release, published on Dec 20th 2017, it has been closed with a resolution of CURRENT RELEASE.

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