Andy, thank you for the info, it helped a lot...

I'm still working on details and testing, but at this point VCL loads VMware 
images on KVM hosts. 
I needed to make some changes to Windows XP image to load it on KVM - this link 
has details -> 
http://pve.proxmox.com/wiki/Migration_of_servers_to_Proxmox_VE#Prepare_the_Windows_operating_system_2.
 
I did first two steps (remove vmware-tools & Enable IDE) on the VMware image 
and it loads on KVM just fine and everything appears working OK.

I've tried few versions of qemu/libvirt. Current configuration uses 
libvirt-1.0.3 and qemu-1.4.0 (latest) compiled on CentOS 6.3. I'don't know if I 
get the same results with older versions. xCAT helps to deploy KVM host image 
with custom changes to all blades - I don't need to build it multiple times...

I've tried Fedora 18, but for some reason HS21 server loosing keyboard after 
30-40 sec, which makes it hard for initial server configuration. 
If it wasn't for the keyboard problem (which I think is specific to my 
environment) then Fedora 18 would be my choice for KVM host, considering that 
oVirt only supports Fedora 18 at this point. Managing KVM from command line 
works, but GUI would be nice.

As for the linked clones, I found that copy-on-write image appears to works 
fine. It's very fast to create and barely uses any space at all. 
I've changed 'qemu-img convert...' command in libvirt.pm to 'qemu-img create -b 
$source_file_paths_string -f qcow2 \"$destination_file_path\"' to clone KVM 
image. Also updated domain xml file for disk type.
Haven't tested it when updating/creating new image...

Thanks.
 
On Mar 1, 2013, at 17:10 , Andy Kurth <[email protected]> wrote:

> Check the commented out in KVM.pm::copy_virtual_disk.  I left a bunch of of 
> code and comments in there while I was trying to figure out problems similar 
> to what you're describing.  Some of it may be helpful.
> 
> On 3/1/2013 1:35 PM, Dmitri Chebotarov wrote:
>> Hi
>> 
>> I've compiled qemu-1.4.0.
>> qemu-img in 1.4 still fails to convert $image.vmdk file, but works OK for 
>> $image-flat.vmdk files. To test it I changed the code in libvirt.pm to 
>> return $image-flat.vmdk for the file name. Did you have to adjust anything 
>> on your side for qemu-img to find $image-flat.vmdk to in $image.vmdk (1)?
> 
> Where did you edit?  libvirt.pm::find_repository_image_file_paths() should 
> return every file with $image in the name except $image.vmdk.  This is just 
> VMware's image metadata file.  I haven't tested it but I think 
> $image-flat.vmdk should be returned.  We are using the code as it is in 
> trunk.  We are only converting from the images stored in the repository which 
> are in 2gbsparse format, not from images in the datastore in monolithic 
> *-flat.vmdk format.
> 
> BTW - I would advise against using the same datastore location for both 
> VMware and KVM images.  I wrote the module with the assumption that the 
> datastore only contains KVM images.  There may be conflicts if the KVM code 
> finds additional files in the datastore which contain the image name.  Also 
> assumed is that when converting from vmdk to qcow2, the vmdk images reside in 
> the image repository in 2gbsparse format.
> 
>> The vcld.log has "copy on write virtual disk is not supported for the 
>> datastore image type: vmdk, creating full copy of master image file" 
>> message, I assume this means all VMware images running on KVM will use full 
>> copies, which is a lot of disk space (2).
> 
> Aha, I don't think vmprofile.imagetypeid is set correctly.  Change it from 
> vmdk to qcow2.  This may be the cause of your overall problem.  Try this 
> first and test if vcld properly converts the vmdk to qcow2.
> 
>> 
>> I've also compiled libvirt-1.0.3rc3 and linked /usr/libexec/qemu-kvm -> 
>> /usr/local/bin/qemu-system-x86_64. Before I was getting error message about 
>> qemu-kvm not supporting vmdk. I'm not entirely sure I needed to build new 
>> libvirt, but I worked OK.
>> 
>> With the changes above I was able to load VMware VM (vmdk) on KVM host 
>> (CentOS Linux as guest, will try Win later).
>> 
>> (There are some bugs in CentOS6 and libvirt-1.0.2/1.0.3rc3 with SELinux 
>> enabled, so SELinux is disabled on the VM Hosts).
>> 
>> Q.:
>> 
>> 1. Should qemu-img work with $image.vmdk files? The $image.vmdk file is 
>> description files for $image-flat.vmdk. If qemu-img is not suppose to 
>> 'follow' to $image-flat.vmdk file, then this could be adjusted in libvirt.pm 
>> code.
>> 
>> 2. Is there a way to make a linked clone from .vmdk file (i.e. copy of write 
>> disk)? Can .vmdk file be converted to .qcow2 file as linked clone?
> 
> Yes.  This is what the code does when things are working properly. I don't 
> think KVM can run linked clones directly from a vmdk.  It must be converted 
> to qcow2 first.
> 
>> 
>> I would like to stay with CentOS6 as host OS if possible, but if #2 above 
>> works in Fedora and I cannot make it work in CentOS then I'll try Fedora 16 
>> as host.
> 
> I'd like to know how to get things working on CentOS/RHEL as well. We mainly 
> use these and are only using Fedora because of the image conversion problems.
> 
> Thanks,
> Andy
> 
> 



--
Thank you,

Dmitri Chebotarov
VCL Sys Eng, Engineering & Architectural Support, TSD - Ent Servers & Messaging
223 Aquia Building, Ffx, MSN: 1B5
Phone: (703) 993-6175 | Fax: (703) 993-3404



Reply via email to