[Sheepdog] sheepdog image created but sheperd does not show it

MORITA Kazutaka morita.kazutaka at lab.ntt.co.jp
Mon Dec 28 07:46:58 CET 2009

On Tue, Dec 29, 2009 at 5:15 AM, Piavlo <piavka at cs.bgu.ac.il> wrote:
> Hi,
> Now it completes fine.

Thanks for testing! I'll merge the fixes later.

> 1) The first find that attracts attention now is that the a single image
> blocks are not evenly distributed among the nodes:
> shell>shepherd info -t sheep
> Id      Size    Used    Use%
>  0      97G     2G        2%
>  1      96G     3G        3%
>  2      98G     1G        1%
> Total   292G    7G        2%, total virtual VDI Size    5G
> shell>
> one node has 904 blocks other 464 blocks and last one has 668 blocks,
> is that expected?

Yes. Sheepdog uses a hash function to map nodes to a consistent hash
ring, so if the number of nodes is small, objects are not well
distributed. I think sheepdog should take different approach to map
nodes to the ring for better balancing.

> 2) The single image blocks are distributed among all nodes, while
> /sheepdog/0/vdi/zopa is created on two nodes only.
> What's the purpose of empty
> /sheepdog/0/vdi/zopa/0000000000040000-00000000 file?

`0000000000040000' is identifier of the vdi object.
`00000000' is a tag number of the vdi object.

For more information, see the following:

> 3) another find is the block numbering
> 40000 40001 40003 40004 40005 40007 40009 4000a ...
> the block numbers 40002 40006 40008 40010 ... are missing on all nodes
> so just wondering how actually the block numbers are incremented/allocated?

Each disk image is divided into 4 MB objects, and lower 18 bits in the
file name (block number) is a index of the objects.

In your case,
 - first 4 MB (0 ~ 4 MB) is allocated as the object 40001
 - the next 4 MB (4 MB ~ 8 MB) is not allocated
 - the next 4 MB (8 MB ~ 12 MB) is allocated as the object 40003
 - the next 4 MB (12 MB ~ 16 MB) is allocated as the object 40004
 - ...
  (40000 is a vdi object, and contains metadata for the VM)

> 4) How do I delete a sheepdog image?
> 5) How do I rename a sheepdog image?

Not supported yet.

> 6) What is supposed to happen if i interrupt sheepdog image creation?

In the worst case, images will be corrupted because we haven't implemented
atomic update of replication yet. Moreover, creation tools may leave
images locked. I'll fix this problem but you can unlock the image mannually
by the following command:

shepherd debug -o release_vdi zopa
  (zopa is your vdi name)

> 7) After I created several images and stop sheepdog all nodes and
> started them later again, all VMs can be listed but then I try to create
> another image I get
> shell-srv1> kvm-img convert -f raw -O sheepdog /dev/sys/kvm-img foo
> find_vdi_name 1041: Invalid error code, foo
> find_vdi_name 1041: Invalid error code, foo
> qemu-img: Could not open 'foo'
> sheel-srv1>

Sorry, I couldn't reproduce the problem. Please confirm that applying
the patch and running make on all three nodes. If the problem is not
resolved, would you send me collie logs in /var/log/syslog?

> 8) Started a VM with sheepdog image but it gets stuck during the boot
> process:

I couldn't reproduce this, too. What happens if you use only one node
or --copies=3 option?


MORITA, Kazutaka

More information about the sheepdog mailing list