begin work on gnt-instance move
[ganeti-extstorage-zfs] / sbin / pvs
diff --git a/sbin/pvs b/sbin/pvs
new file mode 100755 (executable)
index 0000000..3571ea3
--- /dev/null
+++ b/sbin/pvs
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+. /usr/share/ganeti/extstorage/zfs/defaults.sh
+
+/sbin/lvm pvs $*
+
+# pvs --noheadings --nosuffix --units=m --unbuffered '--separator=|' -opv_name,vg_name,pv_free,pv_attr,pv_size,pv_name
+
+if echo $* | grep -q pv_name,vg_name,pv_free,pv_attr,pv_size,pv_name ; then
+
+       zfs list $EXTP_ZFS -H -p -o avail,used | sed "s:$EXTP_ZFS::" | awk '{ print "  '$EXTP_ZFS'|'$EXTP_VG'|" $1 / 1024 / 1024 "|a--|" ( $1 + $2 ) / 1024 / 1024 "|'$EXTP_ZFS'" }'
+
+fi
+