On Thu, Jul 22, 2010 at 11:54 AM, Kashyap Chamarthy <kchamart@redhat.com> wrote:

FWIW, the below worked for me while trying to migrate vms from one host to another(in my case,both RHEL5.5). I used 'virsh' (from libvirt)

1) 'virsh dumpxml <domain (or) id>'--this will dump the  guest machine info. into XML.
2) copy your qcow2 image disk from host1 to host2.
3) 'virsh define <xml file>'  for the dumped xml  files from step 1)

Now you should be good to start/run the above guest on your host2 (running kvm..)


yes, the vm was a CentOS 5.5 os.
It worked like a charm.
I made a dump from a previous rh el 5 vm already existent on the rh el 5.5 host, using it as baseline for differences.
And this is diff output between xml dump in FC13 and the modified version to have it imported by rh el 5.5
(btw I changed memory size from 1Gb to 2Gb as I passed from my laptop to an enterprise 16Gb based server...)

#diff f13out.xml rhel55in.xml
<   <name>op</name>
<   <memory>2097152</memory>
<   <currentMemory>2097152</currentMemory>
>   <name>o11p</name>
>   <uuid>8030a286-d41c-d692-648a-4d0aad122bdd</uuid>
>   <memory>1048576</memory>
>   <currentMemory>1048576</currentMemory>
<     <type arch='x86_64' machine='pc'>hvm</type>
>     <type arch='x86_64' machine='fedora-13'>hvm</type>
>     <boot dev='cdrom'/>
>   <cpu match='exact'>
>     <model>core2duo</model>
>     <feature policy='force' name='x2apic'/>
>   </cpu>
<     <emulator>/usr/libexec/qemu-kvm</emulator>
>     <emulator>/usr/bin/qemu-kvm</emulator>
<       <source file='/VMDATA/o11p.img'/>
>       <source file='/var/lib/libvirt/images/c55.img'/>

I only had to change then network parameters in vm os.
In virt-manager I also removed the audio card.
I was then also able to apply "yum update" to this new vm and it runs quite good.