[Sheepdog] vdi deletion and space reclaiming

MORITA Kazutaka morita.kazutaka at lab.ntt.co.jp
Sat Jul 23 09:38:36 CEST 2011


At Thu, 21 Jul 2011 07:53:48 -0700 (PDT),
luc_rom at yahoo.com wrote:
> Hi again,
> 
> In my three nodes cluster, I had a few VDIs that I deleted using "collie vdi delete" from Sheepdog1, but I see that no space was reclaimed from any of the three Sheepdog nodes.
> 
> Before:
> 
> root at sheepdog1:~# collie vdi list
>   name        id    size    used  shared    creation time   vdi id
> ------------------------------------------------------------------
>   imagenew2     1  5.0 GB  5.0 GB  0.0 MB 2011-07-19 22:31   1a3b42
>   imagenew3     1  1.0 GB  0.0 MB  0.0 MB 2011-07-19 23:26   1a3cf5
>   image        1  1.0 GB   72 MB  0.0 MB 2011-07-18 14:27   28489a
>   imagesmall     1  1.0 GB  1.0 GB  0.0 MB 2011-07-20 23:59   6a4c69
> 
> After:
> root at sheepdog1:~# collie vdi delete imagenew2
> root at sheepdog1:~# collie vdi delete imagenew3
> root at sheepdog1:~# collie vdi delete image
> root at sheepdog1:~# collie vdi delete imagesmall
> root at sheepdog1:~# collie vdi list
>   name        id    size    used  shared    creation time   vdi id
> ------------------------------------------------------------------
> 
> root at sheepdog1:~# sheep --help
> Usage: sheep [OPTION] [PATH]
> Sheepdog Daemon, version 0.2.3
> 
> root at sheepdog1:~# qemu-img create sheepdog:VM_disk -o preallocation=data 5G
> Formatting 'sheepdog:VM_disk', fmt=raw size=5368709120 preallocation='data' 
> root at sheepdog1:~# collie vdi list
>   name        id    size    used  shared    creation time   vdi id
> ------------------------------------------------------------------
>   VM_disk      1  5.0 GB  5.0 GB  0.0 MB 2011-07-21 10:30   d8d400
> 
> root at sheepdog1:~# du -h --max-depth=1 /store_dir/obj/
> 8.6G    /store_dir/obj/00000009
> 6.7G    /store_dir/obj/00000005
> 10G     /store_dir/obj/00000007
> 26G     /store_dir/obj/
> On Sheepdog2, the disk space is still used:
> 
> root at sheepdog2:~/tgt# collie vdi list
>   name        id    size    used  shared    creation time   vdi id
> ------------------------------------------------------------------
>   VM_disk      1  5.0 GB  5.0 GB  0.0 MB 2011-07-21 10:30   d8d400
> root at sheepdog2:~/tgt# du -h --max-depth=1 /store_dir/obj/
> 4.1M    /store_dir/obj/00000003
> 9.8G    /store_dir/obj/00000007
> 8.0K    /store_dir/obj/00000002
> 1.4G    /store_dir/obj/00000009
> 4.0K    /store_dir/obj/00000001
> 321M    /store_dir/obj/00000008
> 108K    /store_dir/obj/00000006
> 40K     /store_dir/obj/00000005
> 8.0K    /store_dir/obj/00000004
> 12G     /store_dir/obj/
> 
> Am I missing a step or how should I delete a VDI in order to reclaim the space?

You deleted them in the right way.  The problem seems that Sheepdog
doesn't delete unused objects which were stored in the old epochs.

I guess all files in /store_dir/obj/0000000[1-8]/* can be removed.
What are the outputs of 'collie cluster info' on three nodes?


Thanks,

Kazutaka



More information about the sheepdog mailing list