From: Dobrica Pavlinusic Date: Fri, 27 Jul 2018 22:11:54 +0000 (+0200) Subject: list all istance rbd disks and snapshots X-Git-Url: http://git.rot13.org/?a=commitdiff_plain;ds=sidebyside;h=64b52a0af04a069a99ed445778ce45ca1b18661d;p=gnt-info list all istance rbd disks and snapshots --- diff --git a/gnt-rbd.sh b/gnt-rbd.sh new file mode 100755 index 0000000..ff96693 --- /dev/null +++ b/gnt-rbd.sh @@ -0,0 +1,16 @@ +#!/bin/sh -e + +dir=/dev/shm/instance +test -e $dir || mkdir $dir + +gnt-instance list -o name,disk_template | grep ' rbd$' | cut -d' ' -f1 | while read instance ; do + if [ ! -e $dir/$instance ] ; then + gnt-instance info $instance | tee > $dir/$instance + fi +done + +grep --with-filename logical_id /dev/shm/instance/* | sed "s/^.*\///; s/:.*, '/ /; s/'.*$//;" | tee /dev/shm/instance-rbd | while read instance disk ; do + echo "$instance $disk" + rbd snap ls $disk | sed "s/^/# /" +done +