All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] Live Block Migration using Mirroring
@ 2012-02-22 17:13 Federico Simoncelli
  2012-02-22 17:13 ` [Qemu-devel] [PATCH 1/3] Add blkmirror block driver Federico Simoncelli
                   ` (10 more replies)
  0 siblings, 11 replies; 95+ messages in thread
From: Federico Simoncelli @ 2012-02-22 17:13 UTC (permalink / raw)
  To: qemu-devel; +Cc: kwolf, mtosatti

Hi,
 recently I've been working on live block migration combining the live
snapshots and the blkmirror patch sent by Marcelo Tosatti few months ago.

The design is summarized at this url as "Mirrored-Snapshot": 

http://www.ovirt.org/wiki/Features/Design/StorageLiveMigration

The design assumes that the qemu process can reach both the source and
destination storages and no real VM migration between hosts is involved.
The principal problem that it tries to solve is moving a VM to a new
reachable storage (more space, faster) without temporarily disrupting its
services.

The following set of patches are implementing the required changes in
QEMU.

Here it is a quick example of the use case (for consistency with the
design at the url above I will use the same step numbers):

Preparation
===========

$ mkdir /tmp/{src/dst}
$ qemu-img create -f qcow2 /tmp/src/hd0base.qcow2 20G
Formatting '/tmp/src/hd0base.qcow2', fmt=qcow2 size=21474836480
encryption=off cluster_size=65536

Step 1 - Initital Scenario
==========================
VM1 is running on the src/hd0base. (Where "<=" stands for "uses")

[src/hd0base] <= VM1(read-write)

$ qemu-system-x86_64 -hda /tmp/src/hd0base.qcow2 -monitor stdio
QEMU 1.0.50 monitor - type 'help' for more information
(qemu)

Step 3 - Mirrored Live Snapshot
===============================
A mirrored live snapshot is issued using src/hd0snap1 and dst/hd0snap1 as
image files. (Where "<-" stands for "has backing file")

[src/hd0base] <- [src/hd0snap1] <= VM1(read-write)
     ...      <- [dst/hd0snap1] <= VM1(write-only)

$ qemu-img create -f qcow2 \
           -b /tmp/src/hd0base.qcow2 /tmp/src/hd0snap1.qcow2 20G
Formatting '/tmp/src/hd0snap1.qcow2', fmt=qcow2 size=21474836480
backing_file='/tmp/src/hd0base.qcow2' encryption=off cluster_size=65536

$ qemu-img create -f qcow2 \
           -b /tmp/dst/hd0base.qcow2 /tmp/dst/hd0snap1.qcow2 20G
Formatting '/tmp/dst/hd0snap1.qcow2', fmt=qcow2 size=21474836480
backing_file='/tmp/src/hd0base.qcow2' encryption=off cluster_size=65536

(qemu) snapshot_blkdev -n ide0-hd0 \
         blkmirror:/tmp/src/hd0snap1.qcow2:/tmp/dst/hd0snap1.qcow2 blkmirror

Step 4 - Backing File Copy
==========================
An external manager copies src/hd0base to the destination dst/hd0base.

[src/hd0base] <- [src/hd0snap1] <= VM1(read-write)
[dst/hd0base] <- [dst/hd0snap1] <= VM1(write-only)

$ cp -a /tmp/src/hd0base.qcow2 /tmp/dst/hd0base.qcow2

Step 5 - Final Switch to Destination
====================================
VM1 is now able to switch to the destination for both read and write
operations.

[src/hd0base] <- [src/hd0snap1] <= VM1(read-write)

(qemu) snapshot_blkdev -n ide0-hd0 /tmp/dst/hd0snap1.qcow2

-- 
Federico

^ permalink raw reply	[flat|nested] 95+ messages in thread

end of thread, other threads:[~2012-03-05 18:05 UTC | newest]

