Bug 1388596 - Virt-v2v is failing with python error when importing VM from KVM [NEEDINFO]
Summary: Virt-v2v is failing with python error when importing VM from KVM
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine
Version: unspecified
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ovirt-4.1.0-alpha
: ---
Assignee: Tomáš Golembiovský
QA Contact: Nisim Simsolo
URL:
Whiteboard: V2V
: 1387838 (view as bug list)
Depends On: 1416112
Blocks: TRACKER-bugs-affecting-libguestfs 1400527
TreeView+ depends on / blocked
 
Reported: 2016-10-25 18:05 UTC by emahoney
Modified: 2020-04-15 14:46 UTC (History)
15 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1400527 (view as bug list)
Environment:
Last Closed: 2017-04-25 00:50:26 UTC
oVirt Team: Virt
Target Upstream Version:
tjelinek: needinfo? (emahoney)


Attachments (Terms of Use)
Engine.log from manager (5.24 MB, text/plain)
2016-10-25 18:05 UTC, emahoney
no flags Details


Links
System ID Priority Status Summary Last Updated
Red Hat Knowledge Base (Solution) 2892991 None None None 2017-01-30 12:05:59 UTC
Red Hat Product Errata RHEA-2017:0997 normal SHIPPED_LIVE Red Hat Virtualization Manager (ovirt-engine) 4.1 GA 2017-04-18 20:11:26 UTC
oVirt gerrit 67081 'None' 'MERGED' 'v2v: handle password-less login properly' 2019-11-25 07:41:06 UTC
oVirt gerrit 67301 'None' 'MERGED' 'v2v: handle password-less login properly' 2019-11-25 07:41:06 UTC

Description emahoney 2016-10-25 18:05:00 UTC
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:

Comment 1 Michal Skrivanek 2016-10-26 06:11:04 UTC
Please add version information, vdsm.log from the conversion host, and libvirt domain xml from the source host

Comment 6 Michal Skrivanek 2016-11-04 06:21:38 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?

Comment 9 Tomáš Golembiovský 2016-11-16 15:39:34 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.

Comment 10 Tomas Jelinek 2016-11-18 11:53:13 UTC
*** Bug 1387838 has been marked as a duplicate of this bug. ***

Comment 11 Tomas Jelinek 2016-11-18 11:55:24 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

Comment 12 Michal Skrivanek 2016-12-01 12:16:03 UTC
what's POSTed? can you please add links

Comment 15 Nisim Simsolo 2017-01-25 15:25:26 UTC
Verification build:
ovirt-engine-4.1.0.2-0.1.el7
libvirt-client-2.0.0-10.el7_3.4.x86_64
qemu-kvm-rhev-2.6.0-28.el7_3.3.x86_64
vdsm-4.19.1-1.el7ev.x86_64
sanlock-3.4.0-1.el7.x86_64

Verification scenario:
1. Verify "loading" KVM VMs using qemu+ssh is possible when:
- "requires authentication" is no checked.
- "requires authentication" is checked and incorrect user and password are entered.
- click "load" button when "requires authentication" is checked and user password fields are empty. verify the user and password text boxes are marked with a red frame.
2. 1. Verify "loading" KVM VMs using qemu+tcp is possible when:
- "requires authentication" is no checked.
- "requires authentication" is checked and incorrect user and password are entered.
- click "load" button when "requires authentication" is checked and user password fields are empty. verify the user and password text boxes are marked with a red frame.


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