ganeti-reboot-cluster: wait for drbd to have caught up
authorPeter Palfrader <peter@palfrader.org>
Tue, 21 Aug 2018 20:46:34 +0000 (22:46 +0200)
committerPeter Palfrader <peter@palfrader.org>
Tue, 21 Aug 2018 20:46:34 +0000 (22:46 +0200)
modules/ganeti2/files/ganeti-reboot-cluster

index 28f945b..383eb7a 100755 (executable)
@@ -211,6 +211,15 @@ crossmigrate() {
     fi
   done
 
+  if [ -e /proc/drbd ]; then
+    echo "Waiting for drbd to be consistent."
+    sleep 5
+    while egrep -C2 --color -i 'iconsistent|finish' /proc/drbd; do
+      echo "Still waiting.."
+      sleep 5
+    done
+  fi
+
   echo "Migrating from $me to $them."
   if ! gnt-node migrate -f -n "$them" "$me"; then
     echo >&2 "gnt-node migrate exited with an error.  Bailing out."