TrueNAS SCALETrueNAS SCALE Version Documentation
This content follows the TrueNAS SCALE 23.10 (Cobia) releases. Use the Product and Version selectors above to view content specific to different TrueNAS software or major version.

Enclosure

  3 minute read.

Last Modified 2024-03-19 08:38 EDT

The SCALE CLI guide is a work in progress! New namespace and command documentation is continually added and maintained, so check back here often to see what is new!

Enclosure Commands

The enclosure namespace has four commands and is based on functions found in the SCALE API and web UI. It provides access to enclosure management methods through the four enclosure commands.

You can enter commands from the main CLI prompt or from the enclosure namespace prompt.

Get_Instance Command

The get_instance command displays the status of a specified enclosure.

The get_instance command only requires the id option. Command returns a table of values when entered correctly.

From the CLI prompt, enter:

enclosure get_instance id=name

From the enclosure prompt, enter:

get_instance id=name

If there are variables in the command include this section: Where:

  • id is the enclosure id. For example, mapped_enclosure_0.
get_instance id=mapped_enclosure_0
+------------+--------------------+
|         id | mapped_enclosure_0 |
|       name | Drive Bays         |
|      model | R40                |
| controller | true               |
|   elements | <list>             |
|     number | 0                  |
|      label | Drive_Bays         |
+------------+--------------------+

Query Command

The query command lists all enclosures in the system.

The query command has no additional requirements. After entering the command, it returns a table with multiple outputs.

From the CLI prompt, enter:

enclosure query

From the service prompt, enter:

query

enclosure> query
+--------------------+------------+-------+------------+----------+--------+------------+
| id                 | name       | model | controller | elements | number | label      |
+----+---------------+------------+-------+------------+----------+--------+------------+
| mapped_enclosure_0 | Drive Bays | R40   | true       | <list>   | 0      | Drive_Bays |
+--------------------+------------+-------+------------+----------+--------+------------+

Set_Slot_Status Command

The set_slot_status command forces a drive slot into a specified state.

The set_slot_status command has three required options, enclosure_id, slot, and status to include in the command string. Command returns an empty line when entered correctly.

From the CLI prompt, enter:

enclosure set_slot_status enclosure_id=idofenclosure slot=number status=STATUS

From the enclosure prompt, enter:

set_slot_status enclosure_id=idofenclosure slot=number status=IDENTIFY/FAULT/CLEAR

Where:

  • enclosure_id is the enclosure id. For example, mapped_enclosure_0.

  • slot is the drive slot number. For example, to change the status of the virst drive in the system, enter 1.

  • status is the state you want to place the drive slot in. Options are IDENTIFY, FAULT, and CLEAR.

set_slot_status enclosure_id=mapped_enclosure_0 slot=1 status=IDENTIFY

Update Command

The update command lets you change the label in a specified enclosure. After entering the command, it returns a table with multiple outputs.

The update command has two required options, id, and label to include in the command string. Command returns an empty line when entered correctly.

From the CLI prompt, enter:

enclosure update id=idofenclosure label=string

From the enclosure prompt, enter:

update id=idofenclosure label=string

Where:

  • id is the enclosure id. For example, mapped_enclosure_0.

  • label is the new name you want to give the label. For example, Front_Drive_Bays.

update id=mapped_enclosure_0 label=Front_Drive_Bays

Related CLI Storage Articles

Related Enclosure Articles

Related Disks Articles