# iscsi.target.create

Create an iSCSI Target.

groups is a list of group dictionaries which provide information related to using a portal, initiator, authmethod and auth with this target. auth represents a valid iSCSI Authorized Access and defaults to null.

auth_networks is a list of IP/CIDR addresses which are allowed to use this initiator. If all networks are to be allowed, this field should be left empty.

Type: object

##

Type: array
No Additional Items

#### Tuple Validation

##### Parameter 1: iscsi_target_create

#### iscsi_target_create

Type: object

iSCSI target configuration data for creation.

No Additional Properties

##

#### Name

Type: string

Name of the iSCSI target (maximum 120 characters).

Must be at least `1` characters long

Must be at most `120` characters long

##

#### Alias

Default: null

Optional alias name for the iSCSI target.

## Any of

Type: string
Type: null

##

#### Mode

Type: enum (of string) Default: "ISCSI"

Protocol mode for the target.

- `ISCSI`: iSCSI protocol only
- `FC`: Fibre Channel protocol only
- `BOTH`: Both iSCSI and Fibre Channel protocols

Fibre Channel may only be selected on TrueNAS Enterprise-licensed systems with a suitable Fibre Channel HBA.

##### Must be one of:

- "ISCSI"
- "FC"
- "BOTH"

##

#### Groups

Type: array of object Default: []

Array of portal-initiator group associations for this target.

No Additional Items

##### Each item of this array must be:

#### IscsiGroup

Type: object
No Additional Properties

##

#### Portal

Type: integer

ID of the iSCSI portal to use for this target group.

##

#### Initiator

Default: null

ID of the authorized initiator group or `null` to allow any initiator.

## Any of

Type: integer
Type: null

##

#### Authmethod

Type: enum (of string) Default: "NONE"

Authentication method for this target group.

##### Must be one of:

- "NONE"
- "CHAP"
- "CHAP_MUTUAL"

##

#### Auth

Default: null

ID of the authentication credential or `null` if no authentication.

## Any of

Type: integer
Type: null

##

#### Auth Networks

Type: array of string Default: []

Array of network addresses allowed to access this target.

No Additional Items

##### Each item of this array must be:

Type: string

##

Default: null

Optional iSCSI-specific parameters for this target.

## Any of

#### IscsiTargetParameters

Type: object
No Additional Properties

##

#### Queuedcommands

Default: null

Maximum number of queued commands per iSCSI session.

- `32`: Standard queue depth for most use cases
- `128`: Higher queue depth for performance-critical applications

## Any of

Type: enum (of integer)

##### Must be one of:

- 32
- 128

Type: null
Type: null

##

#### iSCSITargetEntry

Type: object

The created iSCSI target configuration.

No Additional Properties

##

#### Id

Type: integer

Unique identifier for the iSCSI target.

##

#### Name

Type: string

Name of the iSCSI target (maximum 120 characters).

Must be at least `1` characters long

Must be at most `120` characters long

##

#### Alias

Default: null

Optional alias name for the iSCSI target.

## Any of

Type: string
Type: null

##

#### Mode

Type: enum (of string) Default: "ISCSI"

Protocol mode for the target.

- `ISCSI`: iSCSI protocol only
- `FC`: Fibre Channel protocol only
- `BOTH`: Both iSCSI and Fibre Channel protocols

Fibre Channel may only be selected on TrueNAS Enterprise-licensed systems with a suitable Fibre Channel HBA.

##### Must be one of:

- "ISCSI"
- "FC"
- "BOTH"

##

#### Groups

Type: array of object Default: []

Array of portal-initiator group associations for this target.

No Additional Items

##### Each item of this array must be:

#### IscsiGroup

Type: object
No Additional Properties

##

#### Portal

Type: integer

ID of the iSCSI portal to use for this target group.

##

#### Initiator

Default: null

ID of the authorized initiator group or `null` to allow any initiator.

## Any of

Type: integer
Type: null

##

#### Authmethod

Type: enum (of string) Default: "NONE"

Authentication method for this target group.

##### Must be one of:

- "NONE"
- "CHAP"
- "CHAP_MUTUAL"

##

#### Auth

Default: null

ID of the authentication credential or `null` if no authentication.

## Any of

Type: integer
Type: null

##

#### Auth Networks

Type: array of string Default: []

Array of network addresses allowed to access this target.

No Additional Items

##### Each item of this array must be:

Type: string

##

#### Rel Tgt Id

Type: integer

Relative target ID number assigned by the system.

##

Default: null

Optional iSCSI-specific parameters for this target.

## Any of

#### IscsiTargetParameters

Type: object
No Additional Properties

##

#### Queuedcommands

Default: null

Maximum number of queued commands per iSCSI session.

- `32`: Standard queue depth for most use cases
- `128`: Higher queue depth for performance-critical applications

## Any of

Type: enum (of integer)

##### Must be one of:

- 32
- 128

Type: null
Type: null

Required roles: SHARING_ISCSI_TARGET_WRITE