Thread overview: 95+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-02-22 17:13 [Qemu-devel] Live Block Migration using Mirroring Federico Simoncelli
2012-02-22 17:13 ` [Qemu-devel] [PATCH 1/3] Add blkmirror block driver Federico Simoncelli
2012-02-23 16:14   ` Stefan Hajnoczi
2012-02-23 16:18     ` Stefan Hajnoczi
2012-02-23 16:20       ` Federico Simoncelli
2012-02-23 16:28         ` Stefan Hajnoczi
2012-02-23 16:51           ` Federico Simoncelli
2012-02-23 16:18     ` Federico Simoncelli
2012-02-27  9:23     ` Stefan Hajnoczi
2012-02-27 11:37       ` Paolo Bonzini
2012-02-27 11:42         ` Stefan Hajnoczi
2012-02-27 11:48           ` Paolo Bonzini
2012-02-27 13:09             ` Stefan Hajnoczi
2012-02-27 13:47               ` Paolo Bonzini
2012-02-27 14:49                 ` Stefan Hajnoczi
2012-02-27 14:59                   ` Stefan Hajnoczi
2012-02-27 15:08                     ` Paolo Bonzini
2012-02-22 17:13 ` [Qemu-devel] [PATCH 2/3] Update the " Federico Simoncelli
2012-02-23  7:18   ` Paolo Bonzini
2012-02-23  9:44     ` Federico Simoncelli
2012-02-23  9:45       ` Paolo Bonzini
2012-02-22 17:13 ` [Qemu-devel] [PATCH 3/3] Add nocreate option to snapshot_blkdev Federico Simoncelli
2012-02-23  7:19   ` Paolo Bonzini
2012-02-23  7:38     ` Paolo Bonzini
2012-02-23  9:39       ` Federico Simoncelli
2012-02-23  9:48         ` Paolo Bonzini
2012-02-23 10:19           ` Federico Simoncelli
2012-02-23 11:30             ` Paolo Bonzini
2012-02-23 15:47 ` [Qemu-devel] Live Block Migration using Mirroring Stefan Hajnoczi
2012-02-23 16:10   ` Federico Simoncelli
2012-02-23 16:35 ` Stefan Hajnoczi
2012-02-23 17:06   ` Federico Simoncelli
2012-02-24 11:37 ` [Qemu-devel] [PATCH 1/2] Add blkmirror block driver Federico Simoncelli
2012-02-24 11:37 ` [Qemu-devel] [PATCH 2/2] Add the blockdev-reopen and blockdev-migrate commands Federico Simoncelli
2012-02-24 12:03   ` Kevin Wolf
2012-02-24 12:12     ` Federico Simoncelli
2012-02-24 13:11     ` Paolo Bonzini
2012-02-24 17:04     ` Luiz Capitulino
2012-02-27 14:57     ` Markus Armbruster
2012-02-24 16:49 ` [Qemu-devel] [PATCH 1/2 v2] Add blkmirror block driver Federico Simoncelli
2012-02-24 17:02   ` Eric Blake
2012-02-24 17:15     ` Federico Simoncelli
2012-02-24 18:49     ` Paolo Bonzini
2012-02-24 18:17   ` Luiz Capitulino
2012-02-27  9:17     ` Federico Simoncelli
2012-02-24 16:49 ` [Qemu-devel] [PATCH 2/2 v2] Add the blockdev-reopen and blockdev-migrate commands Federico Simoncelli
2012-02-24 17:46   ` Eric Blake
2012-02-24 18:57     ` Paolo Bonzini
2012-02-24 19:37       ` Eric Blake
2012-02-24 19:01   ` Luiz Capitulino
2012-02-24 19:40     ` Eric Blake
2012-02-24 20:26       ` Luiz Capitulino
2012-02-24 22:46         ` Eric Blake
2012-02-24 20:32     ` Paolo Bonzini
2012-02-24 20:36       ` Luiz Capitulino
2012-02-24 21:05         ` Paolo Bonzini
2012-02-24 22:30     ` Eric Blake
2012-02-25  6:47       ` Paolo Bonzini
2012-02-27 11:29     ` Federico Simoncelli
2012-02-27 12:12       ` Luiz Capitulino
2012-02-27 12:49         ` Paolo Bonzini
2012-02-27 13:06           ` Luiz Capitulino
2012-02-27 14:39             ` [Qemu-devel] drive transactions (was Re: [PATCH 2/2 v2] Add the blockdev-reopen and blockdev-migrate commands) Paolo Bonzini
2012-02-27 14:46               ` Anthony Liguori
2012-02-27 14:54                 ` Paolo Bonzini
2012-02-27 14:59                   ` Anthony Liguori
2012-02-27 15:03                     ` Paolo Bonzini
2012-02-27 15:06                       ` Anthony Liguori
2012-02-27 15:17                     ` Kevin Wolf
2012-02-27 15:24                       ` Anthony Liguori
2012-02-27 16:51                         ` Paolo Bonzini
2012-02-27 16:58                           ` Anthony Liguori
2012-02-27 17:06                             ` Paolo Bonzini
2012-02-27 16:33               ` Federico Simoncelli
2012-02-27 16:41                 ` Paolo Bonzini
2012-02-27 16:42                 ` Anthony Liguori
2012-02-27 16:50                   ` Federico Simoncelli
2012-02-27 16:53                     ` Anthony Liguori
2012-02-27 16:54                       ` Paolo Bonzini
2012-02-27 16:59                         ` Anthony Liguori
2012-02-27 17:37                   ` Luiz Capitulino
2012-02-28 15:47 ` [Qemu-devel] Live Block Migration using Mirroring Stefan Hajnoczi
2012-02-28 17:15   ` Federico Simoncelli
2012-02-28 17:36     ` Paolo Bonzini
2012-02-28 17:46       ` Federico Simoncelli
2012-02-28 18:02         ` Paolo Bonzini
2012-02-28 18:21           ` Federico Simoncelli
2012-02-28 17:26   ` Paolo Bonzini
2012-02-29 12:28   ` [Qemu-devel] [PATCHv3] Add blkmirror block driver Federico Simoncelli
2012-02-29 13:02     ` Federico Simoncelli
2012-02-29 17:01   ` [Qemu-devel] [PATCHv4] " Federico Simoncelli
2012-03-05 16:59 ` [Qemu-devel] Live Block Migration using Mirroring Marcelo Tosatti
2012-03-05 17:20   ` Eric Blake
2012-03-05 17:44     ` Marcelo Tosatti
2012-03-05 18:05       ` Paolo Bonzini

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.