find instances running with closed lvs which require gnt-instance replace-disks
authorDobrica Pavlinusic <dpavlin@rot13.org>
Sun, 1 Oct 2017 07:03:17 +0000 (09:03 +0200)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Sun, 1 Oct 2017 07:03:17 +0000 (09:03 +0200)
gnt-find-replace-disks.sh [new file with mode: 0755]

diff --git a/gnt-find-replace-disks.sh b/gnt-find-replace-disks.sh
new file mode 100755 (executable)
index 0000000..fcfff11
--- /dev/null
@@ -0,0 +1,6 @@
+#!/bin/sh -e
+
+# find instances which are running but have some lvs closed which require gnt-instance replace-disks
+
+gnt-cluster command -M lvs -o attr,tags,name | grep originstname | grep -v 'ao' | awk '{ print $1 " " $3  }' | cut -d+ -f2 | sort -u | xargs -i gnt-instance list --no-headers -o name,status {} | grep ' running$'
+