Skip to content

Remove Slurm Compute Nodes

Overview

Omnia removes Slurm compute nodes by comparing the compute nodes listed in the normal Slurm partition with the nodes generated from slurm_node_... functional groups in the current PXE mapping file.

When a compute node is omitted from the current mapping, Omnia:

  • Checks whether the node exists in Slurm.
  • Checks for active jobs.
  • Cancels jobs when force removal is selected.
  • Marks the node as DOWN.
  • Attempts to stop slurmd on the removed node.
  • Removes the node-specific Slurm configuration directory from shared storage.
  • Removes the node from the generated slurm.conf.
  • Updates managed /etc/hosts entries when applicable.
  • Runs scontrol reconfigure when the controller is available.

Warning

Automatic node-removal detection examines only the normal partition. Compute nodes that exist only in custom partitions are not detected by this workflow.

This procedure supports only slurm_node_... compute nodes. Removing Slurm controller nodes, login nodes, Kubernetes nodes, OS-only nodes, or custom nodes is not supported by this workflow.

At least one slurm_control_node_... entry must remain in the PXE mapping file.

Prerequisites

  • Complete Deploy Slurm.
  • Ensure the Slurm controller is running and reachable from the OIM over TCP port 22.
  • Keep at least one slurm_control_node_... entry in the PXE mapping file.
  • Confirm that the target nodes belong to the normal Slurm partition.
  • Identify the exact compute hostnames that must be removed.
  • Take a pre-change backup of the Slurm configuration.
  • Run this procedure interactively if any target node may have active jobs.

Before modifying the mapping file, check every target node for running jobs:

Run on: Slurm controller
squeue -w <compute-hostname>

Warning

Do not rely only on the automated busy-node check. If the squeue check fails during execution, the current implementation can report the failure and continue. Confirm the job state manually before running provisioning.

Procedure

Resolve the active project paths before changing the inventory:

Run on: OIM
source /etc/profile.d/omnia-env.sh
source "$OMNIA_DATA_PATH/activate-omnia.sh"
orchestrator_path="${OMNIA_DATA_PATH}/orchestrator"
orchestrator_input="$orchestrator_path/input/$OMNIA_PROJECT_NAME"
orchestrator_output="$orchestrator_path/output/$OMNIA_PROJECT_NAME"

1. Update the desired inventory

Open the Orchestrator configuration and check pxe_mapping_file_path:

Run on: OIM
vi "$orchestrator_input/orchestrator_config.yml"
  • If pxe_mapping_file_path is empty, update $orchestrator_input/pxe_mapping_file.csv.
  • If pxe_mapping_file_path is configured, update that exact file. Use an absolute path for this override.

For each compute node being removed from Slurm, choose one of these actions:

  • Delete the complete slurm_node_... row when decommissioning the server.
  • Change FUNCTIONAL_GROUP_NAME to a supported non-Slurm functional group when repurposing the server.

Preserve the CSV header and all remaining node rows. Do not remove or modify the Slurm controller row.

Warning

If the PXE mapping file was generated by the Discovery workflow, update its authoritative source before regenerating it. Discovery does not automatically overwrite the Orchestrator input, but copying a later generated mapping into the active location can reintroduce the removed node.

2. Validate and apply the change

For a quick input-only validation, run the optional validate tag:

Run on: OIM
cd <OMNIA_SOURCE_PATH>/src/main
./omnia.sh --run orchestrator --tags validate
Run on: OIM
source /opt/omnia/activate-omnia.sh
cd <OMNIA_SOURCE_PATH>/src/orchestrator/playbooks
ansible-playbook orchestrator.yml --tags validate

Run the Orchestrator precheck. The precheck includes input schema and logic validation, mapping validation, prerequisite checks, and boot-image validation:

Run on: OIM
cd <OMNIA_SOURCE_PATH>/src/main
./omnia.sh --run orchestrator --tags precheck
Run on: OIM
source /opt/omnia/activate-omnia.sh
cd <OMNIA_SOURCE_PATH>/src/orchestrator/playbooks
ansible-playbook orchestrator.yml --tags precheck

Apply the inventory change:

Run on: OIM
cd <OMNIA_SOURCE_PATH>/src/main
./omnia.sh --run orchestrator --tags provision
Run on: OIM
source /opt/omnia/activate-omnia.sh
cd <OMNIA_SOURCE_PATH>/src/orchestrator/playbooks
ansible-playbook orchestrator.yml --tags provision

Use the provision tag for node removal. Do not use execute, because execute also invokes the PXE boot workflow.

Note

When the generated Slurm configuration changes, Omnia creates a timestamped copy under:

<Slurm-shared-mount>/slurm_backups/auto_backup_orchestration_<timestamp>

