> For the complete documentation index, see [llms.txt](https://asus-isg-aidc.gitbook.io/guide/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://asus-isg-aidc.gitbook.io/guide/latest/cli/commandreference/slurm.md).

# Slurm Workload Manager

| Developer | Last modified |
| --------- | ------------- |
| AIDC Team | 2026/08/21    |

## Table of Contents

* [1. Overview](#overview)
* [2. Subcommands](#subcommands)
* [3. Deployment Workflow](#deployment-workflow)
* [4. Verifying the Cluster](#verifying-the-cluster)
* [5. Supported Operating Systems](#supported-operating-systems)
* [6. Usage Examples](#usage-examples)
* [7. Related Commands](#related-commands)

***

## 1. Overview <a href="#overview" id="overview"></a>

{% hint style="warning" %}
**⚠️ Prerequisite: `aidc-cli init` required first**

This command depends on settings saved by [`aidc-cli init`](/guide/latest/cli/commandreference/init.md). Before running it, make sure you have completed:

* [`aidc-cli init inventory`](/guide/latest/cli/commandreference/init.md#inventory) — render the node inventory from `aidc.csv`
* SSH access to the nodes — [`aidc-cli deploy install`](/guide/latest/cli/commandreference/deploy.md) sets this up during OS deployment; for nodes that already have an OS, run [`aidc-cli deploy access-key`](/guide/latest/cli/commandreference/deploy.md) or fill the `password` column in `aidc.csv`
* [`aidc-cli init slurm-set`](/guide/latest/cli/commandreference/init.md#service-configuration) — save the Slurm configuration

For the full setup sequence, see the [Getting Started](/guide/latest/cli/gettingstarted.md) guide.
{% endhint %}

The `slurm` command deploys and configures the Slurm workload manager for HPC cluster scheduling.

```bash
aidc-cli slurm <subcommand> [flags]
```

***

## 2. Subcommands <a href="#subcommands" id="subcommands"></a>

### 2.1 `setup-cluster` — Full Cluster Setup

Deploys a complete Slurm cluster including controller (slurmctld), database (slurmdbd), and compute nodes (slurmd).

```bash
aidc-cli slurm setup-cluster
```

This will:

1. Install Slurm packages on all cluster nodes
2. Configure the Slurm controller
3. Set up the Slurm database daemon (slurmdbd)
4. Register and start compute node daemons
5. Configure Munge authentication

{% hint style="info" %}
Configure Slurm parameters first with `aidc-cli init slurm-set` before running `setup-cluster`. Ensure that both the headnode group, compute group, and slurmDB group in the inventory have all been set. Inventory CSV files must be set up correctly.
{% endhint %}

***

### 2.2 `slurmd` — Add Compute Nodes

Adds additional compute nodes to an existing Slurm cluster.

```bash
aidc-cli slurm slurmd -c <node-list>
```

| Flag                 | Short | Required | Description                                        |
| -------------------- | :---: | :------: | -------------------------------------------------- |
| `--add_compute_node` |  `-c` |     ✅    | Comma-separated list of inventory hostnames to add |

**Example:**

```bash
aidc-cli slurm slurmd -c computenode1,computenode2
aidc-cli slurm slurmd -c computenode4,computenode6,computenode8
```

***

## 3. Deployment Workflow <a href="#deployment-workflow" id="deployment-workflow"></a>

```mermaid
flowchart TD
    A["Configure Slurm Parameters<br>init slurm-set"] --> B["Configure MariaDB<br>init mariadb-set"]
    B --> C["Deploy Full Cluster<br>slurm setup-cluster"]
    C --> D{Add More Nodes?}
    D -->|Yes| E["Add Compute Nodes<br>slurm slurmd -c nodes"]
    D -->|No| F["Cluster Ready"]
```

***

## 4. Verifying the Cluster <a href="#verifying-the-cluster" id="verifying-the-cluster"></a>

After deployment, verify the Slurm cluster from the controller node (slurmctld):

```bash
# Run hostname on a node
srun -N1 hostname

# Show node details
scontrol show node

# List nodes in long format
sinfo -Nl

# Partition summary
sinfo -s

# List registered clusters
sacctmgr list cluster
```

***

## 5. Supported Operating Systems <a href="#supported-operating-systems" id="supported-operating-systems"></a>

{% hint style="info" %}
See the **Supported Platforms Matrix** for the authoritative, up-to-date list of operating systems validated for this service.
{% endhint %}

***

## 6. Usage Examples <a href="#usage-examples" id="usage-examples"></a>

```bash
# Configure and deploy full Slurm cluster
aidc-cli init slurm-set
aidc-cli init mariadb-set
aidc-cli slurm setup-cluster

# Add new compute nodes to existing cluster
aidc-cli slurm slurmd -c node10,node11,node12
```

***

## Related Commands <a href="#related-commands" id="related-commands"></a>

| Command                 | Purpose                             |
| ----------------------- | ----------------------------------- |
| `init slurm-get/set`    | View/set Slurm configuration        |
| `init mariadb-get/set`  | View/set Slurm accounting DB config |
| `database maria-galera` | Deploy MariaDB Galera cluster       |
