> 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/v1.4.0/cli/commandreference/init.md).

# Initialization

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

## Table of Contents

* [1. Overview](#overview)
* [2. Inventory](#inventory)
* [3. Common Configuration](#common-configuration)
* [4. Group Configuration](#group-configuration)
* [5. BMC Configuration](#bmc-configuration)
* [6. System Configuration](#system-configuration)
* [7. Package Configuration](#package-configuration)
* [8. DHCP Configuration](#dhcp-configuration)
* [9. Network Configuration](#network-configuration)
* [10. Deploy Image Management](#deploy-image-management)
* [11. Disk Configuration](#disk-configuration)
* [12. Service Configuration](#service-configuration)
* [13. Management Service Configuration](#management-service-configuration)
* [14. NVMe Firmware Update Configuration](#14-nvme-firmware-update-configuration)

***

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

The `init` command is the largest and most critical module in AIDC-CLI. It manages all pre-deployment configuration — from node inventory rendering to DHCP setup, BMC credentials, network parameters, service configurations (Slurm, K8s, Container, MariaDB), disk management (SW RAID, LVM), deploy image management, NVMe firmware update defaults, and more.

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

**Available Subcommands:**

| Category        | Subcommands                                                                              |
| --------------- | ---------------------------------------------------------------------------------------- |
| General         | `inventory`, `common-get`, `common-set`, `clear-report`                                  |
| Group           | `group-get`, `group-set`                                                                 |
| BMC             | `bmc-get`, `bmc-set`                                                                     |
| System          | `syscfg-get`, `syscfg-set`, `syscfg-ntp-set`                                             |
| Package         | `pkg-get`, `pkg-set`                                                                     |
| DHCP            | `dhcp-get`, `dhcp-set`, `dhcp-validate`                                                  |
| Network         | `eth-get/set`, `bond-get/set`, `ib-get/set`, `nvos-get/set`, `link-type-get/set`         |
| Deploy Image    | `image-discovery`, `image-list`, `image-active`, `image-downloadable`, `image-download`  |
| Disk            | `swraid-get/set`, `lvm-get/set`                                                          |
| Service         | `slurm-get/set`, `mariadb-get/set`, `container-get/set`, `harbor-get/set`, `k8s-get/set` |
| Management      | `ufm-get/set`, `nmx-get/set/reset`                                                       |
| Firmware Update | `nvme-get`, `nvme-set`                                                                   |

***

## 2. Inventory <a href="#inventory" id="inventory"></a>

### 2.1 `inventory` — Render Node Inventory

Converts CSV database files into AIDC node inventory format. Performs validation checks for duplicate IPs and license device limits.

```bash
aidc-cli init inventory
```

**CSV File Format:**

The node inventory CSV (`data/node_info/aidc.csv`) uses the following columns:

```
index, node_group, serial_number, hostname, model, password,
bmc_ip, bmc_mac, eth0_ip, eth0_mac, eth1_ip, eth2_ip, eth3_ip,
bond0_ip, bond1_ip, bond2_ip, bond3_ip,
ib0_ip, ib1_ip, ib2_ip, ib3_ip, ib4_ip, ib5_ip, ib6_ip, ib7_ip,
leaf, spine
```

**Hostname Naming Rules:**

The following characters are **prohibited** in hostnames:

| Character   | Symbol |
| ----------- | :----: |
| Underscore  |   `_`  |
| At sign     |   `@`  |
| Hash        |   `#`  |
| Dollar sign |   `$`  |
| Percent     |   `%`  |
| Caret       |   `^`  |
| Ampersand   |   `&`  |
| Asterisk    |   `*`  |
| Period      |   `.`  |
| Space       |        |

**Group Name Naming Rules:**

The following characters are **prohibited** in group names:

| Character   | Symbol |
| ----------- | :----: |
| Hyphen      |   `-`  |
| At sign     |   `@`  |
| Hash        |   `#`  |
| Dollar sign |   `$`  |
| Percent     |   `%`  |
| Caret       |   `^`  |
| Ampersand   |   `&`  |
| Asterisk    |   `*`  |
| Period      |   `.`  |
| Space       |        |

**Validation Flow:**

1. Checks for duplicate IPs across all CSV files (`bmc_ip`, `eth0_ip` columns)
2. Verifies node count against the active license `DeviceLimit`
3. Renders CSV data into node inventory configuration
4. Displays DHCP validation warnings if any node IPs fall outside the configured DHCP subnet

{% hint style="info" %}
Always run `init inventory` after modifying CSV files in the node database directory.
{% endhint %}

{% hint style="warning" %}
If duplicate IPs or license limit violations are detected, the command will abort with a detailed error report. Fix the CSV files before retrying.
{% endhint %}

***

## 3. Common Configuration <a href="#common-configuration" id="common-configuration"></a>

### 3.1 `common-get` — View Common Settings

Displays the current common configuration settings.

```bash
aidc-cli init common-get
```

### 3.2 `common-set` — Set Common Settings

```bash
aidc-cli init common-set [flags]
```

| Flag            | Short | Required | Description            |
| --------------- | :---: | :------: | ---------------------- |
| `--report-path` |  `-r` |     ✅    | Set report output path |

{% hint style="info" %}
At least one flag must be provided.
{% endhint %}

### 3.3 `clear-report` — Clear Task Reports

Clears generated task report files from the report directory. This will remove the report files under `/report/XXX/`.

```bash
aidc-cli init clear-report [flags]
```

| Flag          | Short | Required | Description                           |
| ------------- | :---: | :------: | ------------------------------------- |
| `--task-type` |  `-t` |     ❌    | Specify the task type: `cli` or `gui` |
| `--task-id`   |  `-d` |     ❌    | Specify a specific task ID to clear   |

{% hint style="warning" %}
You must specify either `--task-type` or `--task-id`. If both are provided, `--task-id` takes priority and `--task-type` is ignored.
{% endhint %}

**Examples:**

```bash
# Clear all CLI task reports
aidc-cli init clear-report -t cli

# Clear all GUI task reports
aidc-cli init clear-report -t gui

# Clear a specific task by ID
aidc-cli init clear-report -d "task-20240101-001"
```

***

## 4. Group Configuration <a href="#group-configuration" id="group-configuration"></a>

### 4.1 `group-get` — View Node Groups

Displays the current node group list and their IDs.

```bash
aidc-cli init group-get
```

{% hint style="info" %}
The displayed groups are the default groups. You can assign nodes to these groups individually, or create new groups and add nodes to them.

To assign a node to a group, fill in the group name under the `node_group` column in the `aidc.csv` file, then run `aidc-cli init inventory` to generate the inventory.
{% endhint %}

### 4.2 `group-set` — Manage Node Groups

```bash
aidc-cli init group-set [flags]
```

| Flag           | Short | Required | Description                                                                       |
| -------------- | :---: | :------: | --------------------------------------------------------------------------------- |
| `--add`        |  `-a` |     ❌    | Add groups (comma-separated). Duplicates are ignored                              |
| `--delete`     |  `-d` |     ❌    | Delete groups (comma-separated). Groups in use in the inventory cannot be deleted |
| `--remove-all` |  `-r` |     ❌    | Remove all groups. Groups in use in the inventory cannot be removed               |

{% hint style="warning" %}
`--add`, `--delete`, and `--remove-all` are **mutually exclusive** — use only one per invocation.

Groups that are currently assigned to nodes in the inventory **cannot be deleted**. Remove the nodes from the group first, re-render the inventory, then delete the group.
{% endhint %}

**Examples:**

```bash
# Add groups
aidc-cli init group-set -a "computing_node,login_node,datatransfer_node,service_node,management_node"

# Delete specific groups
aidc-cli init group-set -d "storage,temp_group"

# Remove all groups (only if none are in use)
aidc-cli init group-set -r
```

***

## 5. BMC Configuration <a href="#bmc-configuration" id="bmc-configuration"></a>

### 5.1 `bmc-get` — View BMC Settings

Displays the current BMC configuration.

```bash
aidc-cli init bmc-get
```

### 5.2 `bmc-set` — Set BMC Settings

```bash
aidc-cli init bmc-set [flags]
```

| Flag                  | Short | Required | Description                                                                           |
| --------------------- | :---: | :------: | ------------------------------------------------------------------------------------- |
| `--bmc-password`      |  `-p` |     ❌    | BMC password (or the new password when used with `init-pwd` & `change-pwd` functions) |
| `--bmc-prev-password` |  `-v` |     ❌    | Previous BMC password (only applicable with the `change-pwd` function)                |
| `--bmc-lan-mask`      |  `-m` |     ❌    | BMC LAN subnet mask                                                                   |
| `--bmc-lan-gw`        |  `-g` |     ❌    | BMC LAN gateway                                                                       |

{% hint style="info" %}
At least one flag must be provided.
{% endhint %}

**Examples:**

```bash
# Set BMC password
aidc-cli init bmc-set -p "password"

# Set previous password for password change
aidc-cli init bmc-set -v "previous_password"

# Set BMC LAN gateway and mask
aidc-cli init bmc-set -g "bmc_lan_gw" -m "bmc_lan_mask"
```

***

## 6. System Configuration <a href="#system-configuration" id="system-configuration"></a>

### 6.1 `syscfg-get` — View System Configuration

Displays the current system configuration settings. This shows whether a configuration file exists — the configuration file is the one that will be deployed to the remote target machines.

```bash
aidc-cli init syscfg-get
```

### 6.2 `syscfg-set` — Set System Configuration

```bash
aidc-cli init syscfg-set [flags]
```

| Flag         | Short | Required | Description                                  |
| ------------ | :---: | :------: | -------------------------------------------- |
| `--timezone` |  `-z` |     ✅    | Set the timezone (supports shell completion) |

**Examples:**

```bash
# Set timezone
aidc-cli init syscfg-set -z "Asia/Tokyo"

# Use Tab completion to discover available timezones
aidc-cli init syscfg-set -z <Tab>
```

### 6.3 `syscfg-ntp-set` — Set NTP Servers

Manages the NTP server list for time synchronization.

```bash
aidc-cli init syscfg-ntp-set [flags]
```

| Flag           | Short | Required | Description                                   |
| -------------- | :---: | :------: | --------------------------------------------- |
| `--add`        |  `-a` |     ❌    | Add NTP servers (comma-separated)             |
| `--delete`     |  `-d` |     ❌    | Delete specific NTP servers (comma-separated) |
| `--remove-all` |  `-r` |     ❌    | Remove all NTP servers                        |

{% hint style="warning" %}
`--add`, `--delete`, and `--remove-all` are **mutually exclusive** — use only one per invocation.
{% endhint %}

**Examples:**

```bash
# Add NTP servers
aidc-cli init syscfg-ntp-set -a "time.windows.com,time.google.com,time1.facebook.com"

# Delete specific NTP server
aidc-cli init syscfg-ntp-set -d "time1.facebook.com"

# Remove all NTP servers
aidc-cli init syscfg-ntp-set -r
```

***

## 7. Package Configuration <a href="#package-configuration" id="package-configuration"></a>

### 7.1 `pkg-get` — View Package Settings

Displays the current default package list.

```bash
aidc-cli init pkg-get
```

### 7.2 `pkg-set` — Set Package Settings

```bash
aidc-cli init pkg-set [flags]
```

| Flag           | Short | Required | Description                                                |
| -------------- | :---: | :------: | ---------------------------------------------------------- |
| `--add`        |  `-a` |     ❌    | Add packages to the default install list (comma-separated) |
| `--delete`     |  `-d` |     ❌    | Delete specific packages from the list (comma-separated)   |
| `--remove-all` |  `-r` |     ❌    | Remove all packages from the list                          |

{% hint style="warning" %}
`--add`, `--delete`, and `--remove-all` are **mutually exclusive** — use only one per invocation.
{% endhint %}

**Examples:**

```bash
# Add packages
aidc-cli init pkg-set -a "aaa,bbb,ccc"

# Delete specific packages
aidc-cli init pkg-set -d "aaa,bbb"

# Remove all packages
aidc-cli init pkg-set -r
```

***

## 8. DHCP Configuration <a href="#dhcp-configuration" id="dhcp-configuration"></a>

### 8.1 `dhcp-get` — View DHCP Settings

Displays the current DHCP configuration.

```bash
aidc-cli init dhcp-get
```

{% hint style="info" %}
This DHCP information will be used during the OS deployment process.
{% endhint %}

### 8.2 `dhcp-set` — Set DHCP Settings

```bash
aidc-cli init dhcp-set [flags]
```

| Flag              | Short | Required | Description                                              |
| ----------------- | :---: | :------: | -------------------------------------------------------- |
| `--subnet`        |  `-s` |     ❌    | DHCP subnet address                                      |
| `--netmask`       |  `-m` |     ❌    | DHCP netmask (must be contiguous, e.g., `255.255.255.0`) |
| `--default_route` |  `-r` |     ❌    | DHCP gateway/default route                               |
| `--next_server`   |  `-n` |     ❌    | PXE next-server (TFTP server address)                    |
| `--range`         |  `-g` |     ❌    | DHCP IP range (comma-separated: start,end)               |

{% hint style="info" %}
At least one flag must be provided. All IP addresses are validated for correct format. The range must contain exactly 2 IPs where start ≤ end. Configuration consistency is validated before saving.
{% endhint %}

**Example:**

```bash
# Configure complete DHCP settings
aidc-cli init dhcp-set -s 10.10.51.0 -r 10.10.30.91 -m 255.255.255.0 -n 10.10.51.250 -g 10.10.51.220,10.10.51.230
```

### 8.3 `dhcp-validate` — Validate CSV IPs Against DHCP

Performs a comprehensive validation of all node IPs in CSV files against the configured DHCP subnet.

```bash
aidc-cli init dhcp-validate
```

**Validation Steps:**

1. **DHCP Configuration Check** — validates that subnet, netmask, range, and routes are consistent
2. **CSV IP Validation** — checks every `bmc_ip` and `eth0_ip` in CSV files:
   * Flags IPs **outside the DHCP subnet** as errors (nodes will fail to PXE boot)
   * Flags fixed IPs **inside the DHCP dynamic range** as warnings (potential IP conflicts)

**Output Example:**

```
╔═══════════════════════════════════════════════╗
║       DHCP Configuration Validation           ║
╚═══════════════════════════════════════════════╝

📋 Step 1: Validating DHCP Configuration...
  Subnet       : 10.10.51.0
  Netmask      : 255.255.255.0
  Default Route: 10.10.30.91
  Next Server  : 10.10.51.201
  DHCP Range   : 10.10.51.220 - 10.10.51.230

  ⚠️  Configuration Warnings:
     • default_route (10.10.30.91) is outside DHCP subnet

📋 Step 2: Validating CSV IP Addresses...
  Checking: aidc.csv
    ❌ [docker110] bmc_ip 10.10.29.233 is outside DHCP subnet
    ⚠️  [docker112] eth0_ip 10.10.51.227 conflicts with DHCP dynamic range

╔═══════════════════════════════════════════════╗
║            Validation Summary                 ║
╚═══════════════════════════════════════════════╝
  ❌ 6 IP address(es) are outside the DHCP subnet.
     Action: Update CSV with IPs in subnet, or adjust DHCP settings.
  ⚠️  2 fixed IP address(es) conflict with DHCP dynamic range.
     Recommendation: Use fixed IPs outside the dynamic range.
```

***

## 9. Network Configuration <a href="#network-configuration" id="network-configuration"></a>

These commands configure network parameters **in the configuration files** (unlike the `network` command which applies them to live nodes).

{% hint style="warning" %}
**Important:** Please make sure to fill in the IP address information for each machine in the `aidc.csv` file before running `aidc-cli init inventory` to generate the inventory. Also, confirm which column the IP address is filled in — you need to use the `-p` flag to specify the corresponding column name (e.g., `eth0`, `bond0`, `ib0`).
{% endhint %}

### 9.1 Ethernet — `eth-get` / `eth-set`

```bash
aidc-cli init eth-get
aidc-cli init eth-set [flags]
```

| Flag              | Short | Required | Description                                                                  |
| ----------------- | :---: | :------: | ---------------------------------------------------------------------------- |
| `--column-prefix` |  `-p` |     ❌    | Ethernet column prefix in node info (e.g., `eth0`, `eth1`, `eth2`, `eth3`)   |
| `--interface`     |  `-f` |     ❌    | Interface name                                                               |
| `--mtu`           |  `-u` |     ❌    | MTU value (default: `1500`)                                                  |
| `--ipv4-mode`     |  `-m` |     ❌    | IPv4 mode: `static` or `dhcp`                                                |
| `--ipv4-netmask`  |  `-k` |     ❌    | IPv4 netmask (CIDR notation, e.g., `24`). **Required when mode is `static`** |
| `--ipv4-gateway`  |  `-g` |     ❌    | IPv4 gateway                                                                 |
| `--ipv4-dns`      |  `-n` |     ❌    | IPv4 DNS servers (comma-separated)                                           |
| `--vlan-enable`   |  `-v` |     ❌    | Enable/disable VLAN: `true` or `false`                                       |
| `--vlan-id`       |  `-d` |     ❌    | VLAN ID (required when VLAN is enabled)                                      |

**Example:**

```bash
# Configure static ethernet with full parameters
aidc-cli init eth-set -p eth0 -f eth0 -u 1500 -m static -k 24 -g 192.168.1.1 -n 168.95.1.1,8.8.8.8 -v true -d 10
```

### 9.2 Bonding — `bond-get` / `bond-set`

```bash
aidc-cli init bond-get
aidc-cli init bond-set [flags]
```

| Flag              | Short | Required | Description                                             |
| ----------------- | :---: | :------: | ------------------------------------------------------- |
| `--column-prefix` |  `-p` |     ❌    | Bond column prefix in node info                         |
| `--bond-name`     |  `-b` |     ❌    | Bond interface name                                     |
| `--slave-list`    |  `-s` |     ❌    | Slave interfaces (comma-separated, 2–4 interfaces)      |
| `--mtu`           |  `-u` |     ❌    | MTU value (default: `1500`)                             |
| `--ipv4-mode`     |  `-m` |     ❌    | IPv4 mode: `static` or `dhcp`                           |
| `--ipv4-netmask`  |  `-k` |     ❌    | IPv4 netmask (CIDR). **Required when mode is `static`** |
| `--ipv4-gateway`  |  `-g` |     ❌    | IPv4 gateway                                            |
| `--ipv4-dns`      |  `-n` |     ❌    | IPv4 DNS servers (comma-separated)                      |
| `--vlan-enable`   |  `-v` |     ❌    | Enable/disable VLAN: `true` or `false`                  |
| `--vlan-id`       |  `-d` |     ❌    | VLAN ID (required when VLAN is enabled)                 |

**Example:**

```bash
# Configure bonding with 2 slave interfaces
aidc-cli init bond-set -p bond0 -b bond0 -u 1500 -s eth1,eth2 -m static -k 24 -g 192.168.1.1 -n 168.95.1.1,8.8.8.8 -v true -d 10
```

### 9.3 InfiniBand — `ib-get` / `ib-set`

```bash
aidc-cli init ib-get
aidc-cli init ib-set [flags]
```

| Flag                   | Short | Required | Description                                 |
| ---------------------- | :---: | :------: | ------------------------------------------- |
| `--column-prefix-list` |  `-p` |     ❌    | IB column prefix list (comma-separated)     |
| `--interface-list`     |  `-f` |     ❌    | InfiniBand interface list (comma-separated) |

{% hint style="info" %}
InfiniBand supports up to 8 interfaces (`ib0` through `ib7`). Ensure the corresponding IP & netmask columns are filled in the `aidc.csv` file using CIDR notation (e.g., `192.168.100.20/24`) before running `init inventory`.
{% endhint %}

**Example:**

```bash
# Configure up to 8 IB interfaces
aidc-cli init ib-set -p ib0,ib1,ib2,ib3,ib4,ib5,ib6,ib7
```

### 9.4 NVOS — `nvos-get` / `nvos-set`

Configure NVOS Ethernet switch parameters.

```bash
aidc-cli init nvos-get
aidc-cli init nvos-set [flags]
```

| Flag             | Short | Required | Description                                             |
| ---------------- | :---: | :------: | ------------------------------------------------------- |
| `--ipv4-mode`    |  `-m` |     ❌    | IPv4 mode: `static` or `dhcp`                           |
| `--ipv4-netmask` |  `-k` |     ❌    | IPv4 netmask (CIDR). **Required when mode is `static`** |
| `--ipv4-gateway` |  `-g` |     ❌    | IPv4 gateway. **Required when mode is `static`**        |

**Example:**

```bash
aidc-cli init nvos-set -m static -k 24 -g 10.10.30.1
```

### 9.5 Link Type — `link-type-get` / `link-type-set`

Manage NIC link type configuration (InfiniBand vs Ethernet).

```bash
aidc-cli init link-type-get
aidc-cli init link-type-set [flags]
```

| Flag          | Short | Required | Description                                                               |
| ------------- | :---: | :------: | ------------------------------------------------------------------------- |
| `--interface` |  `-f` |     ❌    | Network interface name                                                    |
| `--type`      |  `-t` |     ❌    | Link type: `ib` (InfiniBand) or `eth` (Ethernet)                          |
| `--remove`    |  `-r` |     ❌    | Remove a specific interface entry, or clear all if no interface specified |

**Examples:**

```bash
# Set link type for an interface
aidc-cli init link-type-set -f ibP22s22f1 -t eth

# Remove a specific interface entry
aidc-cli init link-type-set -f mlx5_0 -r

# Clear all link type entries
aidc-cli init link-type-set -r
```

***

## 10. Deploy Image Management <a href="#deploy-image-management" id="deploy-image-management"></a>

Manage the OS image lifecycle for PXE deployment.

### 10.1 `image-downloadable` — List Downloadable Images

Shows images that are available for download but not yet present locally.

```bash
aidc-cli init image-downloadable
```

### 10.2 `image-download` — Download Deploy Image

Downloads a deploy image by its index from the downloadable list.

```bash
aidc-cli init image-download -x <index>
```

| Flag      | Short | Required | Description                                                |
| --------- | :---: | :------: | ---------------------------------------------------------- |
| `--index` |  `-x` |     ✅    | Index of the image to download (from `image-downloadable`) |

**Example:**

```bash
aidc-cli init image-download -x 2
```

### 10.3 `image-discovery` — Discover Available Images

Scans for available OS images in the path `/home/admin/data/os_info/*` and saves the discovery results.

```bash
aidc-cli init image-discovery
```

{% hint style="info" %}
After discovery, `image-discovery` will automatically call `image-active` with index 1 by default, setting the first discovered image as the active deploy image.
{% endhint %}

{% hint style="warning" %}
Please do not modify the discovered YAML files. These YAML files are used by the default images and will be provided as selectable options during OS deployment.
{% endhint %}

### 10.4 `image-active` — Set Active Deploy Image

Selects which image to use for deployment by its index number.

```bash
aidc-cli init image-active -x <index>
```

| Flag      | Short | Required | Description                                        |
| --------- | :---: | :------: | -------------------------------------------------- |
| `--index` |  `-x` |     ✅    | Index of the image to activate (from `image-list`) |

### 10.5 `image-list` — List Deploy Images

Displays the active image and all discovered deploy images with their indices.

```bash
aidc-cli init image-list
```

**Typical Workflow:**

```bash
# 1. Check downloadable images and download one
aidc-cli init image-downloadable
aidc-cli init image-download -x 2

# 2. Discover available images
aidc-cli init image-discovery

# 3. List discovered images
aidc-cli init image-list

# 4. Select an image for deployment
aidc-cli init image-active -x 1
```

***

## 11. Disk Configuration <a href="#disk-configuration" id="disk-configuration"></a>

### 11.1 Software RAID — `swraid-get` / `swraid-set`

Configure software RAID arrays for target nodes.

```bash
aidc-cli init swraid-get
aidc-cli init swraid-set [flags]
```

| Flag                 | Short | Required | Description                             |
| -------------------- | :---: | :------: | --------------------------------------- |
| `--raid-level`       |  `-v` |     ✅    | RAID level: `0`, `1`, `5`, `6`, or `10` |
| `--device-name-list` |  `-d` |     ✅    | Disk device list (comma-separated)      |
| `--raid-device-name` |  `-n` |     ✅    | RAID device name (e.g., `/dev/md131`)   |
| `--mount-point`      |  `-m` |     ✅    | Mount point (e.g., `/data`)             |

**RAID Level Requirements:**

| Level |  Minimum Disks  | Notes                       |
| :---: | :-------------: | --------------------------- |
|   0   |        2        | Striping, no redundancy     |
|   1   |        2        | Mirroring                   |
|   5   |        3        | Striping with parity        |
|   6   |        4        | Striping with double parity |
|   10  | 4 (even number) | Mirrored stripes            |

**Example:**

```bash
# RAID 6 with 6 NVMe disks
aidc-cli init swraid-set -v 6 -n "/dev/md131" -m "/data" -d "/dev/nvme0n1,/dev/nvme1n1,/dev/nvme2n1,/dev/nvme3n1,/dev/nvme4n1,/dev/nvme5n1"
```

### 11.2 LVM — `lvm-get` / `lvm-set`

Configure Logical Volume Manager settings.

```bash
aidc-cli init lvm-get
aidc-cli init lvm-set [flags]
```

| Flag                 | Short | Required | Description                             |
| -------------------- | :---: | :------: | --------------------------------------- |
| `--physical-volumes` |  `-p` |     ✅    | Physical volumes list (comma-separated) |
| `--volume-groups`    |  `-g` |     ✅    | Volume groups list (comma-separated)    |
| `--logical-volumes`  |  `-v` |     ✅    | Logical volumes list (comma-separated)  |

**Example:**

```bash
aidc-cli init lvm-set -v /dev/vg_physical/lv_data,/dev/vg_physical/lv_log -p /dev/sdb1,/dev/sdb2 -g vg_physical
```

***

## 12. Service Configuration <a href="#service-configuration" id="service-configuration"></a>

### 12.1 Slurm — `slurm-get` / `slurm-set`

Configure Slurm workload manager node group assignments and database credentials.

```bash
aidc-cli init slurm-get
aidc-cli init slurm-set [flags]
```

| Flag                    | Short | Required | Description                                              |
| ----------------------- | :---: | :------: | -------------------------------------------------------- |
| `--headnode-group`      |  `-t` |     ❌    | Node group for Slurm control node (supports completion)  |
| `--compute-group`       |  `-c` |     ❌    | Node group for Slurm compute nodes (supports completion) |
| `--db-group`            |  `-d` |     ❌    | Node group for Slurm database node (supports completion) |
| `--slurm_acct_username` |  `-u` |     ❌    | Username for SlurmDB accounting                          |
| `--slurm_acct_password` |  `-p` |     ❌    | Password for SlurmDB accounting                          |

**Example:**

```bash
aidc-cli init slurm-set -t headnode-group
aidc-cli init slurm-set -c computenode-group
aidc-cli init slurm-set -d slurmdb-group
aidc-cli init slurm-set -u slurm
aidc-cli init slurm-set -p "1234567890"
```

### 12.2 MariaDB — `mariadb-get` / `mariadb-set`

Configure MariaDB Galera cluster settings.

```bash
aidc-cli init mariadb-get
aidc-cli init mariadb-set [flags]
```

| Flag                 | Short | Required | Description                               |
| -------------------- | :---: | :------: | ----------------------------------------- |
| `--galera-group`     |  `-d` |     ❌    | Node group for building Galera DB cluster |
| `--mariadb-password` |  `-p` |     ❌    | Password for MariaDB                      |

**Example:**

```bash
aidc-cli init mariadb-set -d mariadb
aidc-cli init mariadb-set -p "1234567890"
```

### 12.3 Container — `container-get` / `container-set`

Configure container runtime (Docker/Podman) target node groups.

```bash
aidc-cli init container-get
aidc-cli init container-set [flags]
```

| Flag                | Short | Required | Description                         |
| ------------------- | :---: | :------: | ----------------------------------- |
| `--container-group` |  `-d` |     ✅    | Node group for container deployment |

**Example:**

```bash
aidc-cli init container-set -d compute
```

### 12.4 Harbor — `harbor-get` / `harbor-set`

Manage Harbor container registry configuration — admin password, server and client node groups.

```bash
aidc-cli init harbor-get
aidc-cli init harbor-set [flags]
```

| Flag               | Short | Required | Description                      |
| ------------------ | :---: | :------: | -------------------------------- |
| `--admin-password` |  `-p` |    ❌\*   | Harbor admin password            |
| `--server-group`   |  `-s` |    ❌\*   | Ansible group for Harbor server  |
| `--client-group`   |  `-c` |    ❌\*   | Ansible group for Harbor clients |

{% hint style="info" %}
At least one flag must be provided for `harbor-set`. Flags can be combined in a single call.
{% endhint %}

**Example:**

```bash
aidc-cli init harbor-get
aidc-cli init harbor-set -p "MyHarborPass123"
aidc-cli init harbor-set -s harbor-server -c compute
aidc-cli init harbor-set -p "MyHarborPass123" -s harbor-server -c compute
```

### 12.5 Kubernetes — `k8s-get` / `k8s-set`

Configure Kubernetes cluster settings.

```bash
aidc-cli init k8s-get
aidc-cli init k8s-set [flags]
```

| Flag              | Short | Required | Description                                             |
| ----------------- | :---: | :------: | ------------------------------------------------------- |
| `--control-group` |  `-c` |     ❌    | Node group for K8s Control Plane                        |
| `--data-group`    |  `-d` |     ❌    | Node group for K8s Data Plane                           |
| `--gateway-ip`    |  `-g` |     ❌    | Gateway IP for K8s configuration (default route)        |
| `--iface`         |  `-n` |     ❌    | Network interface for K8s configuration (default route) |

**Example:**

```bash
aidc-cli init k8s-set -c computenode-group
aidc-cli init k8s-set -d slurmdb-group
aidc-cli init k8s-set -g 192.168.2.1
aidc-cli init k8s-set -n eth0
```

***

## 13. Management Service Configuration <a href="#management-service-configuration" id="management-service-configuration"></a>

### 13.1 UFM — `ufm-get` / `ufm-set`

Configure Unified Fabric Manager settings.

```bash
aidc-cli init ufm-get
aidc-cli init ufm-set [flags]
```

| Flag              | Short | Required | Description                 |
| ----------------- | :---: | :------: | --------------------------- |
| `--interface`     |  `-n` |     ❌    | UFM interface (e.g., `ib0`) |
| `--licenses-path` |  `-p` |     ❌    | Path to UFM license files   |

**Example:**

```bash
aidc-cli init ufm-set -n ib0 -p /root/ufm_licenses/
```

### 13.2 NMX — `nmx-get` / `nmx-set` / `nmx-reset`

Configure NVIDIA NMX-M (Network Management Experience) management VMs. NMX-M is a network fabric management solution that requires a cluster of **3 VMs** distributed across up to **3 Host OSes**.

**Architecture:**

NMX-M follows a **Master + Workers** cluster topology:

| Topology Rule   | Constraint                             |
| --------------- | -------------------------------------- |
| Total VMs       | Maximum **3**                          |
| Total Host OSes | Up to **3** (maximum)                  |
| Master nodes    | **At least 1** master required         |
| Worker nodes    | Other VMs assigned as workers          |
| VM distribution | VMs can be spread across 1–3 Host OSes |

**VM Default Specifications (per VM):**

| Parameter   | Default Value | Description                           |
| ----------- | ------------- | ------------------------------------- |
| Subnet Mask | /22 (CIDR)    | Network mask for VM IP                |
| DNS         | 8.8.8.8       | Default DNS server                    |
| Role        | worker        | Default role assignment               |
| Bridge      | br0           | Default bridge interface              |
| VM Name     | nmx-vm{index} | Auto-generated name (e.g., `nmx-vm1`) |

{% hint style="warning" %}
Ensure the Host OS machines meet the above hardware specifications before deploying NMX-M. After completing NMX init configuration, use `aidc-cli nmx deploy` to perform the actual deployment.
{% endhint %}

#### `nmx-get` — View NMX Configuration

Displays the full NMX-M VM configuration, grouped by Host OS with VM indices.

```bash
aidc-cli init nmx-get
```

**Sample Output:**

```
==============================================
   NMX VM Configuration
==============================================
Host OS: nmx-host1
  VM #1: nmx-m-netq-vm1
    QCOW Path : /root/netq-4.15.0-ubuntu-24.04-ts-qemu.qcow2
    IP        : 10.10.29.1
    Mask      : 22
    Gateway   : 10.10.30.1
    DNS       : 8.8.8.8
    Role      : master
    Bridge    : br0
----------------------------------------------
  VM #2: nmx-m-netq-vm2
    IP        : 10.10.29.2
    Role      : worker
==============================================
Total VMs: 2 | Max: 3
==============================================
```

#### `nmx-set` — Configure NMX VMs

Configure NMX virtual machines (maximum 3 VMs) or delete existing VMs/Host OS.

**Syntax:**

```bash
# Configure VM
aidc-cli init nmx-set -I <vm-index> [options...]

# Delete VM
aidc-cli init nmx-set -I <vm-index> -X

# Delete Host OS (including all VMs)
aidc-cli init nmx-set -H <host-os-name>
```

**Parameters:**

| #  | Short | Long            | Type   | Required | Description              | Example                      |
| -- | :---: | --------------- | ------ | :------: | ------------------------ | ---------------------------- |
| 1  |  `-I` | `--vm-index`    | int    |    ❌\*   | VM index (1-3)           | `-I 1`                       |
| 2  |  `-O` | `--host-os`     | string |     ❌    | Host OS name             | `-O nmx-host1`               |
| 3  |  `-N` | `--vm-name`     | string |     ❌    | VM name                  | `-N nmx-m-netq-vm1`          |
| 4  |  `-Q` | `--qcow-path`   | string |     ❌    | QCOW2 image path         | `-Q /root/netq-4.15.0.qcow2` |
| 5  |  `-A` | `--vm-ip`       | string |     ❌    | VM IP address            | `-A 10.10.29.1`              |
| 6  |  `-M` | `--vm-mask`     | int    |     ❌    | Subnet mask (CIDR)       | `-M 22`                      |
| 7  |  `-G` | `--vm-gateway`  | string |     ❌    | Default gateway          | `-G 10.10.30.1`              |
| 8  |  `-D` | `--vm-dns`      | string |     ❌    | DNS server               | `-D 8.8.8.8`                 |
| 9  |  `-R` | `--vm-role`     | string |     ❌    | VM role (master/worker)  | `-R master`                  |
| 10 |  `-B` | `--vm-bridge`   | string |     ❌    | Bridge interface         | `-B br0`                     |
| 11 |  `-X` | `--delete-vm`   | bool   |     ❌    | Delete specified VM      | `-X`                         |
| 12 |  `-H` | `--delete-host` | string |     ❌    | Delete specified Host OS | `-H nmx-host1`               |

> \* `-I` is required for configure and delete-vm (`-X`) modes, but not needed when `-H` (delete-host) is specified.

{% hint style="info" %}
**Parameter Inheritance:** When creating VM #2 or #3, unspecified parameters inherit from VM #1. This simplifies configuration when all VMs share common settings (Gateway, DNS, Bridge, etc.).
{% endhint %}

**Examples:**

```bash
# Create Master VM
aidc-cli init nmx-set \
  -I 1 \
  -O nmx-host1 \
  -N nmx-m-netq-vm1 \
  -Q /root/netq-4.15.0-ubuntu-24.04-ts-qemu.qcow2 \
  -A 10.10.29.1 \
  -M 22 \
  -G 10.10.30.1 \
  -D 8.8.8.8 \
  -R master \
  -B br0

# Create Worker VM (inherits Gateway, DNS, Bridge from VM #1)
aidc-cli init nmx-set \
  -I 2 \
  -O nmx-host1 \
  -N nmx-m-netq-vm2 \
  -A 10.10.29.2 \
  -R worker

# Update Existing VM IP
aidc-cli init nmx-set -I 1 -A 10.10.29.10

# Delete VM
aidc-cli init nmx-set -I 2 -X

# Delete Host OS
aidc-cli init nmx-set -H nmx-host1
```

{% hint style="danger" %}
**Warning:** Deleting a Host OS (`-H`) removes **all VMs** under that host.
{% endhint %}

**Constraints:**

1. **VM Limit:** Maximum 3 VMs
2. **VM Index:** Must be 1, 2, or 3
3. **Role:** Only `master` or `worker`
4. **Host OS Naming:** Recommended `nmx-host1`, `nmx-host2`, `nmx-host3`
5. **Network Settings:** IP, Gateway, DNS must match actual network topology
6. **QCOW2 Path:** Must exist on Host OS

#### `nmx-reset` — Reset All NMX Configuration

Reset all NMX VM configurations.

**Syntax:**

```bash
# Interactive Confirmation (Default)
aidc-cli init nmx-reset

# Force Reset (No Confirmation)
aidc-cli init nmx-reset -F
```

**Parameters:**

| Short | Long      | Type | Description                          |
| :---: | --------- | ---- | ------------------------------------ |
|  `-F` | `--force` | bool | Force execution without confirmation |

**Example:**

```bash
$ aidc-cli init nmx-reset
WARNING: This will delete ALL NMX VM configurations!
Are you sure? (yes/no): yes
All NMX VM configurations have been reset.
```

***

#### Deployment Workflow

**1. Configure NMX VMs**

```bash
# Configure Master VM
aidc-cli init nmx-set \
  -I 1 -O nmx-host1 -N nmx-m-netq-vm1 \
  -Q /root/netq-4.15.0.qcow2 \
  -A 10.10.29.1 -M 22 -G 10.10.30.1 \
  -D 8.8.8.8 -R master -B br0

# Configure Worker VM
aidc-cli init nmx-set \
  -I 2 -O nmx-host1 -N nmx-m-netq-vm2 \
  -A 10.10.29.2 -R worker
```

**2. Verify Configuration**

```bash
aidc-cli init nmx-get
```

**3. Deploy NMX**

```bash
aidc-cli nmx deploy \
  -W <kong-rw-password> \
  -E <kong-ro-password> \
  -V <vm-password>
```

| Flag | Description              |
| ---- | ------------------------ |
| `-W` | Kong read-write password |
| `-E` | Kong read-only password  |
| `-V` | VM password              |

***

## 14. NVMe Firmware Update Configuration <a href="#id-14-nvme-firmware-update-configuration" id="id-14-nvme-firmware-update-configuration"></a>

### 14.1 `nvme-get` — View NVMe Firmware Update Settings

Displays the current default NVMe firmware update settings used by `aidc-cli fwupdate nvme`.

```bash
aidc-cli init nvme-get
```

### 14.2 `nvme-set` — Set NVMe Firmware Update Settings

Stores the default firmware filename, target NVMe devices, and reboot behavior for later use by `aidc-cli fwupdate nvme`.

```bash
aidc-cli init nvme-set [flags]
```

| Flag       | Short | Required | Description                                                               |
| ---------- | :---: | :------: | ------------------------------------------------------------------------- |
| `--file`   |  `-f` |     ❌    | NVMe firmware file name (e.g., `General_PM9A3_U.2_GDC5A02Q_Noformat.bin`) |
| `--device` |  `-d` |     ❌    | NVMe device path; repeat or comma-separate for multiple devices           |
| `--reboot` |  `-r` |     ❌    | Reboot after firmware update to activate new firmware                     |

{% hint style="info" %}
At least one flag must be provided for `nvme-set`. Values saved here are used as defaults by `aidc-cli fwupdate nvme`.
{% endhint %}

**Examples:**

```bash
# Set default firmware file
aidc-cli init nvme-set -f "General_PM9A3_U.2_GDC5A02Q_Noformat.bin"

# Set target NVMe devices
aidc-cli init nvme-set -d /dev/nvme0,/dev/nvme1

# Enable reboot after update
aidc-cli init nvme-set -r

# Review saved settings
aidc-cli init nvme-get
```

{% hint style="warning" %}
If `fwupdate nvme` is run without `--file` or `--device`, the command falls back to the values saved here. Ensure both firmware file and target devices are configured before execution.
{% endhint %}

#### Best Practices

1. **Network Planning:** Plan IP allocation to avoid conflicts
2. **Role Assignment:** At least one `master`, others as `worker`
3. **Incremental Setup:** Configure Master first, then Workers
