> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sambanova.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# グループ管理

グループは、一括操作のためにラックを論理的な集合としてまとめるものです。本番環境、ステージング環境、テスト環境など、関連するインフラストラクチャの管理にグループを活用してください。

## グループコマンド

グループの作成と管理には、以下のコマンドを使用します。

### グループの作成

新しいグループを作成します。

```bash theme={}
snctl group create <group_name> --description <description>
```

**パラメータ:**

| パラメータ | 説明 |
| - | - |
| `<group_name>` | グループの名前 (英数字のみ) |
| `--description` | グループの説明 (必須) |

**例:**

```bash theme={}
snctl group create g1 --description "Production"
snctl group create g2 --description "Staging"
```

### グループ説明の更新

既存のグループの説明を編集します。

```bash theme={}
snctl group create <group_name> --description <new_description>
```

**例:**

```bash theme={}
snctl group create production --description "Updated: Production infrastructure (High Priority)"
```

### グループの削除

インベントリからグループを削除します。

```bash theme={}
snctl group delete <group_name>
```

**例:**

```bash theme={}
snctl group delete staging
```

> [!NOTE]
>
> グループを削除しても、グループ内のラックは削除されません。ラックは SambaRack Manager インベントリに残ります。

### グループの一覧表示

設定済みのすべてのグループと、それぞれのラック数を表示します。

```bash theme={}
snctl group list
```

**出力例:**

```text theme={}
+------------+-------------+------------+
| Group Name | Description | Rack Count |
+------------+-------------+------------+
| g1         | Production  | 1          |
+------------+-------------+------------+
```

### グループ詳細の表示

すべてのラックを含む、特定のグループの詳細を表示します。

```bash theme={}
snctl group show <group_name>
```

**例:**

```bash theme={}
snctl group show g1
```

**出力例 - 4-PDU ラック:**

```text theme={}
Group: g1
├── Description: Group 1
└── Racks
    ├── 001 (type: 1001934)
    └── 002 (type: 1001934)
```

**出力例 - 混在構成:**

```text theme={}
Group: g1
├── Description: Group 1
└── Racks
    ├── 001 (type: 1001934)
    └── 002 (type: 1002331)
```

## ラックの所属管理コマンド

グループに対するラックの所属を管理するには、以下のコマンドを使用します。

### グループへのラックの追加

1 つ以上のラックをグループに追加します。

```bash theme={}
snctl group add-rack <group_name> --rack-id <rack_id>[,<rack_id>,...]
```

**例 – 単一のラックを追加:**

```bash theme={}
snctl group add-rack production --rack-id 001
```

**例 – 複数のラックを追加:**

```bash theme={}
snctl group add-rack production --rack-id 001,002,003
```

### グループからのラックの削除

グループからラックを削除します。

```bash theme={}
snctl group remove-rack <group_name> --rack-id <rack_id>
```

**例:**

```bash theme={}
snctl group remove-rack production --rack-id 001
```

> [!NOTE]
>
> グループからラックを削除しても、ラック自体は SambaRack Manager インベントリから削除されません。

## 他のコマンドでのグループの利用

グループは、デバイス操作やノード操作の対象として指定できます。これにより、複数のラックにまたがる一括操作を実行できます。

### デバイス操作

グループに属するラック内のすべてのデバイスのファームウェアを確認します。

```bash theme={}
snctl device firmware-check --group production --type all
```

詳細は [デバイス管理](/docs/ja/v2.0.2/sambastack/hardware-admin/sambarack-manager/srm-device-admin.md) をご参照ください。

### ノードの電源操作

グループに属するラック内のすべてのノードに対して、DC 電源操作を実行します。

```bash theme={}
# Check power state of all nodes in a group
snctl node powerstate --group production --type node

# Power on all nodes in a group
snctl node poweron --group production --type node

# Power off all nodes in a group
snctl node poweroff --group production --type node

# Power cycle all nodes in a group
snctl node powercycle --group production --type node
```

電源操作の詳細は [ノード管理](/docs/ja/v2.0.2/sambastack/hardware-admin/sambarack-manager/srm-node-admin.md) をご参照ください。
