2

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 ?

klipz
  • 168
  • 2
  • 8
  • 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

1 Answers1

4

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

dyasny
  • 18,802
  • 6
  • 49
  • 64
  • 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
    http://www.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] >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:' or tcp: from: http://www.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