Bug 1400527

Summary: [z-stream clone - 4.0.6] Virt-v2v is failing with python error when importing VM from KVM
Product: Red Hat Enterprise Virtualization Manager Reporter: rhev-integ
Component: ovirt-engineAssignee: Tomáš Golembiovský <tgolembi>
Status: CLOSED ERRATA QA Contact: Nisim Simsolo <nsimsolo>
Severity: medium Docs Contact:
Priority: medium    
Version: unspecifiedCC: eedri, emahoney, gklein, ling, lsurette, mavital, melewis, mgoldboi, michal.skrivanek, nsimsolo, rbalakri, Rhev-m-bugs, srevivo, tgolembi, tjelinek, ykaul
Target Milestone: ovirt-4.0.6Keywords: ZStream
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: V2V
Fixed In Version: Doc Type: Bug Fix
Doc Text:
With this update, public key authentication access has been fixed when importing virtual machines from KVM.
Story Points: ---
Clone Of: 1388596 Environment:
Last Closed: 2017-01-10 17:01:46 UTC Type: ---
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: 1388596    
Bug Blocks:    

Description rhev-integ 2016-12-01 12:31:47 UTC
+++ This bug is a downstream clone. The original bug is: +++
+++   bug 1388596 +++
======================================================================

Created attachment 1214028 [details]
Engine.log from manager

Description of problem: virt-v2v is failing with a python error. I am attaching the engine.log from the RHVM and have asked the customer for a sosreport from the KVM host. 

~~~
2016-10-25 13:20:54,335 INFO  [org.ovirt.engine.core.bll.exportimport.ConvertVmCallback] (DefaultQuartzScheduler4) [6caf6d30] Conversion of VM from exteral enironment failed: must be string or buffer, not None
2016-10-25 13:20:55,339 ERROR [org.ovirt.engine.core.bll.exportimport.ConvertVmCommand] (DefaultQuartzScheduler7) [4b606ce0] Ending command 'org.ovirt.engine.core.bll.exportimport.ConvertVmCommand' with failure.
~~~

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


How reproducible:


Steps to Reproduce:
1. Select import from VMs tab in RHVM UI
2. Import VM with thin provisioned or pre-allocated (both fail) disks
3. Engine log shows python error when using thin provisioned. 
4. Note: engine log shows preallocated type is not supported
~~~
2016-10-25 13:09:43,771 WARN  [org.ovirt.engine.core.bll.storage.disk.AddDiskCommand] (org.ovirt.thread.pool-6-thread-8) [3e57a7bd] Validation of action 'AddDisk' failed for user admin@internal-authz. Reasons: VAR__ACTION__ADD,VAR__TYPE__DISK,ACTION_TYPE_FAILED_DISK_CONFIGURATION_NOT_SUPPORTED,$volumeFormat COW,$volumeType Preallocated
2016-10-25 13:09:43,771 INFO  [org.ovirt.engine.core.bll.storage.disk.AddDiskCommand] (org.ovirt.thread.pool-6-thread-8) [3e57a7bd] Lock freed to object 'EngineLock:{exclusiveLocks='[754ee98f-ef79-4117-a69f-8d27f186a822=<VM_DISK_BOOT, ACTION_TYPE_FAILED_OBJECT_LOCKED>]', sharedLocks='null'}'
2016-10-25 13:09:43,771 ERROR [org.ovirt.engine.core.bll.exportimport.ImportVmFromExternalProviderCommand] (org.ovirt.thread.pool-6-thread-8) [3e57a7bd] Command 'org.ovirt.engine.core.bll.exportimport.ImportVmFromExternalProviderCommand' failed: EngineException: Failed to create disk! (Failed with error ENGINE and code 5001)
~~~

Actual results:


Expected results:


Additional info:

(Originally by Evan Mahoney)

Comment 1 rhev-integ 2016-12-01 12:31:57 UTC
Please add version information, vdsm.log from the conversion host, and libvirt domain xml from the source host

(Originally by michal.skrivanek)

Comment 7 rhev-integ 2016-12-01 12:32:24 UTC
From the engine.log I can say that the ssh authentication was not set up correctly to allow passwordless login. 
Btw why not using remote libvirt access using qemu+tcp insted of qemu+ssh?

(Originally by michal.skrivanek)

Comment 10 rhev-integ 2016-12-01 12:32:41 UTC
Yes, it is problem with authentication. When connecting via SSH you should always provide username even when using password-less authetiation. More over, password-based login is not supported with SSH transport. The import dialog is rather confusing in this regard.

When using qemu+ssh transport you have to uncheck the 'requires authentication' checkbox *and* provide user name (most likely 'root') as part of the URI as: qemu+ssh://root@host:port/... If you don't provide the user in URI the connection will happen as user 'vdsm' which is rather unexpected and confusing.

I don't think this is documented anywhere and we should probably improve the import dialog. I've added another bug to track that: https://bugzilla.redhat.com/show_bug.cgi?id=1395753

However because of the related bug: https://bugzilla.redhat.com/show_bug.cgi?id=1387838
as a workaround until the bug is fixed, you have to:
1) put correct user name in the URI (most likely 'root')
2) check 'requires authetication' box
3) put something into username and password text fields; anything like "abcd" or "12345" is ok, the values will be ignored

Let me know if this solves your issue.

(Originally by Tomas Golembiovsky)

Comment 11 rhev-integ 2016-12-01 12:32:46 UTC
*** Bug 1387838 has been marked as a duplicate of this bug. ***

(Originally by Tomas Jelinek)

Comment 12 rhev-integ 2016-12-01 12:32:53 UTC
The scope of this fix will only be to not fail in case the username/password is not filled.

The overall redesign of the dialog is going to be tracked in https://bugzilla.redhat.com/show_bug.cgi?id=1395753

(Originally by Tomas Jelinek)

Comment 13 rhev-integ 2016-12-01 12:32:59 UTC
what's POSTed? can you please add links

(Originally by michal.skrivanek)

Comment 15 Michal Skrivanek 2016-12-01 13:57:48 UTC
it is actually in 4.0.6

Comment 17 Nisim Simsolo 2016-12-15 13:35:51 UTC
Verified: 
ovirt-engine-4.0.6.3-0.1.el7ev
qemu-kvm-rhev-2.6.0-28.el7_3.2.x86_64
vdsm-4.18.21-1.el7ev.x86_64
libvirt-client-2.0.0-10.el7.x86_64
sanlock-3.4.0-1.el7.x86_64

Verification scenario: Import multiple VMs from KVM environment

Comment 19 errata-xmlrpc 2017-01-10 17:01:46 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://rhn.redhat.com/errata/RHBA-2017-0043.html