Skip to contentSkip to conversation

Live migration without shared storage

PATCH Superseded [email protected] 3 participants 6 messages Sep 17, 2009 – Sep 21, 2009

v3 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

v3 cover Live migration without shared storage

This series adds support for live migration without shared storage, means copy the storage while migrating. It was tested with KVM. Supports 2 ways to replicate the storage during migration:
1. Complete copy of storage to destination
2. Assuming the storage is cow based, copy only the allocated data, time of the migration will be linear with the amount of allocated data (user responsibility to verify that the same backend file reside on src and destination).

Live migration will work as follows:
(qemu) migrate -d tcp:0:4444 # for ordinary live migration
(qemu) migrate -d -b tcp:0:4444 # for live migration with complete storage copy
(qemu) migrate -d -i tcp:0:4444 # for live migration with incremental storage copy, storage is cow based.

The patches are against qemu.git tree

 Makefile          |    1 +
 block-migration.c |   43 ++++++++++++-----------------------------
 block-migration.h |    2 +-
 block.c           |   27 ++++++++++++++++++++++++++
 block.h           |    6 ++++-
 block_int.h       |    1 +
 buffered_file.c   |   10 ++++++++-
 hw/hw.h           |    9 ++++++-
 migration-exec.c  |    9 ++++++-
 migration-fd.c    |    7 +++++-
 migration-tcp.c   |    7 +++++-
 migration-unix.c  |    7 +++++-
 migration.c       |   20 +++++++++++++-----
 migration.h       |   20 ++++++++++++++----
 monitor.c         |   38 +++++++++++++++++++++++++++++-------
 qemu-monitor.hx   |    6 +++-
 savevm.c          |   54 +++++++++++++++++++++++++++++++++++++---------------
 sysemu.h          |    2 +-
 vl.c              |    6 ++++-
 19 files changed, 196 insertions(+), 79 deletions(-)
#1 lore raw
Quoted 8 lines · [email protected] wrote:

This series adds support for live migration without shared storage, means copy the storage while migrating. It was tested with KVM. Supports 2 ways to replicate the storage during migration:
1. Complete copy of storage to destination
2. Assuming the storage is cow based, copy only the allocated data, time of the migration will be linear with the amount of allocated data (user responsibility to verify that the same backend file reside on src and destination).

For my understanding: Does it require the use of qcow[2] or does it also work with raw images?

Quoted 7 lines

Live migration will work as follows:
(qemu) migrate -d tcp:0:4444 # for ordinary live migration
(qemu) migrate -d -b tcp:0:4444 # for live migration with complete storage copy
(qemu) migrate -d -i tcp:0:4444 # for live migration with incremental storage copy, storage is cow based.

The patches are against qemu.git tree

...but without signed-off. Are they RFC for now or do you propose them for merge?

Jan

PS: I think there are some style issues remaining like tabs or long lines.

Signature · 2 lines
Siemens AG, Corporate Technology, CT SE 2
Corporate Competence Center Embedded Linux
#2 lore raw

Jan Kiszka <[email protected]> wrote on 17/09/2009 17:03:04:

Quoted 2 lines
Quoted 1 line · [email protected] wrote:

This series adds support for live migration without shared storage,

means

Quoted 1 line
Quoted 1 line

copy the storage while migrating. It was tested with KVM. Supports 2

ways

Quoted 4 lines
Quoted 4 lines

to replicate the storage during migration:
1. Complete copy of storage to destination
2. Assuming the storage is cow based, copy only the allocated data, time of the migration will be linear with the amount of

allocated

Quoted 1 line
Quoted 1 line

data (user responsibility to verify that the same backend file

reside

Quoted 4 lines
Quoted 1 line

on src and destination).

For my understanding: Does it require the use of qcow[2] or does it also work with raw images?

If you call migrate -b it will do a full copy of the disk,
if you call migrate -i it will do incremental copy means that if you have qcow disk it will copy only the allocated data. The base image should be identical
in both source and destination.

Quoted 4 lines
Quoted 4 lines

Live migration will work as follows:
(qemu) migrate -d tcp:0:4444 # for ordinary live migration (qemu) migrate -d -b tcp:0:4444 # for live migration with complete

Quoted 8 lines

storage copy

Quoted 1 line

(qemu) migrate -d -i tcp:0:4444 # for live migration with

incremental storage copy, storage is cow based.

Quoted 2 lines

The patches are against qemu.git tree

...but without signed-off. Are they RFC for now or do you propose them for merge?

