Bug 1485807

Summary: virt-v2v: trying to import a VM with unreachable cdrom device caused the import to fail with "disk storage error"
Product: Red Hat Enterprise Virtualization Manager Reporter: Michal Skrivanek <michal.skrivanek>
Component: vdsmAssignee: Tomáš Golembiovský <tgolembi>
Status: CLOSED ERRATA QA Contact: Nisim Simsolo <nsimsolo>
Severity: medium Docs Contact:
Priority: high    
Version: unspecifiedCC: bazulay, bgraveno, bugs, lsurette, lveyde, nsimsolo, sgratch, srevivo, tgolembi, ycui, ykaul, ylavi
Target Milestone: ovirt-4.1.6Keywords: ZStream
Target Release: ---Flags: lsvaty: testing_plan_complete-
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Previously when an imported virtual machine contained a CD-ROM with a source that is unreachable, it caused the whole virtual machine to be rejected. This has now been fixed and virtual machines with an unreachable CD-ROM can also be imported.
Story Points: ---
Clone Of: 1426144 Environment:
Last Closed: 2017-09-19 07:19:31 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: 1426144, 1484379    
Bug Blocks:    

Description Michal Skrivanek 2017-08-28 06:53:53 UTC
+++ This bug was initially created as a clone of Bug #1426144 +++

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.

--- Additional comment from Nisim Simsolo on 2017-08-15 12:37:03 CEST ---

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 rhev-integ 2017-08-31 16:51:42 UTC
WARN: Bug status wasn't changed from MODIFIED to ON_QA due to the following reason:

[Found non-acked flags: '{'rhevm-4.1.z': '?'}', ]

For more info please contact: rhv-devops: Bug status wasn't changed from MODIFIED to ON_QA due to the following reason:

[Found non-acked flags: '{'rhevm-4.1.z': '?'}', ]

For more info please contact: rhv-devops

Comment 3 Nisim Simsolo 2017-09-07 10:48:34 UTC
Verification builds:
ovirt-engine-4.1.6.1-0.1.el7
vdsm-4.19.30-1.el7ev.x86_64
sanlock-3.5.0-1.el7.x86_64
qemu-kvm-rhev-2.9.0-16.el7_4.5.x86_64
libvirt-client-3.2.0-14.el7_4.3.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 5 errata-xmlrpc 2017-09-19 07:19:31 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, 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/RHEA-2017:2750

Comment 6 Daniel Gur 2019-08-28 12:57:49 UTC
sync2jira

Comment 7 Daniel Gur 2019-08-28 13:02:58 UTC
sync2jira

Comment 8 Daniel Gur 2019-08-28 13:12:38 UTC
sync2jira

Comment 9 Daniel Gur 2019-08-28 13:16:51 UTC
sync2jira