There's a new feature called block migration available with the recently released qemu-kvm-0.12 version. Patches for this feature was first introduced back in November 2009 by ibm and allows you to do block migration during live migration. It works by copying block images to a destination asynchronously. It does this by copying the whole disk first then copying dirty blocks accumulated during the migration similarly to ram migration.

If you're running qemu-kvm-0.12 you can access this feature from the qemu monitor. There are actually two modes of migrating block storage.
The commands for performing these operations are as follows. For complete storage copy, use the -b flag on the source when migrating your virtual machine as shown below.
(qemu) migrate -d -b tcp:1.2.3.4:4444
For incremental storage copy where you're using a backing file use the -i flag on the source as follows. Your backing file should obviously be in the same location on both source and destination servers.
(qemu) migrate -d -i tcp:1.2.3.4:4444
If you're in a situation where shared storage is not currently available for cost or other reasons and really would like to perform live migration, this is your best solution. Bear in mind however that your guest will be suspended during the end phase of block migration so you can expect a little downtime. I haven't personally tested this yet so give this a test run and feel free to post comments or questions.
Comments
Great feature! Especially for
Wednesday, March 24, 2010 - 07:14 Mark (not verified)Great feature! Especially for small installations where you don't want to buy and manage a separate storage server.
Doesn't work worth a crap on
Thursday, July 22, 2010 - 17:23 Anonymous (not verified)Doesn't work worth a crap on Ubuntu 10.04. The destination machine will send a TCP reset right at the beginning of the migration and the source machine will hang indefinatly.
Works perfectly but resulting files are way too big
Thursday, September 23, 2010 - 10:14 adoII (not verified)I love the block migration Feature and in my setup with qemu-kvm-0.12.5 it works good.
But I have one Problem: The virt machine has a maximum 60 GB qcow2 image but only 2 GB of Data. So before migration the .qcow2 file has a size of around 2 GB. After migration the file has a size of 60 GB.
Also the migration is quite slow because it transfers the 60 GB instead of the 2GB needed.
Any ideas how I can prevent that 3000% file growing during block migration ?
live migration doesn t work
Thursday, September 23, 2010 - 11:36 jamel (not verified)hi adoll
are you mean that you make succsfully a live migration between 2 VM ...I try to make it since 2 weeks but I have always the same network problem !!!
I have installed kvm & qemu 0.12.5
Please can I have your email ? the mine is jamel.mrabet@gmail.com
I need your help
thanks
Hi Jamel, block migration
Thursday, October 7, 2010 - 08:26 adoII (not verified)Hi Jamel,
block migration works exactly as described above. But you need the Disk Images (or logical volume or whatever) to exist on the target machine before starting migration. They just have to exist no matter what contents they have. Maybe you forgot to create the disk images ?
hi adoll I don't know i have
Friday, October 8, 2010 - 11:39 Anonymous (not verified)hi adoll
I don't know i have tried to applied the same steps but I dont know maybe if you can t describe the différents steps with detailsto make a block migration
and I hope that I have your email adress if you can send me an email to dont lose time
thx man
Open source virtualization
Friday, January 21, 2011 - 03:19 Shaun Pollock (not verified)Open source virtualization has been evolving dramatically over the last few years. Incumbent proprietary platforms such as VMWare still hold the throne in many areas but open source competitors are gaining ground fast on their way to ubiquity. Things are a-changing in the land of virtualization.
Does incremental block migration work with LVM?
Thursday, February 3, 2011 - 13:33 Michael Closson (not verified)From the description, it sounds like incremental block migration works with qcow2 files as the backing store.
Say I use LVM as the backing store and VMs are an LVM snapshot from a base image. Say that the source and destination hypervisor have the same LVM base images.
Does incremental block migration still work?
Thanks for the feedback. Out
Monday, August 15, 2011 - 19:05 martis (not verified)Thanks for the feedback. Out of curiosity, how's it performing? Noticing any bugs? If you notice any now or in future, please drop a message in this comment section.
Thanks
is this feature accessible from virt-manager ?
Thursday, February 2, 2012 - 17:07 Anonymous (not verified)if not, any plans to make it available that way ?
Post new comment