Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.
Bug 1387838 - KVM Import fails when libvirtd qemu+tcp URI is used, with no user/password entered.
Summary: KVM Import fails when libvirtd qemu+tcp URI is used, with no user/password en...
Keywords:
Status: CLOSED DUPLICATE of bug 1388596
Alias: None
Product: ovirt-engine
Classification: oVirt
Component: Backend.Core
Version: 4.0.4.4
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: ovirt-4.1.0-alpha
: ---
Assignee: Tomáš Golembiovský
QA Contact: meital avital
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-10-22 11:15 UTC by ling
Modified: 2020-04-15 14:45 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-11-18 11:53:13 UTC
oVirt Team: Virt
Embargoed:
tjelinek: ovirt-4.1?
rule-engine: planning_ack?
rule-engine: devel_ack?
rule-engine: testing_ack?


Attachments (Terms of Use)

Description ling 2016-10-22 11:15:10 UTC
Description of problem:
Trying to import VMs from a KVM node using a URI like this: qemu+tcp://vmserver2-safari/system, Required Authentication unchecked, and nothing entered in user and password field. I have set libvirtd on the KVM end to use tcp with no authentication. Verified connection works.

However, receive these errors when I picked a VM to import:

2016-10-22 09 (tel:2016102209):49:29,300 INFO [org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector] (pool-7-thread-2) [d38191] Correlation ID: d38191, Call Stack: null, Custom Event ID: -1, Message: Starting to convert Vm ks-safari
2016-10-22 09 (tel:2016102209):49:52,846 INFO [org.ovirt.engine.core.bll.exportimport.ConvertVmCallback] (DefaultQuartzScheduler1) [76a0f17f] Conversion of VM from exteral enironment failed: must be string or buffer, not None

After looking at the log more closely, and search the net for the  ConvertVmVDSCommand, I cam to this: 

https://gerrit.ovirt.org/#/c/33055/100..100/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/ConvertVmVDSCommand.java

@Override
protected void executeVdsBrokerCommand() {
status = getBroker().convertVmFromExternalSystem(
getParameters().getUrl(),
getParameters().getUsername(),
getParameters().getPassword(),
createVmProperties(),
getParameters().getVmId().toString());

So, I thought let me try again and leave "Required Authentication" checked, and enter a user and password, even though libvirtd on the KVM side doesn't need user/password. A wild guess, and but this workaround worked.

Also noticed there are couple of typos in the error message:

"Conversion of VM from exteral enironment failed: must be string or buffer, not None"


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


How reproducible:
Always

Steps to Reproduce:
1.Go to Virtual Machines
2.Select Import
3.Select Source KVM (via Libvirt)
4.Enter a URI like this: qemu+tcp://vmserver2-safari/system
5. Uncheck "Required password" and leave user and password fields blank.
6. The KVM end has to be set up to allow tcp, and none for authentication.
7. Click Load
8. Pick a VM to import
9. Error occurs after a few minutes. 

Actual results:
The Alert screen on the GUI shows this "Failed to import Vm ks-safari to Data Center Safari_Lab, Cluster Default"

Expected results:
VM gets imported after disk image get copied and converted.

Additional info:
It should detect that "Required Authentication" is unchecked, and therefore handler the blank user and password fields properly.

Comment 1 Tomas Jelinek 2016-11-09 11:23:20 UTC
I'd say that in v2v.py the _password_file expects the os.write(fd, self._password.value) to have the _password.value not None. 
It looks like this has never been working.

Comment 2 Tomáš Golembiovský 2016-11-16 15:43:25 UTC
(In reply to Tomas Jelinek from comment #1)
> I'd say that in v2v.py the _password_file expects the os.write(fd,
> self._password.value) to have the _password.value not None. 
> It looks like this has never been working.

I can confirm the problem. This will be fixed.

For now, as a workaround for password-less connections do the following:
1) check 'requires authetication' box
2) put something into username and password text fields; anything like "abcd" or "12345" is ok, the values will be ignored

Comment 3 ling 2016-11-17 08:42:45 UTC
Thanks for looking at the bug and fixing it!

Comment 4 Tomas Jelinek 2016-11-18 11:53:13 UTC
the root cause of this is the same as 
https://bugzilla.redhat.com/show_bug.cgi?id=1388596
hence closing this one as duplicate to track the same issue on one place only.

*** This bug has been marked as a duplicate of bug 1388596 ***


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