Bug 1252772

Summary: [RFE][virt-v2v] When there is a failure to import a VM using virt-v2v oVirt does not seem to reflect the error from VDSM
Product: [oVirt] ovirt-engine Reporter: Maor <mlipchuk>
Component: RFEsAssignee: Arik <ahadas>
Status: CLOSED DEFERRED QA Contact: Nisim Simsolo <nsimsolo>
Severity: low Docs Contact:
Priority: medium    
Version: ---CC: bugs, lsurette, lsvaty, michal.skrivanek, mtessun, rbalakri, rjones, srevivo, ykaul
Target Milestone: ---Keywords: FutureFeature
Target Release: ---Flags: ylavi: ovirt-future?
ylavi: planning_ack?
ylavi: devel_ack?
ylavi: testing_ack?
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-07-06 15:27:05 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:
Attachments:
Description Flags
engine log
none
vdsm none

Description Maor 2015-08-12 08:50:58 UTC
Created attachment 1061882 [details]
engine log

Description of problem:
Trying to import a specific VM using VMware fails, though in the log I can only seem to find the following error (see [1])
The question is how can I use virt-v2v with debugging enabled through oVirt, and is there a way for oVirt to reflect the message got from virt-v2v

Thread-7303::ERROR::2015-08-12 11:36:09,978::v2v::355::root::(_run) Job u'4234467d-6fb2-8d32-609e-4ee38e2c4a47' failed
Traceback (most recent call last):
  File "/usr/share/vdsm/v2v.py", line 350, in _run
    self._import()
  File "/usr/share/vdsm/v2v.py", line 383, in _import
    self._proc.stderr.read(1024)))
V2VProcessError: Job u'4234467d-6fb2-8d32-609e-4ee38e2c4a47' process failed exit-code: 1, stderr: curl -q --insecure --user '<hidden>' --head --silent --url 'https://10.35.4.144/folder/chichaDerezVM/chichaDerezVM-000001-flat.vmdk?dcPath=o
virt&dsName=datastore1'
HTTP/1.1 404 Not Found
Date: Wed, 12 Aug 2015 08:35:27 GMT
Set-Cookie: vmware_soap_session="35967553b5d9a62d0df18bf6e5093a2081bb4416"; Path=/; HttpOnly; Secure; 
Connection: close
Content-Type: text; charset=plain
Content-Length: 0

virt-v2v: error: vcenter: URL not found: 
https://10.35.4.144/folder/chichaDerezVM/chichaDerezVM-000001-flat.vmdk?dcPath=ovirt&dsName=datastore1

If reporting bugs, run virt-v2v with debugging enabled and include the 
complete output:

  virt-v2v -v -x [...]



Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1. Try to import a VM using virt-v2v
2.
3.

Actual results:
VM fail to be imported with an audit log message indicating 
"Failed to import Vm ...."

Expected results:
We should have a more informative message indicating also the reason why the VM could not be imported

Additional info:

Comment 1 Maor 2015-08-12 08:53:43 UTC
Created attachment 1061884 [details]
vdsm

Comment 2 Arik 2015-08-13 12:25:29 UTC
(In reply to Maor from comment #0)
There is no need to enable debugging in virt-v2v for that, we get errors that happen in the middle of the conversion without debugging mode.

Note that we parse the output of virt-v2v. So we get the description of errors from virt-v2v as text, therefore we decide not to show it in the audit log. So  audit log only shows that the conversion failed and to see why you should look for it in the engine/vdsm log.

I believe that if we ever change the API with virt-v2v to be based on codes for errors instead of getting it as text, then we will be able to map codes to presentable messages in audit logs.

Comment 3 Martin Tessun 2018-07-06 15:27:05 UTC
According to c#2 there seems to be a reasonable way for getting these errors.