This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
Home Products Support Community News


[Xen-devel] demo code to create lvm snapshots for checkpointed domains

To: Xen Developers <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] demo code to create lvm snapshots for checkpointed domains
From: Brendan Cully <brendan@xxxxxxxxx>
Date: Thu, 14 Dec 2006 23:46:18 -0800
Delivery-date: Thu, 14 Dec 2006 23:46:49 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Mail-followup-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.13 (2006-11-21)
Here's some terrible code that demonstrates how one might create
synchronised LVM snapshots of running domains. It hooks into the
external-device-migrate script to call lvcreate -s at xm save time
during migrate round 2. There's also an awful wrapper around xm save
-c that rewrites the resulting save record to use the snapshot as its
vbd instead of the parent device. It'd be really nice if there were a
way to rewrite the config at save time instead of afterwards.

This code will probably set your computer on fire. I'm just posting it
because it's hard to play with checkpoints without some kind of disk
snapshot mechanism.

The pieces: a vbd-migrate.sh script that goes into /etc/xen/scripts to
be sourced by external-device-migrate, an lvm-save script called by
vbd-migrate to do the actual work of creating the snapshot, and a
checkpoint wrapper to create the checkpoint and rewrite the resulting
image. They're not useful out of the box unless your home directory is

Attachment: vbd-migration.sh
Description: Text document

Attachment: lvm-save
Description: Text document

Attachment: checkpoint
Description: Text document

Xen-devel mailing list
<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] demo code to create lvm snapshots for checkpointed domains, Brendan Cully <=