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

Post new comment

The content of this field is kept private and will not be shown publicly.