68ed36dc549f10e54af1cdac2662ab1aecc8827a
[mirror/dsa-wiki.git] / input / howto / decomission.mdwn
1 # Decomissioning hosts
2
3  * Get rid of any services running on the host.
4  * Optional, shut down the machine, then wait a month
5  * Zero disks
6
7     badblocks -v -s -p 5 -w -f DEVICE_GOES_HERE
8
9  * Revoke puppet certificate
10
11    * on handel: puppet node clean $HOST.debian.org
12    * on handel: puppet node deactivate $HOST.debian.org
13    * reinit samhain on handel
14
15  * Remove from LDAP
16    * including references such as subgroup: foo@hostname or supplementarygid: foo@hostname
17    * rerun puppet on backuphost / the backup host
18    * reinit samhain on backuphost
19  * Remove from Nagios
20  * Remove any references from puppet configuration
21  * Remove references to the host from DNS files, including reverse DNS
22  * Get rid of the HW (tell the hoster to get rid of it or other as appropriate)
23  * Update password file information for the $HOST
24  * Remove MQ queues related to machine (see [[doc/mq]] for details)
25
26     for queue in $(rabbitmqadmin -N rainier list queues name | \
27     grep unger.debian.org | \
28     awk '{print $2}') ; do
29     rabbitmqadmin -N rainier -V dsa delete queue name=$queue
30     done
31
32  * Remove disks from the MSA 
33    * run multipath -ll on the KVM host and find all disks on that multipath
34
35 ```
36 echo -n "multipath device to remove: " &&
37 export LC_ALL=C &&
38 read path &&
39 dm=$(sudo multipath -ll | grep "$path" | awk '{print $2}') &&
40 cd /sys/devices/virtual/block/$dm/slaves &&
41 devices=$(ls -1) &&
42 blockdev --flushbufs /dev/$dm &&
43 multipath -f $path &&
44 for device in $(echo $devices); do blockdev --flushbufs /dev/$device; echo 1 > "/sys/block/$device/device/delete"; done
45 ```
46
47    * remove the paths in the MSA
48
49 Three months after decomissioning:
50  * Remove backups