-# (something like
-# for lv in $(LVs for running VMs on this host); do
-# #some lvchange -a commands
-# pvmove -n $lv <oldpv> <newpv>
-# #possibly more lvchange -a to restore old state
-# done)
+
+yamlkeys () {
+ python -c 'if 1:
+ import yaml, sys
+ mm = yaml.load(sys.stdin.read())
+ for m in sorted(mm.iterkeys()): print m'
+}
+
+lvsleft () {
+ lvs -o name,devices xenvg \
+ | perl -lane "print \$F[0] if (\$F[1] =~ m|$DISK|)"
+}
+
+vmstolvs () {
+ perl -pe 's/^/d_/;s/$/_hda/'
+}
+
+totalsize () {
+ # handy for estimating time; output in GiB; pipe in a list of LVs
+ perl -pe 's.^.xenvg/.' \
+ | xargs lvs -o size --units=g \
+ | perl -lne '$total += $_; END { print $total; }'
+}