KVM - The Linux Kernel-Based Virtual Machine
News, Blogs and Resources on the Linux (KVM) Kernel-Based Virtual Machine

qemu-kvm-0.12 adds block migration feature

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.

  • Live migration with complete storage copy
  • Live migration with incremental storage copy . This is for the case where you're using a “linked image”. In other words, If you're using a copy on write block image based on a base image a.k.a backing file. In this case the backing file must be present on both source and destination servers. For more on backing files or base images see the following post on base images.

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.

 

See Also

Comments

Great feature! Especially for

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

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

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

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

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

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

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?

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

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 ?

if not, any plans to make it available that way ?

Post new comment

The content of this field is kept private and will not be shown publicly.
Type the characters you see in this picture. (verify using audio)
Type the characters you see in the picture above; if you can't read them, submit the form and a new image will be generated. Not case sensitive.