[sheepdog-users] Snapshot and backup

MORITA Kazutaka morita.kazutaka at lab.ntt.co.jp
Mon Mar 18 10:02:41 CET 2013


At Wed, 13 Mar 2013 13:10:24 +0100,
Valerio Pachera wrote:
> 
> Hi, I'm studing and testing the use of snapshot and backup.
> 
> I have this vdi
> 
> collie vdi list
>   Name        Id    Size    Used  Shared    Creation time   VDI id  Copies  Tag
>   win2003      0   60 GB  3.4 GB  0.0 MB 2013-03-06 15:01    64c5e
> 3
>   test         0  5.0 GB  0.0 MB  0.0 MB 2013-03-13 12:19   7c2b25
> 7
>   wheezy       0   10 GB  1.8 GB  0.0 MB 2013-03-06 15:06   9533ed
> 3
> s squeeze      1   10 GB  1.7 GB  0.0 MB 2013-03-06 14:47   a34c67
> 3
> s squeeze      2   10 GB  188 MB  1.6 GB 2013-03-13 09:51   a34c68
> 3
> s squeeze      3   10 GB  180 MB  1.6 GB 2013-03-13 09:53   a34c69
> 3
>   squeeze      0   10 GB  212 MB  1.6 GB 2013-03-13 09:54   a34c6a     3
> 
> I've been looking the syntax of vdi restore and, honestly, I thought I
> was going to pass only the vdi name and snapshot id, so sheepdog was
> going to revert the snapshot to the vdi.
> But syntax report '<vdiname> <backup>'.
> I do not know what 'backup' means.

The syntax is wrong.  I'll fix it later.

Currently, vdi backup and restore use stdin and stdout.  Here is an
example usage:

  (create an incremental backup between snap1 and snap2)
  $ collie vdi list
    Name        Id    Size    Used  Shared    Creation time   VDI id  Copies  Tag
  s test         1  4.0 GB  4.0 MB  0.0 MB 2013-03-18 17:37   7c2b25     1         snap1
  s test         2  4.0 GB  4.0 MB  0.0 MB 2013-03-18 17:37   7c2b26     1         snap2
    test         0  4.0 GB  0.0 MB  4.0 MB 2013-03-18 17:37   7c2b27     1              
  $ collie vdi backup test -F snap1 -s snap2 > /tmp/backup

  (restore vdi with the backup file)
  $ collie vdi restore test -s snap1 < /tmp/backup

  (restored image is created as a new snapshot [id=3])
  $ collie vdi list
    Name        Id    Size    Used  Shared    Creation time   VDI id  Copies  Tag
  s test         1  4.0 GB  4.0 MB  0.0 MB 2013-03-18 17:37   7c2b25     1         snap1
  s test         2  4.0 GB  4.0 MB  0.0 MB 2013-03-18 17:37   7c2b26     1         snap2
  s test         3  4.0 GB  4.0 MB  0.0 MB 2013-03-18 17:39   7c2b27     1
    test         0  4.0 GB  0.0 MB  4.0 MB 2013-03-18 17:39   7c2b28     1

> So I run
> 
>   collie vdi restore -s 1 squeeze new
> 
> It seems to be hanged up...

I think your collie waited for backuped data from stdio.

> And the vdi squeeze (id 0) seems disappeared :-) !!!

Seems that we need to add some improvement for users to use this
command more safely:

 - Don't restore vdi when stdin is not pipe.
 - Prompt to make sure that this command gets rid of any changes from
   the previous snapshot.
 - Create a non-snapshot vdi (id = 0) even if user interrupts the
   command.

Thanks,

Kazutaka



More information about the sheepdog-users mailing list