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

# Group administration

Groups organize racks into logical collections for batch operations. Use groups to manage related infrastructure, such as production, staging, or testing environments.

## Group commands

Use the following commands to create and manage groups.

### Create group

Create a new group:

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

**Parameters:**

| Parameter       | Description                                       |
| --------------- | ------------------------------------------------- |
| `<group_name>`  | Name for the group (alphanumeric characters only) |
| `--description` | Description of the group (required)               |

**Example:**

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

### Update group description

Edit the description of an existing group:

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

**Example:**

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

### Delete group

Remove a group from the inventory:

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

**Example:**

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

<Note>
  Deleting a group does not delete the racks within it. The racks remain in the SambaRack Manager inventory.
</Note>

### List groups

Display all configured groups and their rack counts:

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

**Example output:**

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

### Show group details

View details of a specific group, including all racks:

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

**Example:**

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

**Example output - 4-PDU racks:**

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

**Example output - mixed configuration:**

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

## Rack membership commands

Use the following commands to manage rack membership within groups.

### Add rack to group

Add one or more racks to a group:

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

**Example – add a single rack:**

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

**Example – add multiple racks:**

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

### Remove rack from group

Remove a rack from a group:

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

**Example:**

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

<Note>
  Removing a rack from a group does not delete the rack from the SambaRack Manager inventory.
</Note>

## Using groups with other commands

Groups can be used as targets for device and node operations, allowing you to perform batch operations across multiple racks.

### Device operations

Check firmware on all devices in racks belonging to a group:

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

See [Device Administration](/en/v1.2.0/sambastack/hardware-admin/sambarack-manager/srm-device-admin) for more details.

### Node power operations

Perform DC power operations on all nodes in racks belonging to a group:

```bash theme={null}
# 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
```

See [Node Administration](/en/v1.2.0/sambastack/hardware-admin/sambarack-manager/srm-node-admin) for more details on power operations.
