-Ganet extstorage provider for local zfs volumes
+Ganeti extstorage provider for local zfs volumes
http://docs.ganeti.org/ganeti/master/html/man-ganeti-extstorage-interface.html
+It also encludes LVM emulation which enable zfs to work as plain disk type.
+
+This allows usage of drbd where one (or both) sides are on zfs, and supports
+gnt-backup export and import.
+
+
INSTALLATION
-On node which has zfs storage pool
+On node which will host zfs storage pool
cd /usr/share/ganeti/extstorage/
git clone https://github.com/ffzg/ganeti-extstorage-zfs zfs
cd zfs
vi defaults.sh
-You need to specify zfs filesystem under which block devices will be created.
-
-Now ssh into ganeti master node and do following:
+Alternative to editing defaults.sh is to create etc/`hostname -s` file
+with minimal configuration which just specify pool name (in this case
+again hostname -s) and filesystem where new volumes will be created:
-1. enable new disk template
+ echo EXTP_ZFS=`hostname -s`/ffzgvg > etc/`hostname -s`.sh
+
- gnt-cluster modify --enabled-disk-templates plain,drbd,ext \
- --ipolicy-disk-templates plain,drbd,ext
+Run install scripts:
-2. create log directory
+# ls install/
+1-enable-ext-template.sh 2-create-log-directory.sh 3-lvm-wrappers.sh
- mkdir /var/log/ganeti/extstorage
-3. try instance creation with something similar to
+Cron helper can be install under /etc/cron.daily
- gnt-instance add -t ext --disk=0:size=10G,provider=zfs \
- --net 0:mode=bridged,link=br1001 \
- --net 1:mode=bridged,link=br0060 \
- --net 2:mode=bridged,link=br0080 \
- --no-name-check --no-ip-check \
- -o debootstrap+default \
- -B maxmem=1G -n arh-hw zfs
+# ls cron/
+daily-block-snapshot purge-log
-4. install helper scripts for daily block snapshots
- ln -sf /usr/share/ganeti/extstorage/zfs/bin/daily-block-snapshot /etc/cron.daily/
+Overview commands are available (try running them to see output):
-5. install lvm wrapper scripts to report zfs volumes as lv
+# ls bin/
+adopt backup ill instance list node
- find /usr/share/ganeti/extstorage/zfs/sbin/ -type f | xargs -i ln -v -s -f {} /sbin/
+backup and instance are wrappers for running gnt-* commands
+with same name on master node
-This scripts enable gnt-node commands to work:
+adopt will create new zvol using send/receive to break dependency on origin
+(otherwise, removal of origin zvol will also remove new adopted disk
-root@vmh02:/home/dpavlin# gnt-node list arh-hw
-Node DTotal DFree MTotal MNode MFree Pinst Sinst
-arh-hw.gnt.ffzg.hr 87.8G 87.2G 7.8G 252M 5.6G 1 0
-root@vmh02:/home/dpavlin# gnt-node list-storage arh-hw
-Node Type Name Size Used Free Allocatable
-arh-hw.gnt.ffzg.hr lvm-vg arh-hw 190.0G 62.7G 127.3G Y
-arh-hw.gnt.ffzg.hr lvm-vg ffzgvg 87.8G 610M 87.2G Y
+Create test instances:
+# ls t/*.sh
+t/drbd.sh t/plain.sh t/zfs.sh
-HELPER SCRIPTS
+Review that instaces have been created:
-Helper scripts in bin directory list volumes, show size or snapshots.
+# ./bin/ill t-
+Test ganeti commands after reading them:
-arh-hw:/usr/share/ganeti/extstorage/zfs# ./bin/list
-NAME USED AVAIL REFER MOUNTPOINT
-tmp500g/block 612M 87.2G 30K /tmp500g/block
-tmp500g/block/af1a90e8-0566-4cbf-bc8c-99fc82b67ce3.ext.disk0 612M 87.2G 610M -
+# ls t/gnt-*
+t/gnt-backup-export.sh t/gnt-instance-modify.sh
-arh-hw:/usr/share/ganeti/extstorage/zfs# ./bin/size
-NAME PROPERTY VALUE SOURCE
-tmp500g/block/af1a90e8-0566-4cbf-bc8c-99fc82b67ce3.ext.disk0 volsize 11G local
+DRBD disk replication
+Ganeti's extstorage provider doesn't support drbd target. But, lvm emulation
+scripts are sufficiant enough to create -t drbd instance or convert plain
+(created on zfs thanks to wrappers ;-) to drbd.
-arh-hw:/usr/share/ganeti/extstorage/zfs# ./bin/snapshots
-NAME USED AVAIL REFER MOUNTPOINT
-tmp500g/block@etckeeper 0 - 30K -
-tmp500g/block/af1a90e8-0566-4cbf-bc8c-99fc82b67ce3.ext.disk0@2014-06-24 2.64M - 610M -
-KNOWN BUGS
+KNOWN BUGS for extstorage
-- in current ganeti, gnt-backup export doesn't work because extstorage
- snapshoot hook is not available
+- gnt-backup export doesn't work because snapshoot hooks are not available
+- gnt-instance move works from somewhere to zfs, but not from zfs to somewhere