[Sheepdog] [PATCH 0/5] modify the usage of snapshot and cloning
chris at arachsys.com
Sun Jan 10 17:12:35 CET 2010
MORITA Kazutaka <morita.kazutaka at lab.ntt.co.jp> writes:
> On Sun, Jan 10, 2010 at 7:16 PM, Chris Webb <chris at arachsys.com> wrote:
> > you can clone a new image from a snapshot of an existing image, but not
> > directly from an existing image;
> Yes. It is same as zvol of ZFS and Amazon EBS.
Yes, this restriction is fine and makes the implementation easier (no
conflicting writes whilst creating the clone). It's always possible to
achieve the same effect as a clone from head by creating a snapshot, cloning
it, and then destroying the snapshot again.
> > once you've cloned a new image, you will be able to delete the source
> > snapshot and the whole original image without losing the clone, going
> > from two references counts to the shared blocks to just one again?
> Yes, sheepdog is expected to be so.
Great! That's the perfect behaviour from our point of view.
> Implementing the following operations looks to be useful, yes?
> - make a patch
> $ shepherd diff src_vdi:src_tag dst_vdi:dst_tag > delta_file
> - apply a patch
> $ shepherd apply vdi:tag delta_file
Yes, exactly so! These would be incredibly useful building blocks in a
hosting setting, and surely more widely of appeal too.
As well as copy-on-write snapshots, convenient off-site backup is something
that our customers constantly ask for, and I'm sure it's the same for many
other infrastructure providers. However, when it comes to implementing this,
it's only practical to do if it can be made efficient in both disk and
network IO, which pretty much implies sending snapshot diffs.
Presumably the apply command can't take a tag because only the 'head' of the
vdi is writeable? Or is the intent to make the head exactly equal to the
snapshot with specified tag with the delta applied, replacing its existing
value? Either behaviour works well.
The block diff format here could be as simple and easy to emit as
64-bit offset [defined endianness]
64-bit size [defined endianness]
SIZE bytes of data
64-bit offset2 [defined endianness]
64-bit size2 [defined endianness]
SIZE2 bytes of data
maybe with a magic number at the start to prevent the apply tool being fed
rubbish by accident.
More information about the sheepdog