[Sheepdog] [PATCH v3] sheep: change snapshot/clone flow
MORITA Kazutaka
morita.kazutaka at gmail.com
Fri Apr 20 22:56:24 CEST 2012
At Fri, 20 Apr 2012 14:40:26 +0800,
yaohaiting.wujue at gmail.com wrote:
>
> From: HaiTing Yao <wujue.yht at taobao.com>
>
> When create snapshot for source VDI, the new created VDI used as source
> VDI, and the old source VDI used as snapshot. This flow make users
> confused about VDI and snapshot relation. The snapshot metadata maybe is
> stored on multi-VDI, so need read multi VDIs inode to get snapshot list.
>
> When create snapshot, we does not need change new created VDI to source
> VDI. The source VDI just need use snapshot VDI ID as its object data ID.
>
> Show one example.
>
> Before modification:
>
> Name Id Size Used Shared Creation time VDI id Tag
> s v1 1 64 MB 20 MB 0.0 MB 2012-03-26 16:55 709128
> s v1 2 64 MB 0.0 MB 20 MB 2012-03-26 16:56 709129 sn3
> v1 3 64 MB 0.0 MB 20 MB 2012-03-26 16:56 70912a
>
> After modification:
>
> Name Id Size Used Shared Creation time VDI id Tag
> v1 0 64 MB 20 MB 0.0 MB 2012-03-27 11:06 709128
> s v1 1 64 MB 0.0 MB 20 MB 2012-03-27 11:06 709129
> s v1 2 64 MB 0.0 MB 20 MB 2012-03-27 11:07 70912a sn3
>
> Signed-off-by: HaiTing Yao <wujue.yht at taobao.com>
> ---
> collie/common.c | 2 +-
> collie/vdi.c | 33 ++++++++++++++++++++++-----------
> include/sheepdog_proto.h | 6 ++++--
> sheep/vdi.c | 18 ++++++++++--------
> 4 files changed, 37 insertions(+), 22 deletions(-)
Your patch breaks the relationship between VDI snapshots.
For example:
==
$ collie cluster format -c 1
$ qemu-img create sheepdog:test 4G
$ qemu-img snapshot -c tag1 sheepdog:test
$ qemu-img snapshot -c tag2 sheepdog:test
$ qemu-img snapshot -c tag3 sheepdog:test
$ qemu-img create sheepdog:test2 4G
$ qemu-img snapshot -c tag1 sheepdog:test2
$ qemu-img snapshot -c tag2 sheepdog:test2
$ qemu-io -c "write 0 512" sheepdog:test2:1
$ qemu-img snapshot -c tag3 sheepdog:test2
$ collie vdi tree
==
and the expected output is:
==
test---[2012-04-21 05:51]---[2012-04-21 05:51]---[2012-04-21 05:51]---(you are here)
test2---[2012-04-21 05:51]-+-[2012-04-21 05:51]---[2012-04-21 05:51]
`-[2012-04-21 05:51]---(you are here)
==
BTW, How about displaying the current Id as zero and removing VDI id
from the output of 'collie vdi list'? VDI IDs are used for internal
purpose only, so I think we don't need to display them here. I'd like
to avoid changing the VDI structure if possible.
Thanks,
Kazutaka
More information about the sheepdog
mailing list