[Sheepdog] [PATCH 0/5] modify the usage of snapshot and cloning

MORITA Kazutaka morita.kazutaka at lab.ntt.co.jp
Sun Jan 10 22:27:04 CET 2010

On Mon, Jan 11, 2010 at 1:12 AM, Chris Webb <chris at arachsys.com> wrote:
>> 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.

Okay, I'll add it to TODO list.

> 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.

What I thought is that the apply command moves the position of HEAD.
For example,

  $ shepherd info -t vdi -f tree john

  $ shepherd apply john:tag_1 delta_file
  (New image is created and it becomes HEAD. Previous HEAD becomes a snapshot.)

  $ shepherd info -t vdi -f tree john

This behavior is the same as when writing data to the snapshot.

Anyway, we may as well discuss more about snapshot semantics.

> 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.

Using a standardized format may be better such as VCDIFF.


Kazutaka Morita

More information about the sheepdog mailing list