QEMU的块设备动态迁移(live block migration)

QEMU的动态块设备迁移分为几种情形:

  1. migrate -b : 这是最原始的 块设备迁移 的实现方式.  这种方式将块设备的内容作为live migaration stream的一部分. 使用dirty bitmap,并且采用了pre-copy的方法.不过这种方法慢慢的被灵活性更好的方法替代了.
  2. block-stream: 可以用作 pre-copy 和post-copy两种迁移. 它将产生一个新的image file,用作元磁盘image的backing_file. backing file的内容将被copy到新的image,直到新块已经被写到new image中. 这种方式需要NFS,NBD  或者其他的机制来同时访问new image 和backing file. 这种方式与live migration stream 无关.
  3. drive-mirror灵活性更好.使用他的一种方式为pre-copy磁盘的内容到目的host. 他不使用backing file, 所以目的磁盘可以为任何格式. 同样的,他需要NFS,NBD或者其他的机制来同时访问新旧image. 这个过程 不是 live migration stream的一部分.这种mirroring方式的好处是 在mirring进行过程中掉电或者crash,可以直接继续运行old image, 重新开始mirroring过程就可以了.

 

Could someone share me with some information about the live block migration
strategy in the current qemu-kvm. As I know, there are at least IO
mirroring, dirty block tracking, snapshot, precopy or postcopy strategy
exist for the block migration.
migrate -b is the traditional "block migration" feature in qemu-kvm.
It copies the contents of a block device as part of the live migration
stream.  This is a pre-copy approach using a dirty bitmap.  It is
being replaced by more flexible alternatives.

block-stream can be used for pre- and post-copy migration.  It creates
a new image file that uses the old disk image as its backing file.
The contents of the backing file are copied into the new image unless
new blocks have already been written in the new image.  It requires
NFS, NBD, or another mechanism to access both the new image and the
backing file at the same time.  It is not part of the live migration
stream.

drive-mirror is even more flexible; one way to use it is to pre-copy
the contents of the disk to the destination host.  It does not use
backing files to achieve this, so the destination image can be any
image format.  Again, it requires NFS, NBD, or another mechanism to
access both the new image and the old image.  It is not part of the
live migration stream.  An advantage of the mirroring approach over
block-stream is that you can continue running the old image if there
is a power failure or crash during mirroring - simply discard the new
image and start over.

Stefan

 

你可能感兴趣的:(QEMU)