Skip to content

Maintenance & Operations

Exercises

  1. Drain a node for maintenance

Drain a compute node so that running jobs are allowed to complete but no new jobs are scheduled on it. Verify the node state, then return it to service when done.

Hint / Solution
# Drain the node — running jobs continue, no new jobs scheduled
scontrol update NodeName=cpu001 State=DRAIN Reason="scheduled maintenance"

# Verify the node state shows DRAINING (jobs still running) or DRAINED (idle)
scontrol show node cpu001 | grep -E '(State|Reason)'
sinfo -n cpu001 -N -l

# After maintenance is complete, return node to service
scontrol update NodeName=cpu001 State=RESUME

# Verify node is back to IDLE or ALLOCATED
scontrol show node cpu001 | grep State
Expected output: Validated 2026-04-15 on slurm-training-val (Slurm 25.11.4, ParallelCluster 3.15.0).
$ sudo /opt/slurm/bin/scontrol update NodeName=debug-dy-small-1 State=DRAIN Reason='val: maintenance test'

$ scontrol show node debug-dy-small-1 | grep -E '(State|Reason)'
   State=IDLE+CLOUD+DRAIN+POWERED_DOWN+NOT_RESPONDING ThreadsPerCore=1 TmpDisk=0 Weight=1000 Owner=N/A MCS_label=N/A
   Reason=val: maintenance test [root@2026-04-15T02:00:41]

$ sudo /opt/slurm/bin/scontrol update NodeName=debug-dy-small-1 State=RESUME

$ scontrol show node debug-dy-small-1 | grep State=
   State=IDLE+CLOUD+POWERED_DOWN+NOT_RESPONDING ThreadsPerCore=1 TmpDisk=0 Weight=1000 Owner=N/A MCS_label=N/A
  1. Check cluster health

Survey the cluster for nodes that are down, drained, or otherwise unavailable. Identify the reasons administrators set for unavailable nodes and determine how many total CPUs are offline.

Hint / Solution
# Show all nodes with a reason set (down, drained, or error states)
sinfo -R

# Show detailed node states — look for down*, drain*, error states
sinfo -N -l

# Count CPUs in each state
sinfo -o "%T %C" --noheader

# Get full details on a specific problem node
scontrol show node cpu001

# Quick summary: total nodes by state
sinfo -o "%T %D" --noheader | sort | uniq -c | sort -rn
Expected output: Validated 2026-04-15 on slurm-training-val (Slurm 25.11.4, ParallelCluster 3.15.0).
$ sinfo -R
REASON               USER      TIMESTAMP           NODELIST

$ sinfo -o '%T %D' --noheader | sort | uniq -c | sort -rn
      1 idle~ 5
      1 idle 3

$ sinfo -o '%T %C' --noheader | head -10
idle~ 0/28/0/28
idle 0/20/0/20

References