Sheepdog is a distributed storage system for QEMU. It provides highly available block level storage volumes to virtual machines. Sheepdog supports advanced volume management features such as snapshot, cloning, and thin provisioning.
Sheepdog is an Open Source software, released under the terms of the GNU General Public License version 2.
For the latest information about Sheepdog, please visit our website at:
And (recommend for new comers) wiki at: https://github.com/sheepdog/sheepdog/wiki/
Please read the INSTALL file distributed with this package for detailed instructions on installing or compiling from source.
Cluster Management Backends
Sheepdog uses a cluster management backend to manage membership and broadcast messages to the cluster nodes.
For now, sheepdog can use local driver (for development on a single box), corosync (the default), zookeeper and Accord.
This driver just makes use of UNIX IPC mechanism to manage the membership on a single box, where we start multiple 'sheep' processes to simulate the cluster. It is very easy and fast setup and especially useful to test functionality without involving any other software.
To set up a 3 node cluster using local driver in one liner bash:
$ mkdir /path/to/store $ for i in 0 1 2; do sheep -c local /path/to/store/$i -z $i -p 700$i;done
Nearly every modern Linux distribution has x86_64 corosync binaries pre-built available via their repositories. We recommend you use these packages if they are available on your distribution.
For debian package based systems:
$ sudo aptitude install corosync libcorosync-dev
For RPM package based systems:
$ sudo yum install corosynclib-devel
Reference our wiki, the corosync(8) and corosync.conf(5) man page for further details.
Launch sheepdog on each machines of the cluster.
$ sheep /store_dir
Notes: /store_dir is a directory to store objects. The directory must be on the filesystem with an xattr support. In case of ext3, you need to add 'user_xattr' to the mount options.
$ sudo mount -o remount,user_xattr /store_device
$ dog cluster format --copies=3
--copies specifies the number of default data redundancy. In this case, the replicated data is stored on three machines.
Check cluster state
Following list shows that Sheepdog is running on 32 nodes.
0 0308164db75cff7e - 10.68.13.15:7000
Create a virtual machine image
Create a 256 GB virtual machine image of Alice.
$ qemu-img create sheepdog:Alice 256G
You can also convert from existing KVM images to Sheepdog ones.
$ qemu-img convert ~/amd64.raw sheepdog:Bob
See Sheepdog images by the following command.
Bob 0 2.0 GB 1.6 GB 0.0 MB 2010-03-23 16:16 80000 Alice 0 256 GB 0.0 MB 0.0 MB 2010-03-23 16:16 40000
Boot the virtual machine
Boot the virtual machine.
$ qemu-system-x86_64 -hda sheepdog:Alice
Following command checks used images.
$ dog vm list Name |Vdi size |Allocated| Shared | Status ----------------+---------+---------+---------+------------ Bob | 2.0 GB| 1.6 GB| 0.0 MB| running on xx.xx.xx.xx Alice | 256 GB| 0.0 MB| 0.0 MB| not running
$ qemu-img snapshot -c name sheepdog:Alice
-c flag is meaningless currently
After getting snapshot, a new virtual machine images are added as a not- current image.
Bob 0 2.0 GB 1.6 GB 0.0 MB 2010-03-23 16:16 80000 Alice 0 256 GB 0.0 MB 0.0 MB 2010-03-23 16:21 c0000 s Alice 1 256 GB 0.0 MB 0.0 MB 2010-03-23 16:16 40000
You can boot from the snapshot image by spcifing tag id
$ qemu-system-x86_64 -hda sheepdog:Alice:1
Cloning from the snapshot
Create a Charlie image as a clone of Alice's image.
$ qemu-img create -b sheepdog:Alice:1 sheepdog:Charlie
Charlie's image is added to the virtual machine list.
Bob 0 2.0 GB 1.6 GB 0.0 MB 2010-03-23 16:16 80000 Alice 0 256 GB 0.0 MB 0.0 MB 2010-03-23 16:21 c0000 s Alice 1 256 GB 0.0 MB 0.0 MB 2010-03-23 16:16 40000 Charlie 0 256 GB 0.0 MB 0.0 MB 2010-03-23 16:23 100000
- Debian squeeze amd64 - Debian lenny amd64
=============================================================================== Copyright (C) 2009-2011, Nippon Telegraph and Telephone Corporation.
Join the chat at https://gitter.im/sheepdog/sheepdog