This copy is created after the regenerated configuration is written. It does not replace the recommended pre-change backup.

3. Respond to active jobs

If omitted compute nodes have active jobs, Omnia prompts for one of the following actions:

  • Enter A to abort force removal. Omnia removes idle omitted nodes, retains busy nodes in the cluster, and then intentionally stops the playbook. This is the recommended option.
  • Enter F to force removal. Omnia cancels active jobs on the omitted nodes and removes those nodes from Slurm.

When a node remains selected for removal, Omnia performs the following actions regardless of whether it was initially idle or force-removed:

  1. Checks whether the node exists in Slurm.
  2. Runs scancel -f -w <compute-hostname>. This has no effect when the node has no jobs.
  3. Marks the node as DOWN.
  4. Attempts to stop slurmd on the node.
  5. Deletes the node-specific directory from the Slurm shared configuration path.
  6. Removes the node from the generated Slurm configuration.

Warning

Force removal terminates active jobs and may cause users to lose unsaved work.

If you choose A, wait for the jobs to finish or cancel them manually, and then rerun provisioning:

Run on: OIM
cd <OMNIA_SOURCE_PATH>/src/main
./omnia.sh --run orchestrator --tags provision
Run on: OIM
source /opt/omnia/activate-omnia.sh
cd <OMNIA_SOURCE_PATH>/src/orchestrator/playbooks
ansible-playbook orchestrator.yml --tags provision

4. Update telemetry when enabled

If iDRAC telemetry is enabled, rerun the Telemetry deployment after Slurm node removal:

Run on: OIM
cd <OMNIA_SOURCE_PATH>/src/main
./omnia.sh --run telemetry --tags deploy
Run on: OIM
source /opt/omnia/activate-omnia.sh
cd <OMNIA_SOURCE_PATH>/src/telemetry/playbooks
ansible-playbook telemetry.yml --tags deploy

The Telemetry workflow compares the regenerated bmc_group_data.csv with its database, disables telemetry on deleted iDRAC endpoints when possible, and removes their database entries.

Verification

Verify Slurm

Run the following commands on the Slurm controller:

Run on: Slurm controller
scontrol show node <removed-compute-hostname>
sinfo
squeue -w <removed-compute-hostname> -t all
srun -N 1 hostname

Expected results:

  • scontrol show node does not find the removed node.
  • sinfo lists only the retained compute nodes.
  • squeue does not show jobs assigned to the removed node.
  • The test job runs successfully on a remaining compute node.

Warning

Some controller connectivity and scontrol reconfigure failures are handled as non-fatal operations. Do not consider removal complete based only on the Ansible play recap. Always perform the Slurm verification commands above.

Verify Orchestrator output

Review the generated reports and inventory:

Run on: OIM
cat "$orchestrator_output/provisioning_report.yml"
cat "$orchestrator_output/orchestrator_status.yml"
grep -n "<removed-compute-hostname>" \
  "$orchestrator_output/orchestrator_inventory.yml"

The removed hostname must not appear in orchestrator_inventory.yml.

Review the Orchestrator log if any validation fails:

Run on: OIM
omnia-cli logs orchestrator

Next steps

  • Decommission or repurpose the hardware according to your site procedure after Slurm no longer reports it.
  • Use Add Nodes to add replacement compute nodes.
  • Keep the primary PXE mapping synchronized with the intended cluster inventory before future provisioning runs.

Troubleshooting

The playbook succeeds but the node remains in Slurm

The controller SSH check and scontrol reconfigure operation may be handled as non-fatal. Confirm controller connectivity and run:

Run on: Slurm controller
systemctl status slurmctld
scontrol reconfigure
scontrol show node <removed-compute-hostname>

The controller cannot be reached

The workflow checks TCP port 22 before drain and removal. Restore SSH connectivity from the OIM to the controller, and then rerun provisioning.

A custom-partition node is not detected

Automatic removal compares only the nodes in the normal partition with the current slurm_node_... mapping. Use a supported removal path or remove the node manually when it exists only in a custom partition.

A removed node returns after Discovery

Confirm that the authoritative Discovery inventory no longer contains the node. Regenerate or update the mapping source before running Orchestrator again, and do not copy a stale generated mapping into the active Orchestrator input.

Removal stops after selecting A

This is expected. Omnia removes idle omitted nodes, preserves busy nodes, and then stops the playbook. Wait for or cancel the remaining jobs, and then rerun:

Run on: OIM
cd <OMNIA_SOURCE_PATH>/src/main
./omnia.sh --run orchestrator --tags provision
Run on: OIM
source /opt/omnia/activate-omnia.sh
cd <OMNIA_SOURCE_PATH>/src/orchestrator/playbooks
ansible-playbook orchestrator.yml --tags provision