1 Ganet extstorage provider for local zfs volumes
3 http://docs.ganeti.org/ganeti/master/html/man-ganeti-extstorage-interface.html
7 On node which has zfs storage pool
9 cd /usr/share/ganeti/extstorage/
10 git clone https://github.com/ffzg/ganeti-extstorage-zfs zfs
14 You need to specify zfs filesystem under which block devices will be created.
16 Now ssh into ganeti master node and do following:
18 1. enable new disk template
20 gnt-cluster modify --enabled-disk-templates plain,drbd,ext \
21 --ipolicy-disk-templates plain,drbd,ext
23 2. create log directory
25 mkdir /var/log/ganeti/extstorage
27 3. try instance creation with something similar to
29 gnt-instance add -t ext --disk=0:size=10G,provider=zfs \
30 --net 0:mode=bridged,link=br1001 \
31 --net 1:mode=bridged,link=br0060 \
32 --net 2:mode=bridged,link=br0080 \
33 --no-name-check --no-ip-check \
34 -o debootstrap+default \
35 -B maxmem=1G -n arh-hw zfs
37 4. install helper scripts for daily block snapshots
39 ln -sf /usr/share/ganeti/extstorage/zfs/bin/daily-block-snapshot /etc/cron.daily/
41 5. install lvm wrapper scripts to report zfs volumes as lv
43 find /usr/share/ganeti/extstorage/zfs/sbin/ -type f | xargs -i ln -v -s -f {} /sbin/
45 This scripts enable gnt-node commands to work:
47 root@vmh02:/home/dpavlin# gnt-node list arh-hw
48 Node DTotal DFree MTotal MNode MFree Pinst Sinst
49 arh-hw.gnt.ffzg.hr 87.8G 87.2G 7.8G 252M 5.6G 1 0
51 root@vmh02:/home/dpavlin# gnt-node list-storage arh-hw
52 Node Type Name Size Used Free Allocatable
53 arh-hw.gnt.ffzg.hr lvm-vg arh-hw 190.0G 62.7G 127.3G Y
54 arh-hw.gnt.ffzg.hr lvm-vg ffzgvg 87.8G 610M 87.2G Y
59 Helper scripts in bin directory list volumes, show size or snapshots.
62 arh-hw:/usr/share/ganeti/extstorage/zfs# ./bin/list
63 NAME USED AVAIL REFER MOUNTPOINT
64 tmp500g/block 612M 87.2G 30K /tmp500g/block
65 tmp500g/block/af1a90e8-0566-4cbf-bc8c-99fc82b67ce3.ext.disk0 612M 87.2G 610M -
68 arh-hw:/usr/share/ganeti/extstorage/zfs# ./bin/size
69 NAME PROPERTY VALUE SOURCE
70 tmp500g/block/af1a90e8-0566-4cbf-bc8c-99fc82b67ce3.ext.disk0 volsize 11G local
73 arh-hw:/usr/share/ganeti/extstorage/zfs# ./bin/snapshots
74 NAME USED AVAIL REFER MOUNTPOINT
75 tmp500g/block@etckeeper 0 - 30K -
76 tmp500g/block/af1a90e8-0566-4cbf-bc8c-99fc82b67ce3.ext.disk0@2014-06-24 2.64M - 610M -
80 - in current ganeti, gnt-backup export doesn't work because extstorage
81 snapshoot hook is not available
82 - gnt-instance move works from somewhere to zfs, but not from zfs to somewhere