LTDD: Userland Cloud Block Device
The software (version 0.2.0rc4) is available at ltdd-0.2.0rc4.tar.gz. The detailed manual and technical documents will be provided in future. If you have any comments on this software, please let us <bug __at__ scyphus.co.jp> (please replace "__at__" with "@") know.
Redistribution of this software without authors' permission is prohibited because the license is under consideration now. You are allowed to use this software for personal purposes on your own responsibility. An appropriate license will come when it becomes ready.
- Attach / Detach: Attach an image file or a block device as a virtual disk
- Snapshot: Create a snapshot image of a virtual disk, with keeping consistency (i.e., at a certain time)
- Clone: Attach a virtual disk (destination disk) and clone data from another virtual disk (source disk) while keeping consistency with the source disk, meaning that the destination disk might be blank and will be a master of data after cloning completes, and the source disk has been the master. In case you virtualize a physical server, the source disk is the physical disk and the destination disk is the virtual disk.
How to use it
The ltdd kernel module interface is compatible with nbd. To load the nbd driver, execute the following command:
# modprobe nbd
The number of created nbd devices can be specified as follows:
# modprobe nbd nbds_max=32
Here, the specified number is 32.
Launch the ltddmgr first for any cases
The following command is executed to use /dev/nbd1.
# ./mgr/ltddmgr /dev/nbd1
Case 1: Attaching a local image file to nbd1
To attach a local image file /tmp/foo.img to nbd1 (i.e., ltddmgr), execute the following command:
# ./ctl/ltddctl attach nbd1 local:///tmp/foo.img
To check the current status of nbd1, you can use the status sub-command with ltddctl:
# ./ctl/ltddctl status nbd1 Password for ltddmgr (up to 32 characters): Vdisk attached: local:///tmp/foo.img
To create a snapshot of the attached virtual disk to the file /tmp/foo.bak.img, snapshot sub-command can be used:
# ./ctl/ltddctl snapshot nbd1 local:///tmp/foo.bak.img
Note that snapshot sub-command is available if and only if the current status is "attached", without creating any other snapshots nor cloning.
You can detach the virtual disk from nbd1 (i.e., ltddmgr) by the following command (when not creating a snapshot nor cloning):
# ./ctl/ltddctl detach nbd1
Case 2: Hot-cloning from /tmp/bar.img to /tmp/foo.img
To clone data in /tmp/bar.img to the virtual disk attached to /tmp/foo.img, the following command is used instead of the attach sub-command:
# ./ctl/ltddctl clone nbd1 local:///tmp/foo.img local:///tmp/bar.img
Case 3: Attaching a remote image file to nbd1
Before attaching the remote image file, launch virtual disk controller "ltddiod" on the remote host:
remote# ./io/ltddiod /tmp/foo.img rw 0.0.0.0 5001
Here the second argument denote the path to the image file to be exported. Moreover, the third, fourth, and fifth arguments ("rw", "0.0.0.0", and "5001") denote mode ("rw" is read/write mode), listening IP address ("0.0.0.0" is a wildcard for IPv4 addresses), and listening port number.
To stop the launched ltddiod, the following command is to used:
remote# ./io/ltddioctl 5001 stop
To attach the remote file through ltddiod to nbd1 (i.e., ltddmgr), execute the following command on the local host:
local# ./ctl/ltddctl attach nbd1 remote://remote-hostname:5001
# ./ctl/ltddctl disconnect nbd1
- CentOS 5.6 (Linux kernel 2.6.18) + GCC version 4.1.2