[Users] VM Migration
Gianluca Cecchi
gianluca.cecchi at gmail.com
Sun Dec 1 00:03:38 UTC 2013
On Sat, Nov 30, 2013 at 7:08 PM, Maurice James wrote:
> I installed ovirt on a machine that was already hosting KVM virtual
> machines. I am now trying to migrate those VMs over to RHEV format, but I am
> receiving SASL authentication errors using virt-v2v.
>
> I am not being prompted for credentials upon running the command:
>
> virt-v2v Windows7.xml -o rhev -os host.domain.net:/home/images --network
> ovirtmgmt Windows7
>
>
>
> The error is:
>
> virt-v2v: Failed to connect to qemu:///system: libvirt error code: 45,
> message: authentication failed: Failed to step SASL negotiation: -7
> (SASL(-7): invalid parameter supplied: Unexpectedly missing a prompt result)
>
>
>
> This has been driving me crazy all night. Does anyone know anything about
> this?
Hi,
I made some tests as I could need something similar in the near future...
This is what I found from my tests
You need authentication for libvirt after oVirt configuration took
place on your server.
So you can create a user for libvirt and try then the commands with
that user credentials.
It worked for me in the past to try to start a VM directly from
libvirt on an all-in-one system to debug problems.
So:
# saslpasswd2 -a libvirt virshuser
Password: <define a password>
probably the disks of your pre-existing vm should be put with these permissions
chown vdsm.kvm /var/lib/libvirt/images/testvm.img
chmod 0660 /var/lib/libvirt/images/testvm.img
try to see eventually if you can start your vm now:
# virsh start testvm
I have an AIO install with fedora 19 and oVirt 3.3.1 stable
Actually I have not a kvm infra but I created one fake in the sense
that I created a storage pool and a disk inside it
[root at tekkaman ~]# cat pool.xml
<pool type="dir">
<name>virtimages</name>
<target>
<path>/var/lib/libvirt/images</path>
</target>
</pool>
virsh pool-create pool.xml
I copied an image (fedora19) inside it and refreshed the pool
virsh pool-refresh virtimages
virsh vol-list --pool virtimages
[root at tekkaman ~]# virsh vol-list --pool virtimages
Please enter your authentication name: virshuser
Please enter your password:
Name Path
-----------------------------------------
testvm.img /var/lib/libvirt/images/testvm.img
I define a basic VM with test.img as a disk
virsh define test.xml
[root at tekkaman ~]# virsh list --all
Please enter your authentication name: virshuser
Please enter your password:
Id Name State
----------------------------------------------------
2 f19 running
- test shut off
NOTE: the f19 above is a fedora 19 vm running inside oVirt itself,
while test is the VM just created with virsh commands
Now, even if I don't now if it is still required in f19
export LIBGUESTFS_ATTACH_METHOD=appliance
and also if you want to debug virt-v2v (used to debug, see below my
workaround due to a permission error otherwise...)
export LIBGUESTFS_DEBUG=1
Now you can run
virt-v2v -ic qemu://virshuser@tekkaman.localdomain.local/system -o
rhev -os tekkaman.localdomain.local:/data/export_domain --network
ovirtmgmt test
tekkaman.localdomain.local is my server from which I run the comamnds
that is both oVirt AIO (so engine+hypervisor) and now is also source
for the KVM vm I want to put into oVirt export domain
NOTE: the command will not ask a password.. donna if it is a bug or not...
During virt-v2v, the export domain is mounted locally under
/tmp/<random_path> (eg. /tmp/f6X_Ea809r/)
For some reason the permissions are not ok for virt-v2v and give an
error of permission denied attempting to open the disk.
You cannot directly change the permissions under /tmp, you have to do
on the local path of the export domain.
In my case it is on the very same server under /data/export_domain path
SO I did these tricks below to the temporarily created dir to have
virt-v2v able to complete.
And now I see the imported VM under export domain 'VM import" sub-tab
in webadmin page
[root at tekkaman ~]# ll /data/export_domain/44327985-44c5-4e17-9396-1469b191fafc/
total 32
drwxr-xr-x. 2 vdsm kvm 4096 May 1 2013 dom_md
drwxr-xr-x. 4 vdsm kvm 4096 May 1 2013 images
drwxr-xr-x. 4 vdsm kvm 4096 May 1 2013 master
drwx------. 3 vdsm kvm 4096 Dec 1 00:33 v2v.ISfFuM4P
root at tekkaman ~]# chmod 770
/data/export_domain/44327985-44c5-4e17-9396-1469b191fafc/v2v.ISfFuM4P/
[root at tekkaman ~]# ll
/data/export_domain/44327985-44c5-4e17-9396-1469b191fafc/v2v.ISfFuM4P/
total 8
drwxr-xr-x. 2 vdsm kvm 4096 Dec 1 00:33 a7a38c80-2862-46a3-833a-93394d916c5d
[root at tekkaman ~]# chmod 775
/data/export_domain/44327985-44c5-4e17-9396-1469b191fafc/v2v.ISfFuM4P/a7a38c80-2862-46a3-833a-93394d916c5d/
[root at tekkaman ~]# ll
/data/export_domain/44327985-44c5-4e17-9396-1469b191fafc/v2v.ISfFuM4P/a7a38c80-2862-46a3-833a-93394d916c5d/
total 1912208
-rw-r--r--. 1 vdsm kvm 8589934592 Dec 1 00:33
2ada28ad-e98c-4ff8-afb2-280dcb72c1c4
[root at tekkaman ~]# chmod 664
/data/export_domain/44327985-44c5-4e17-9396-1469b191fafc/v2v.ISfFuM4P/a7a38c80-2862-46a3-833a-93394d916c5d/2ada28ad-e98c-4ff8-afb2-280dcb72c1c4
[root at tekkaman ~]# ll
/data/export_domain/44327985-44c5-4e17-9396-1469b191fafc/v2v.ISfFuM4P/a7a38c80-2862-46a3-833a-93394d916c5d/
total 2301332
-rw-rw-r--. 1 vdsm kvm 8589934592 Dec 1 00:34
2ada28ad-e98c-4ff8-afb2-280dcb72c1c4
You have to do these steps during the initial phase when there is the
copy of the image and you have the ==== progress bars..
HIH,
Gianluca
More information about the Users
mailing list