document removal of luns
authorPeter Palfrader <peter@palfrader.org>
Tue, 11 Nov 2014 20:12:55 +0000 (21:12 +0100)
committerPeter Palfrader <peter@palfrader.org>
Tue, 11 Nov 2014 20:12:55 +0000 (21:12 +0100)
input/howto/install-ganeti.creole

index ddab5df..e5da4d9 100644 (file)
@@ -412,3 +412,58 @@ echo "$WWN" | sed -re 's#(.{6})(.{6})0000(.{2})(.*)#36\1000\2\3\4#'
 
   This will update the multipath config on all cluster nodes. WITHOUT doing this, you can't migrate VMs between nodes.
 }}}
+
+** Remove LUNs.
+
+Order is important, or else things get very, very confused and the world needs a reboot.
+
+*** Make sure nothing uses the volume anymore.
+
+*** Make sure we do not have any partitions lying around for it:
+{{{
+  gnt-cluster command "ls -l /dev/mapper/backuphost*"
+  # and maybe:
+  gnt-cluster command "kpartx -v -p -part -d /dev/mapper/backuphost"
+}}}
+
+*** flush the device, remove the multipath mapping, flush all backing devices:
+{{{
+  root@bm-bl1:~# cat flush-mp-device 
+  #!/bin/sh
+
+  dev="$1"
+
+  if [ -z "$dev" ] || ! [ -e "$dev" ]; then
+    echo 2>&1 "Device $dev does not exist."
+    exit 1
+  fi
+
+  devs=$(multipath -ll "$dev" | grep cciss | sed -e 's/.*cciss!//; s/ .*//;')
+
+  if [ -z "$devs" ]; then
+    echo 2>&1 "No backends found for $dev."
+    exit 1
+  fi
+
+  set -e
+
+  blockdev --flushbufs "$dev"
+  multipath -f "$dev"
+  for d in $devs; do
+    blockdev --flushbufs "/dev/cciss/$d"
+  done
+  echo done.
+}}}
+{{{
+  gnt-cluster command "/root/flush-mp-device /dev/mapper/backuphost"
+}}}
+
+*** Immediately afterwards, paste the output of the following to the MSA console.  Best prepare this before, so you do it quickly before anything else rescans stuff, reloads or restarts multipathd, and the devices become used again.
+{{{
+  for bl in 1 2 3 4 5 6 ; do for p in 1 2 3 4; do echo "unmap volume DECOMMISSION-backuph host bm-bl$bl-p$p" ; done ; done
+}}}
+
+*** Lastly, rescan the scsi bus on all hosts.  Do not forget that.  hpacucli and the monitoring tools might lock up the machine if they try to check the status of a device that now no longer exists but that the system still thinkgs is around.
+{{{
+  gnt-cluster command "echo 1 > /sys/bus/pci/devices/0000:0e:00.0/cciss0/rescan"
+}}}