I think that RFC is good for now.

Quoted 3 lines

Jan

PS: I think there are some style issues remaining like tabs or long

lines.

Thanks I will fix that.

- Liran

#3 lore raw
Quoted 15 lines · Liran Schour

Jan Kiszka <[email protected]> wrote on 17/09/2009 17:03:04:

Quoted 2 lines
Quoted 1 line · [email protected] wrote:

This series adds support for live migration without shared storage,

means

Quoted 1 line
Quoted 1 line

copy the storage while migrating. It was tested with KVM. Supports 2

ways

Quoted 4 lines
Quoted 4 lines

to replicate the storage during migration:
1. Complete copy of storage to destination
2. Assuming the storage is cow based, copy only the allocated data, time of the migration will be linear with the amount of

allocated

Quoted 1 line
Quoted 1 line

data (user responsibility to verify that the same backend file

reside

Quoted 1 line
Quoted 1 line

on src and destination).

Quoted 8 lines
Quoted 2 lines

For my understanding: Does it require the use of qcow[2] or does it also work with raw images?

If you call migrate -b it will do a full copy of the disk,
if you call migrate -i it will do incremental copy means that if you have qcow disk it will copy only the allocated data. The base image should be identical
in both source and destination.

Ah, ok. So this doesn't affect the feasibility, "just" the effort needed for the replication.

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

Live migration will work as follows:
(qemu) migrate -d tcp:0:4444 # for ordinary live migration (qemu) migrate -d -b tcp:0:4444 # for live migration with complete

Quoted 8 lines
Quoted 6 lines

storage copy

Quoted 1 line

(qemu) migrate -d -i tcp:0:4444 # for live migration with

incremental storage copy, storage is cow based.

Quoted 1 line

The patches are against qemu.git tree

...but without signed-off. Are they RFC for now or do you propose them for merge?

I think that RFC is good for now.

[RFC][PATCH ...] :)

Jan

Signature · 2 lines
Siemens AG, Corporate Technology, CT SE 2
Corporate Competence Center Embedded Linux
#4 lore raw
In reply to Jan Kiszka

Am 17.09.2009 16:03, schrieb Jan Kiszka:

Quoted 10 lines
Quoted 8 lines · [email protected] wrote:

This series adds support for live migration without shared storage, means copy the storage while migrating. It was tested with KVM. Supports 2 ways to replicate the storage during migration:
1. Complete copy of storage to destination
2. Assuming the storage is cow based, copy only the allocated data, time of the migration will be linear with the amount of allocated data (user responsibility to verify that the same backend file reside on src and destination).

Quoted 2 lines

For my understanding: Does it require the use of qcow[2] or does it also work with raw images?

This leads me to the question what the block migration is doing with qcow2 images (or better: images in any format but raw). What happens with non-standard image options (like cluster size)? Are snapshots copied over or won't they be available any more on the destination host?

Kevin

#5 lore raw

Kevin Wolf <[email protected]> wrote on 17/09/2009 18:38:59:

Quoted 3 lines

Am 17.09.2009 16:03, schrieb Jan Kiszka:

Quoted 2 lines
Quoted 1 line · [email protected] wrote:

This series adds support for live migration without shared storage,

means

Quoted 1 line
Quoted 1 line
Quoted 1 line

copy the storage while migrating. It was tested with KVM. Supports 2

ways

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

to replicate the storage during migration:
1. Complete copy of storage to destination
2. Assuming the storage is cow based, copy only the allocated data, time of the migration will be linear with the amount

ofallocated

Quoted 1 line
Quoted 1 line
Quoted 1 line

data (user responsibility to verify that the same backend file

reside

Quoted 3 lines
Quoted 3 lines
Quoted 1 line

on src and destination).

For my understanding: Does it require the use of qcow[2] or does it

also

Quoted 7 lines
Quoted 1 line

work with raw images?

This leads me to the question what the block migration is doing with qcow2 images (or better: images in any format but raw). What happens with non-standard image options (like cluster size)? Are snapshots copied over or won't they be available any more on the destination host?

For now the block migration will only copy data. 2 ways for replicating the data:
-b means copy all data to the destination, image on the destination can be in a
different format from source but all blocks will be written.
-i means copy only allocated data, only the data that is allocated and valid will
be copied (I use bdrv_is_allocated() to figure out what to copy). Base image should
be identical on source and target. No snapshot or any kind of metadata will be copied,
snapshots will be lost on this case.
It is possible to replicate snapshots data also but I did not implement that for now.

- Liran