[sheepdog] [PATCH v2] dog/cluster: cluster-wide snapshot save or load specified vdi

Ruoyu liangry at ucweb.com
Thu Jun 5 05:37:19 CEST 2014


On 2014年06月03日 20:51, Liu Yuan wrote:
> On Tue, Jun 03, 2014 at 04:59:26PM +0800, Ruoyu wrote:
>> It is useful for users who want to backup or restore only part of
>> all VDIs from cluster-wide snapshot.
>>
>> To show which VDIs are snapshot, dog cluster snapshot show command
>> is added.
>>
>> Usage and example:
>>
>> 1. save all vdi:
>>     dog cluster snapshot save snapname /tmp/ss
>>
>> 2. save some specified vdi:
>>     dog cluster snapshot save snapname /tmp/ss test0 test1 test2
>>
>> 3. load all vdi:
>>     dog cluster snapshot load snapname /tmp/ss
>>
>> 4. load some specified vdi:
>>     dog cluster snapshot load snapname /tmp/ss test6 test0 test3
>>
>> 5. show snapshot:
>>     dog cluster snapshot show snapname /tmp/ss
> I've tried the following command
>
> yliu at ubuntu-precise:~/sheepdog$ dog/dog vdi list
>    Name        Id    Size    Used  Shared    Creation time   VDI id  Copies  Tag
> s test         1  100 MB   12 MB  0.0 MB 2014-06-03 20:43   7c2b25      2            s1
> s test         2  100 MB  4.0 MB  8.0 MB 2014-06-03 20:43   7c2b26      2            s2
> s test         3  100 MB  4.0 MB  8.0 MB 2014-06-03 20:43   7c2b27      2            s3
>    test         0  100 MB  0.0 MB   12 MB 2014-06-03 20:44   7c2b28      2
> yliu at ubuntu-precise:~/sheepdog$ dog/dog cluster snapshot list ./snap
> Index		Tag		Snapshot Time
> 1		test		Tue Jun  3 20:45:05 2014
> yliu at ubuntu-precise:~/sheepdog$ dog/dog cluster snapshot show test ./snap
> The cluster-wide snapshot contains these VDIs:
> hello
>
>
>
> world
>
> brazil
>
> test
> test
> test
>
> yliu at ubuntu-precise:~/sheepdog$ dog/dog cluster snapshot save test2 ./snap s1 s2
> Object not found. It may be caused by:
> 1. The specified VDIs are not found.
> 2. The specified VDIs don't have snapshots.
> Fail to save snapshot to path: ./snap.
>
> -----
>
> 'show' doesn't work as expected. And seems that this patch can't save specified
> snapshots. In above example, I want to save snapshots with the tag name 's1' and
> 's2' of the test tree.
>
> Of you are intended to save just tip snapshots of specified snapshot name?
>
> I'd suggest following
>
> dog cluster snapshot save test2 ./snap test:s1 test:s2
>
> command to save specified snapshots.
I think I did not understand cluster snapshot correctly. I will update 
it later.
But, I suggest the cluster wide snapshot should be based on specified 
VDIs, not be based on its' snapshots.
Otherwise, some elements of the restored VDI object, such as vdi_id and 
parent_vdi_id, may be different to the original one if we choose part of 
the snapshots of the VDI.

>
> Thanks
> Yuan





More information about the sheepdog mailing list