Slurm Configuration Utilities¶
Overview¶
Use the Utils domain to back up, remove, and restore the active Slurm configuration stored on the configured Slurm NFS share. You can also remove stored Slurm configuration backups when they are no longer required.
Run one operation tag at a time:
| Operation | Tag |
|---|---|
| Back up the active Slurm configuration | slurm_config_backup |
| Delete the active Slurm configuration | slurm_config_cleanup |
| Restore a stored configuration | slurm_config_rollback |
| Delete all stored configuration backups | cleanup_slurm_config_backups |
Prerequisites¶
- Complete the OIM setup.
- Deploy and verify a working Slurm cluster.
- Initialize the Utils domain after updating the source:
./omnia.sh -i utils
- Confirm that the Utils project input directory contains valid
omnia_config.ymlandstorage_config.ymlfiles. The firstslurm_clusterentry must reference an NFS storage name that exists in themountslist instorage_config.yml. - Confirm that the Slurm NFS
mount_pointis mounted and writable on the OIM. - Provide a PXE mapping containing a
slurm_control_node_*functional group. The default mapping is$OMNIA_DATA_PATH/utils/input/$OMNIA_PROJECT_NAME/nodes_slurm.yaml. A CSVpxe_mapping_file.csvcan be selected through the optional configuration. - For rollback, confirm passwordless root SSH access from the OIM to the first
Slurm controller in the mapping. The controller must have
slurmctld,slurmdbd, andscontrolavailable as applicable. - Schedule cleanup and rollback during an approved maintenance window.
Configure the utility¶
The optional project configuration is:
$OMNIA_DATA_PATH/utils/input/$OMNIA_PROJECT_NAME/slurm_config_util_config.yml
Defaults are used when the file is absent or its path overrides are empty. See Slurm Config Utility Configuration for all parameters.
Source the input files¶
The Slurm configuration workflows expect their default inputs in:
$OMNIA_DATA_PATH/utils/input/$OMNIA_PROJECT_NAME/
├── omnia_config.yml
├── storage_config.yml
└── nodes_slurm.yaml
These files are normally generated in other Omnia domains. Copy the applicable files into the Utils input directory:
| Required input | Source location |
|---|---|
omnia_config.yml |
$OMNIA_DATA_PATH/orchestrator/input/$OMNIA_PROJECT_NAME/omnia_config.yml |
storage_config.yml |
$OMNIA_DATA_PATH/orchestrator/input/$OMNIA_PROJECT_NAME/storage_config.yml |
nodes_slurm.yaml |
$OMNIA_DATA_PATH/openchami/workdir/nodes/nodes_slurm.yaml |
As an alternative to nodes_slurm.yaml, copy the Orchestrator-generated
$OMNIA_DATA_PATH/orchestrator/input/$OMNIA_PROJECT_NAME/pxe_mapping_file.csv
into the Utils input directory and set pxe_mapping_path to the copied file.
The mapping format is detected from its extension: .csv selects CSV, and
every other extension selects YAML.
Note
Copy these inputs rather than creating symbolic links. To keep them in
their source locations, override omnia_config_path, storage_config_path,
and pxe_mapping_path in slurm_config_util_config.yml or with
command-line extra variables.
The backup destination is selected in this order:
slurm_backup_pathsupplied as a command-line extra variable.slurm_backup_pathinslurm_config_util_config.yml.OMNIA_BACKUP_PATH.$OMNIA_DATA_PATH/utils/output/$OMNIA_PROJECT_NAME/slurm_config_util.
The destination can be an absolute local path or a raw NFS export in
server:/export/path format.
Back up the Slurm configuration¶
Run:
cd <OMNIA_SOURCE_PATH>/src/main
./omnia.sh --run utils --tags slurm_config_backup
source /opt/omnia/activate-omnia.sh
cd <OMNIA_SOURCE_PATH>/src/utils/playbooks
export ANSIBLE_CONFIG=../ansible.cfg
ansible-playbook utils.yml --tags slurm_config_backup
To select a destination or backup prefix for one run:
cd <OMNIA_SOURCE_PATH>/src/main
./omnia.sh --run utils --tags slurm_config_backup \
-e slurm_backup_path="192.0.2.20:/exports/omnia/slurm" \
-e backup_base_name="before_maintenance"
source /opt/omnia/activate-omnia.sh
cd <OMNIA_SOURCE_PATH>/src/utils/playbooks
export ANSIBLE_CONFIG=../ansible.cfg
ansible-playbook utils.yml --tags slurm_config_backup \
-e slurm_backup_path="192.0.2.20:/exports/omnia/slurm" \
-e backup_base_name="before_maintenance"
The utility identifies the first Slurm controller in the PXE mapping and copies these directories from the active Slurm configuration:
etc/slurmetc/mungeetc/my.cnf.d
The default output layout is:
$OMNIA_DATA_PATH/utils/output/$OMNIA_PROJECT_NAME/slurm_config_util/
└── slurm_config_<YYYYMMDD-HHMMSS>/
├── <controller-hostname>/
│ ├── etc/slurm/
│ ├── etc/munge/
│ └── etc/my.cnf.d/
└── metadata.json
metadata.json records the backup ID, generation time, controller, source and
destination, included directories, and SHA-256 checksums of copied files.
Important
The current backup task continues when an individual copy or checksum
command fails. Verify the expected directories, slurm.conf, munge.key,
and checksum entries before treating the backup as recoverable.
Delete the active Slurm configuration¶
Run:
cd <OMNIA_SOURCE_PATH>/src/main
./omnia.sh --run utils --tags slurm_config_cleanup
source /opt/omnia/activate-omnia.sh
cd <OMNIA_SOURCE_PATH>/src/utils/playbooks
export ANSIBLE_CONFIG=../ansible.cfg
ansible-playbook utils.yml --tags slurm_config_cleanup
The workflow asks whether to create a backup first. It then requires the exact
configured confirmation token, YES by default.
Danger
slurm_config_cleanup recursively deletes the complete active Slurm
configuration directory resolved from the configured NFS mount point and
slurm_share_dir_name. This affects all controller directories below that
path and cannot be undone without a verified backup.
Restore a Slurm configuration¶
Run:
cd <OMNIA_SOURCE_PATH>/src/main
./omnia.sh --run utils --tags slurm_config_rollback
source /opt/omnia/activate-omnia.sh
cd <OMNIA_SOURCE_PATH>/src/utils/playbooks
export ANSIBLE_CONFIG=../ansible.cfg
ansible-playbook utils.yml --tags slurm_config_rollback
After the command starts:
- Review the displayed backups and enter the number of the backup to restore.
- Review any missing-file warnings. A backup without
slurm.confcannot be restored. Continue past other missing-file warnings only after confirming that the missing content is not required. - When prompted, choose whether to create a safety backup of the current configuration before continuing.
- Wait for the restore and controller reconfiguration to complete.
- Run the commands in Verification before resuming workload operations.
During the restore, the utility restores etc/slurm, etc/munge, and
etc/my.cnf.d, attempts to remount stale controller mounts, repairs required
file permissions, conditionally restarts slurmdbd, and runs
scontrol reconfigure.
Warning
If the workflow reports that the on-disk restore completed but controller reconfiguration failed, correct the controller service or configuration issue before attempting another rollback.
Delete stored Slurm configuration backups¶
To remove every backup-run directory from the resolved backup destination, run:
cd <OMNIA_SOURCE_PATH>/src/main
./omnia.sh --run utils --tags cleanup_slurm_config_backups
source /opt/omnia/activate-omnia.sh
cd <OMNIA_SOURCE_PATH>/src/utils/playbooks
export ANSIBLE_CONFIG=../ansible.cfg
ansible-playbook utils.yml --tags cleanup_slurm_config_backups
For a custom destination, use the same slurm_backup_path used to create the
backups.
Danger
cleanup_slurm_config_backups has no retention period and does not request
confirmation. It removes every run directory immediately below the
resolved backup destination. Copy required backups elsewhere first.
The general Utils cleanup tag also includes this operation.
Verification¶
Review the latest Utils status and the backup content:
cat "$OMNIA_DATA_PATH/utils/output/$OMNIA_PROJECT_NAME/utils_status.yml"
find "$OMNIA_DATA_PATH/utils/output/$OMNIA_PROJECT_NAME/slurm_config_util" \
-maxdepth 4 -type f
After rollback, verify the controller and node state:
systemctl status munge slurmdbd slurmctld --no-pager
scontrol ping
sinfo
scontrol show nodes
Next steps¶
- Clean up Utils when stored utility artifacts are no longer required.
- Verify the cluster before resuming workload operations after a rollback.
- Configure Slurm when the desired configuration must be changed rather than restored.
Troubleshooting¶
- An input file is not found: Confirm the active project and the paths in
slurm_config_util_config.yml. Confirm that the required files were copied into the Utils project input directory, or configure explicit source paths. Run./omnia.sh -i utilsto stage the latest optional Utils configuration. - No Slurm controller is found: Confirm that the YAML or CSV mapping
contains a functional group beginning with
slurm_control_node_. - The backup NFS destination cannot be mounted: Confirm DNS or IP
reachability, export permissions, NFS client packages, and
server:/export/pathsyntax. - No backups are listed: Supply the same
slurm_backup_pathused for the backup and confirm that run directories exist immediately below it. - Rollback reports missing content: Do not continue unless the missing
files are understood. A selected backup without
slurm.confcannot be used. - Rollback cannot recover a stale mount: On the Slurm controller, run the applicable command for each path reported as stale:
umount -l /etc/slurm && mount /etc/slurm
umount -l /etc/munge && mount /etc/munge
umount -l /etc/my.cnf.d && mount /etc/my.cnf.d
Then rerun rollback:
=== "Using omnia.sh (recommended)"
```bash title="Run on: OIM host"
cd <OMNIA_SOURCE_PATH>/src/main
./omnia.sh --run utils --tags slurm_config_rollback
```
=== "Using ansible-playbook"
```bash title="Run on: OIM host"
source /opt/omnia/activate-omnia.sh
cd <OMNIA_SOURCE_PATH>/src/utils/playbooks
export ANSIBLE_CONFIG=../ansible.cfg
ansible-playbook utils.yml --tags slurm_config_rollback
```
scontrol reconfigurefails: Reviewjournalctl -u slurmctld -n 50, verify Munge and Slurm services, correct configuration errors, and runscontrol reconfigureagain.
See Utils Issues for additional resolutions.