Use stable instead of squeeze in a couple of places
[mirror/dsa-wiki.git] / input / howto / install-ganeti.creole
index bd7d85c..3af7113 100644 (file)
@@ -4,7 +4,7 @@
 
 Suppose that there are two identical hosts: foo.debian.org and bar.debian.org.
 
-They are running squeeze and have been integrated into Debian infrastructure.
+They are running stable and have been integrated into Debian infrastructure.
 
 They will serve as nodes in a ganeti cluster named foobar.debian.org.
 
@@ -36,7 +36,7 @@ The following DNS records exist:
 On each node, install the required packages:
 
 {{{
-    # maybe: apt-get install drbd8-utils
+    # maybe: apt-get install drbd-utils
     # maybe: apt-get install ganeti-instance-debootstrap
     apt-get install ganeti2 ganeti-htools qemu-kvm
 }}}
@@ -183,6 +183,13 @@ on the master node (foo):
       bar.debian.org
 }}}
 
+more stuff:
+
+{{{
+  gnt-cluster modify --reserved-lvs='vg0/local-swap.*'
+  maybe: gnt-cluster modify --nic-parameters mode=openvswitch
+}}}
+
 Note the following:
 
 * the secondary IP address is set to the value of the slave node's interface on the private network
@@ -197,9 +204,9 @@ On the master node (foo):
 
 If everything has been configured correctly, no errors should be reported.
 
-=== create the 'dsa' variant ===
+=== create the 'noop' variant ===
 
-Ensure that the debootstrap+dsa variant has been installed by puppet (see ganeti2 module in dsa-puppet).
+Ensure that the ganeti-os-noop is installed.
 
 ----
 
@@ -360,8 +367,37 @@ And you want to convert it to use DRBD afterwards and start it on the other clus
 
 * How to add new LUNs to Bytemark Cluster
 
+** Add new LUN to MSA and export to all blades
+
+{{{
+  Log into MSA controller
+
+  Choose which vdisk to use, use "show vdisks" to list
+
+Add the volume:
+  # create volume vdisk msa2k-2-500gr10 size 5G donizetti
+
+Find a free LUN:
+
+  # show lun-maps
+  or (if we assume they are all the same)
+  # show host-maps 3001438001287090
+
+Make a note of the next free LUN
+
+Generate map commands for all blades, all ports, run locally:
+
+  $ for bl in 1 2 3 4 5 6 ; do for p in 1 2 3 4; do echo "map volume donizetti lun 27 host bm-bl$bl-p$p" ; done ; done
+
+Paste the output into the MSA shell
+
+Find the WWN by doing show host-maps and looking for the volume name.
+Transform it using the sed run at the top of /etc/multipath.conf:
+
+echo "$WWN" | sed -re 's#(.{6})(.{6})0000(.{2})(.*)#36\1000\2\3\4#'
+}}}
+
 {{{
-  + Add a new LUN in the MSA and export it to all blades
 
   then:
   gnt-cluster command "echo 1 > /sys/bus/pci/devices/0000:0e:00.0/cciss0/rescan"
@@ -369,10 +405,65 @@ And you want to convert it to use DRBD afterwards and start it on the other clus
   then:
   reload multipath-tools on gnt-master (normaly bm-bl1):
   service multipath-tools reload
-  add the WWNs to dsa-puppet/modules/multipath/files/bm-multipath.conf and define the alias and commit that file to git.
+  add the WWNs to dsa-puppet/modules/multipath/files/multipath-bm.conf and define the alias and commit that file to git.
 
   then:
   gnt-cluster command "puppet agent -t"
 
   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"
+}}}