script remove of devices a bit more
[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
12    * reinit samhain on handel
13
14  * Remove from LDAP
15    * including references such as subgroup: foo@hostname or supplementarygid: foo@hostname
16    * rerun puppet on backuphost / the backup host
17    * reinit samhain on backuphost
18  * Remove from Nagios
19  * Remove any references from puppet configuration
20  * Remove references to the host from DNS files, including reverse DNS
21  * Get rid of the HW (tell the hoster to get rid of it or other as appropriate)
22  * Update password file information for the $HOST
23  * Remove MQ queues related to machine (see [[doc/mq]] for details)
24
25     for queue in $(rabbitmqadmin -N rainier list queues name | \
26     grep unger.debian.org | \
27     awk '{print $2}') ; do
28     rabbitmqadmin -N rainier -V dsa delete queue name=$queue
29     done
30
31  * Remove disks from the MSA 
32    * run multipath -ll on the KVM host and find all disks on that multipath
33
34 ```
35     dm=$(sudo multipath -ll | grep "finzi-srv " | awk '{print $3}')
36     cd /sys/devices/virtual/block/$dm &&
37     for device in $(ls -1); do "echo 1 > /sys/block/$device/device/delete"; done
38     multipath -f finzi-srv
39
40 ```
41    * for each disk in those multipath run
42
43      echo 1 > /sys/block/sdX/device/delete
44
45    * once done, remove that multpath-device from multipath
46
47      multipath -f finzi-srv
48
49    * remove the paths in the MSA
50
51 Three months after decomissioning:
52  * Remove backups