Decommission a server from every system that knows about it

short · 45 min · Objective 3.6

Task

Decommission lin-dst, the migration lab's destination server, with a checklist: confirm nothing uses it, then remove it from DNS, DHCP, the load balancer and monitoring, disable its accounts, and mark it retired in the asset register -- proving each removal rather than ticking it off. Finally, look for anything that still refers to it.

Steps

  1. Check for recent use: save ss -tn and the last day of its logs' connection entries to lab/decom/activity.txt. Shut it down and leave it off while you work.
  2. Write lab/decom/checklist.csv with header item,action,evidence,done, where done is yes or no, covering at least DNS forward, DNS reverse, DHCP reservation, load balancer or share references, monitoring, backups, accounts, firewall rules, licences and the asset register.
  3. Remove its A and PTR records on win-srv and save dig and dig -x for it to lab/decom/dns.txt.
  4. Remove any DHCP reservation and save the reservation list to lab/decom/dhcp.txt. Update the asset register row to retired.
  5. Search every lab configuration and document you have for its name and address with grep -rl, and save the result to lab/decom/leftovers.txt. Fix or record each hit.

Verify

These checks run in a POSIX shell: Terminal on macOS or Linux, and on Windows Git Bash (it comes with Git for Windows) or WSL. A stock Windows PowerShell or Command Prompt has no awk or grep, so there the first line fails.

awk -F, 'NR>1 {n++; if ($4!="yes") o++} END {print n" item(s), "o+0" not done"}' lab/decom/checklist.csv
grep -Eic 'NXDOMAIN' lab/decom/dns.txt
grep -c 'lin-dst' lab/decom/dhcp.txt
grep -c 'retired' lab/assets/register.csv
grep -c . lab/decom/leftovers.txt

At least ten checklist items, all done; DNS answers NXDOMAIN forward and reverse; no DHCP reservation names it; the register shows it retired. The leftovers search almost always finds something -- a runbook, a firewall rule, a monitoring target -- which is the reason for doing it: each hit is a place the server would otherwise have lingered.

Notes

Its disks come last: a virtual machine's disk files are deleted, and a physical server's drives are sanitised as in the media lab, with the certificate added to the retirement record.

This is an independent study companion for CompTIA Server+ SK0-005 and is not produced by or endorsed by CompTIA.