Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm doing tests on KVM, and I'd like to see if I can make a hot migration, I mean the virtual machine won't stop running during the migration (but a few seconds of freeze is ok). I use a small cluster for my test : kvm1, kvm2, and kvmnfs.

  • kvm1 and kvm2 runs the virtual machines
  • kvmnfs is a NFS server, and it's mounted on /KVM on both kvm1 and kvm2

To migrate a VM (only RAM in fact) from kvm1 to kvm2, I run the same kvm command on kvm2 (with -incoming tcp:0:4444) that on kvm1, then I use "migrate -d tcp:kvm2:4444" : It works great, since the VM file is common to both machines.

Now, I wan't to make a full migration (RAM + disk) of a local VM file (no more NFS) of kvm1 to kvm2. I tried to create an empty file, with touch, on kvm2 and use the same kvm command line + the "-incoming ..."). Then on kvm1 I use "migrate -d tcp:kvm2:4444" : It copies everything, then... the VM fails (any I/O disk gives an I/O error) ! And my VM file on kvm2, the one I created with touch, as still a size of 0 bytes.

What am I doing wrong ? What is the exact command to use on kvm2 ? And what is the command to launch, in the monitoring mode, on kvm1 ?

share|improve this question
    
so you want to migrate a VM, including copying the disk within the migration? or am I getting this wrong? –  dyasny Feb 10 '11 at 20:25
    
Yes, that's exactly what I'm trying to do :) –  klipz Feb 10 '11 at 20:40
    
not possible. you either have a centralised storage (cluster FS + SAN/DAS or NFS) with the image accessible by both hosts, or keep the images in sync with something like drbd –  dyasny Feb 10 '11 at 20:51
add comment

1 Answer

up vote 4 down vote accepted

not possible. you either have a centralised storage (cluster FS + SAN/DAS or NFS) with the image accessible by both hosts, or keep the images in sync with something like drbd

//copied as an answer.

addition: you COULD script this, byt suspending guest to RAM, dd-ing the image over to the other host, dd-ing the memstate, and resuming the VM. but downtime will be comparable to stopping VM, copying it and starting again

share|improve this answer
    
Ok thanks, that's what I thought :-( So what does "migrate -d" do ? –  klipz Feb 12 '11 at 17:14
1  
actually, with the latest code you might be able to pull this off, still, not the best practice in production IMO <br> linux-kvm.com/content/qemu-kvm-012-adds-block-migration-feature –  dyasny Feb 12 '11 at 18:05
    
oh, and about the -d option: >migrate [-d] <URI> >migrate_cancel >The '-d' will let you query the status of the migration. > >With no '-d' the monitor prompt returns when the migration >completes. URI can be one of 'exec:<command>' or tcp:<ip:port> from: linux-kvm.org/page/Migration –  dyasny Feb 12 '11 at 18:07
    
Thanks for your answer. I meant "-b", and not "-d", sorry ! –  klipz Feb 12 '11 at 23:11
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.