TrueNAS SCALETrueNAS SCALE Nightly Development Documentation
This content follows experimental early release software. Use the Product and Version selectors above to view content specific to a stable software release.

Enclosure

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.

Using the Get_Instance Command

Description

The get_instance command only requires the id option. Enter the property argument using the = delimiter to separate property and value. Enter the command string then press Enter. Command returns a table of values when entered correctly.

Usage

From the CLI prompt, enter:

storage enclosure get_instance id=name

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

Command Example
storage enclosure 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.

Using the Query Command

Description

The query command has no additional requirements. Enter the command then press Enter. The command returns a table with multiple outputs.

Usage

From the CLI prompt, enter:

storage enclosure query

Command Example
storage 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.

Using the Set_Slot_Status Command

Description

The set_slot_status command has three required options, enclosure_id, slot, and status. enclosure_id is the ID assigned the enclosure and found in the output of the storage enclosure query command. slot is the drive slot number. status is the state you want to place the drive slot in. Options are IDENTIFY, FAULT, and CLEAR. Enter the property arguments using the = delimiter to separate property and value. Enter the command string then press Enter. Command returns an empty line when entered correctly.

Usage

From the CLI prompt, enter:

storage enclosure set_slot_status enclosure_id=idofenclosure slot=number status=CLEAR

Where:

  • idofenclosure is the enclosure id. For example, mapped_enclosure_0.
  • number is the drive slot number. For example, to change the status of the first drive in the system, enter 1.
  • CLEAR is the state you want to place the drive slot in.

Command Example
storage enclosure 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, use to set the drive slot status.

Using the Update Command

Description

The update command has two required options, id, and label. id is the enclosure id found in the output of the storage enclosure query command. For example, mapped_enclosure_0. label is the new name you want to give the label. For example, Front_Drive_Bays. Enter the property argument using the = delimiter to separate property and values. Enter the command string then press Enter. The command returns a table with multiple outputs.

Usage

From the CLI prompt, enter:

storage enclosure update id=idofenclosure label=string

Where:

  • idofenclosure is the enclosure id. For example, mapped_enclosure_0.
  • string is the new name you want to give the label. For example, Front_Drive_Bays.

Command Example
storage enclosure update id=mapped_enclosure_0 label=Front_Drive_Bays