rebuild broken sencoday node drbd
authorDobrica Pavlinusic <dpavlin@rot13.org>
Sat, 27 Jan 2018 16:53:49 +0000 (17:53 +0100)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Sat, 27 Jan 2018 16:53:49 +0000 (17:53 +0100)
This is really ugly, and requires instance reboot, but it allows
you to resize your disk array and do single transfer. YMMV

gnt-drbd-secondary-rebuild.sh [new file with mode: 0755]

diff --git a/gnt-drbd-secondary-rebuild.sh b/gnt-drbd-secondary-rebuild.sh
new file mode 100755 (executable)
index 0000000..57c9fd9
--- /dev/null
@@ -0,0 +1,13 @@
+#!/bin/sh -xe
+
+test -z "$1" && echo "Usage: $0 node" && exit 1
+node=$1
+
+gnt-node list-drbd --no-headers $node | grep secondary | awk '{ print $3 }' | while read instance ; do
+       echo "## $instance";
+       gnt-instance stop $instance
+       gnt-instance modify -t plain $instance
+       gnt-instance modify -t drbd -n $node --no-wait-for-sync $instance
+       gnt-instance start $instance
+done
+