qemu-stable
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-stable] QEMU Live Snapshots


From: Robert P
Subject: [Qemu-stable] QEMU Live Snapshots
Date: Mon, 26 Sep 2011 19:22:22 +0200

Hello,

currently our company is using a relatively new feature of qemu for our virtual Machines (KVM), called Lived Snapshot of a device (Ubuntu Natty 64bit):

The main idea would be having 2 KVM's with same data consistent on a Master / Slave Server, or in the worst case, the base Image in the Slave only misses the last snapshot.

At the moment, i've only found a link in german:

"Ab QEMU 0.13 lässt sich ein Live-Snapshot eines Devices anlegen. Das heißt, es wird während der Laufzeit der virtuellen Maschine der aktuelle Zustand eines Devices in eine neue Image-Datei kopiert. Dies wird mit dem Befehl snapshot_blkdev im QEMU-Monitor erreicht. Dazu ist das Device sowie der Name und das Format der neuen Image-Datei anzugeben.

(qemu) info block
ide0-hd0: type=hd removable=0 file=ubuntu-server.img ro=0 drv=qcow2 encrypted=0
(qemu) snapshot_blkdev ide0-hd0 Platte-Snapshot.img qcow2"
Link:
http://qemu-buch.de/de/index.php/QEMU-KVM-Buch/_Speichermedien/_Images_anlegen/_Overlay-Images_anlegen

So, my idea would be:

We do have 2 physical servers (with an identical Base-Image (qcow2). At, let's say the "Master", and there's an KVM Machine running, with its own snapshot and initially started as described above.
Periodically a new snapshot is being taken, for writing on the data. So the old snapshots will be kept, to have them as differential Backup. 

The "old" snapshots will be rsync'ed to the other server, let's say the "Slave", periodically.
The actual snapshot, where the Master Server is writing it's current data, does not get rsync'ed to the slave.

On the Slave, the snapshots will be committed explicitely into the other KVM-Image, also in correct order (i suppose).
First oldest, then newer, up to the newest.

For example, the order would be:
Mon Sep 26 18:15:12 CEST 2011 | snapshot-KVM_APH-2011-09-26-1808.ovl
Mon Sep 26 18:15:12 CEST 2011 | snapshot-KVM_APH-2011-09-26-1812.ovl
Mon Sep 26 18:15:12 CEST 2011 | snapshot-KVM_APH-hpsrv-slave-2011-09-26-1804.ovl
Mon Sep 26 18:31:38 CEST 2011 | snapshot-KVM_APH-2011-09-26-1828.ovl
Mon Sep 26 18:31:38 CEST 2011 | snapshot-KVM_APH-hpsrv-slave-2011-09-26-1826.ovl
Mon Sep 26 18:34:48 CEST 2011 | snapshot-KVM_APH-2011-09-26-1830.ovl
Mon Sep 26 18:43:03 CEST 2011 | snapshot-KVM_APH-2011-09-26-1834.ovl

If this is done once, everything works fine. All the data from the KVM at the Master is in the second KVM at the slave (in the Base-Image).
The "Base" Image would be the big KVM qcow2 Image itself, not a snapshot.
I've also made sure, that no snapshot will be committed a second time into the base-Image on the Slave.

Second run:

New data is being written on the master, and another snapshot is being allocated from qemu. I am doing that periodically by cron.
So the last snapshot (with the new data in it) gets rsync'ed again to the slave, and there it's beeing commited into the base Image.
BUT, there is no data of that snapshot in the base-Image. 
Qemu-Monitor only says "Image committed".

Can  somebody please tell me, what is possible done wrong?
Or is that a feature, what cannot be done with live snapshots?
Is there maybe a more "elegant" solution?

Thanks in advance.
Robert








reply via email to

[Prev in Thread] Current Thread [Next in Thread]