find instances with slaves stuck in WFConnection
[gnt-info] / gnt-drbd-secondary-rebuild.sh
1 #!/bin/sh -xe
2
3 test -z "$1" && echo "Usage: $0 node" && exit 1
4 node=$1
5
6 gnt-node list-drbd --no-headers $node | grep secondary | awk '{ print $3 }' | sort -u | while read instance ; do
7         echo "## $instance";
8         gnt-instance stop $instance
9         gnt-instance modify -t plain $instance
10         gnt-instance modify -t drbd -n $node --no-wait-for-sync $instance
11         gnt-instance start $instance
12 done
13