API Doc
Search Docs...
⌘ K
OverviewDeploymentManagementOperationReferenceGlossary

Managing iSCSI LUNs

Viewing iSCSI LUN information

This section introduces different ways to view iSCSI LUN information.

Procedure

  • View the iSCSI LUN with the specified ID

    Run the following command on any node in the cluster:

    zbs-iscsi lun show [--all] <target_name> <lun_id>

  • View the iSCSI LUN with the specified name

    Run the following command on any node in the cluster:

    zbs-iscsi lun show_by_name <target_name> <lun_name>

  • View the iSCSI LUN with the specified UUID

    Run the following command on any node in the cluster:

    zbs-iscsi lun show_target_and_lun_by_uuid <lun_uuid>

  • View the iSCSI LUN with the specified secondary ID

    Run the following command on any node in the cluster:

    zbs-iscsi lun show_target_and_lun_by_secondary_id <secondary_id>

  • View all LUNs under an iSCSI target

    Run the following command on any node in the cluster:

    zbs-iscsi lun list <target_name>

Parameter description

ParameterDescription
[--all]Optional. Displays all LUN parameters.
<target_name>Required. The name of the target to which the LUN belongs.
<lun_id>Required. The LUN ID to view.
<lun_name>Required. The LUN name to view.
<lun_uuid>Required. The LUN volume ID to view.
<secondary_id>Required. The LUN secondary ID to view.

Output example

----------------------  ------------------------------------
LUN Id                  1
LUN Name                260246de-86f6-4c56-ba82-f409e17f388b
Size                    10.00 GiB
Perf Unique Size        In Process
Perf Shared Size        In Process
Cap Unique Size         In Process
Cap Shared Size         In Process
Logical Used Size       In Process
Volume id               260246de-86f6-4c56-ba82-f409e17f388b
Resiliency Type         RT_REPLICA
Encrypt Method          ENCRYPT_PLAIN_TEXT
Encrypt Metadata Id     0
Replica Num             2
EC Param
Thin Provision          True
Creation Time           2025-07-07 09:54:03.247136154
Description
NAA                     33c4d6f6aded64206
Allowed Initiators
Single Access           False
PR                      Details
Prefer CID              0
Read Only               False
Secondary ID
Is Prioritized          False
Downgraded PRS          0.00 B
Chunk Instances
Labels                  []
Use Host                True
Allowed Host Ids
Allowed Host Group Ids
----------------------  ------------------------------------

Output note

ParameterDescription
SizeThe total LUN capacity.
Perf Unique SizeThe exclusive space occupied in the performance tier.
Perf Shared SizeThe performance tier space shared with other objects.
Cap Unique SizeThe exclusive space occupied in the capacity tier.
Cap Shared SizeThe capacity tier space shared with other objects.
Logical Used SizeThe allocated logical space.
Resiliency TypeThe redundancy mode.
Encrypt MethodThe data encryption algorithm of the volume.
Encrypt Metadata IdThe encryption metadata ID of the volume.
Replica NumThe replication factor.
EC ParamThe EC parameters in EC redundancy mode.
Thin ProvisionWhether thin provisioning is enabled. True = thin provisioning is enabled; False = thin provisioning is disabled, and the storage policy is thick provisioning.
NAAThe NAA ID.
Allowed InitiatorsThe LUN-level initiator allowlist.
Single AccessWhether single access is enabled. If enabled, the volume can be accessed by only one client.
PRThe persistent reservation information.
Is PrioritizedWhether all data is kept in the performance tier.
Downgraded PRSThe space not yet promoted to the performance tier.
Use HostWhether to use the allowlist specified by client hosts.
Allowed Host IdsIDs of the associated client hosts.
Allowed Host Group IdsIDs of the associated client host groups.

Creating an iSCSI LUN

Procedure

Run the following command on any node in the cluster:

zbs-iscsi lun create <target_name> <lun_id> <size>
                     [--lun_name <LUN_NAME>] [--lun_uuid <LUN_UUID>]
                     [--resiliency_type <RESILIENCY_TYPE>]
                     [--replica_num <REPLICA_NUM>] [--ec_algo <EC_ALGO>]
                     [--ec_k <EC_K>] [--ec_m <EC_M>][--ec_block_size <EC_BLOCK_SIZE>]
                     [--encrypt_method <ENCRYPT_METHOD>]
                     [--thin_provision <THIN_PROVISION>] [--desc <DESC>]
                     [--stripe_num <STRIPE_NUM>] [--stripe_size <STRIPE_SIZE>]
                     [--iops <IOPS>] [--iops_rd <IOPS_RD>]
                     [--iops_wr <IOPS_WR>] [--iops_max <IOPS_MAX>]
                     [--iops_rd_max <IOPS_RD_MAX>] [--iops_wr_max <IOPS_WR_MAX>]
                     [--iops_max_length <IOPS_MAX_LENGTH>]
                     [--iops_rd_max_length <IOPS_RD_MAX_LENGTH>]
                     [--iops_wr_max_length <IOPS_WR_MAX_LENGTH>]
                     [--iops_io_size <IOPS_IO_SIZE>] [--bps <BPS>] [--bps_rd <BPS_RD>]
                     [--bps_wr <BPS_WR>]
                     [--bps_max <BPS_MAX>] [--bps_rd_max <BPS_RD_MAX>]
                     [--bps_wr_max <BPS_WR_MAX>] [--bps_max_length <BPS_MAX_LENGTH>]
                     [--bps_rd_max_length <BPS_RD_MAX_LENGTH>]
                     [--bps_wr_max_length <BPS_WR_MAX_LENGTH>]
                     [--allowed_initiators <ALLOWED_INITIATORS>]
                     [--preferred_cid <PREFERRED_CID>]
                     [--single_access <SINGLE_ACCESS>] [--prioritized <PRIORITIZED>]
                     [--use_host <USE_HOST>] [--allowed_host_ids <ALLOWED_HOST_IDS>]
                     [--allowed_host_group_ids <ALLOWED_HOST_GROUP_IDS>]
ParameterDescription
target_nameThe name of the target to which the LUN belongs.
lun_id The LUN ID.
sizeThe LUN size.
--lun_name <LUN_NAME>The new LUN name.
--lun_uuid <LUN_UUID>The new LUN UUID.
--resiliency_type <RESILIENCY_TYPE>Specifies the redundancy mode, either REPLICA (replication) or EC (erasure coding). If not specified, the value is inherited from the target. Default: None.
--replica_num <REPLICA_NUM>Specifies the default replication factor for the new LUN. Valid values: 2 or 3. Default: None.
--ec_algo <EC_ALGO>Specifies the EC algorithm. Required when the redundancy mode is EC. Default: RS.
--ec_k <EC_K>Specifies EC parameter K, valid range [2, 23]. Required when the redundancy mode is EC. Default: None.
--ec_m <EC_M>Specifies EC parameter M, valid range [1, 4]. Required when the redundancy mode is EC. Default: None.
--ec_block_size <EC_BLOCK_SIZE>Default: 4096 if EC mode, otherwise None.
--encrypt_method <ENCRYPT_METHOD>Specifies the data encryption method. The default is no encryption.
--thin_provision <THIN_PROVISION>Whether the new LUN are thin-provisioned. Valid values: True or False.
--desc <DESC> Specifies the LUN description.
--stripe_num <STRIPE_NUM>The number of stripes for the new LUN.
--stripe_size <STRIPE_SIZE>The stripe size for the new LUN.
--iops <IOPS>Specifies the total IOPS limit for the new LUN.
--iops_rd <IOPS_RD>Specifies the read IOPS limit.
--iops_wr <IOPS_WR>Specifies the write IOPS limit.
--iops_max <IOPS_MAX>Specifies the total IOPS burst upper limit.
--iops_rd_max <IOPS_RD_MAX>Specifies the read IOPS burst upper limit.
--iops_wr_max <IOPS_WR_MAX>Specifies the write IOPS burst upper limit.
--iops_max_length <IOPS_MAX_LENGTH>Specifies the duration for total IOPS burst upper limit. The unit: seconds.
--iops_rd_max_length <IOPS_RD_MAX_LENGTH>Specifies the duration for read IOPS burst upper limit. The unit: seconds.
--iops_wr_max_length <IOPS_WR_MAX_LENGTH>Specifies the duration for write IOPS burst upper limit. The unit: seconds.
--iops_io_size <IOPS_IO_SIZE>The assumed average I/O data size when using IOPS throttling.
--bps <BPS>Specifies the total bandwidth limit for the new LUN. The unit: bps.
--bps_rd <BPS_RD>Specifies the read bandwidth limit.
--bps_wr <BPS_WR>Specifies the write bandwidth limit.
--bps_max <BPS_MAX>Specifies the total bandwidth upper limit during I/O bursts.
--bps_rd_max <BPS_RD_MAX> Specifies the read bandwidth upper limit during I/O bursts.
--bps_wr_max <BPS_WR_MAX>Specifies the write bandwidth upper limit during I/O bursts.
--bps_max_length <BPS_MAX_LENGTH>Specifies the maximum duration for I/O at the total bandwidth during I/O bursts. The unit: seconds.
--bps_rd_max_length <BPS_RD_MAX_LENGTH>Specifies the maximum duration for I/O at the read bandwidth during I/O bursts. The unit: seconds.
--bps_wr_max_length <BPS_WR_MAX_LENGTH>Specifies the maximum duration for I/O at the write bandwidth during I/O bursts. The unit: seconds.
--allowed_initiators <ALLOWED_INITIATORS>Specifies the IQN allowlist for the new LUN.
--preferred_cid <PREFERRED_CID>Specifies the preferred chunk ID. Meta prioritizes proximity to this Chunk when allocating PExtent replicas.
--single_access <SINGLE_ACCESS>Valid values: True or False. True = only one initiator can access the LUN, and the LUN IQN allowlist must be empty or contain a single IQN.
--prioritized <PRIORITIZED>Specifies whether all LUN data should remain in the performance tier. Valid values: True or False.
--use_host <USE_HOST>Whether to use the allowlist specified by client hosts.
--allowed_host_ids <ALLOWED_HOST_IDS>Specifies the IDs of associated client hosts. Multiple IDs must be separated by commas (,).
--allowed_host_group_ids <ALLOWED_HOST_GROUP_IDS>Specifies the IDs of associated client host groups. Multiple IDs must be separated by commas (,).

Output example

----------------------  ------------------------------------
LUN Id                  1
LUN Name                260246de-86f6-4c56-ba82-f409e17f388b
Size                    10.00 GiB
Perf Unique Size        In Process
Perf Shared Size        In Process
Cap Unique Size         In Process
Cap Shared Size         In Process
Logical Used Size       In Process
Volume id               260246de-86f6-4c56-ba82-f409e17f388b
Resiliency Type         RT_REPLICA
Encrypt Method          ENCRYPT_PLAIN_TEXT
Encrypt Metadata Id     0
Replica Num             2
EC Param
Thin Provision          True
Creation Time           2025-07-07 09:54:03.247136154
Description
NAA                     33c4d6f6aded64206
Allowed Initiators
Single Access           False
PR                      Details
Prefer CID              0
Read Only               False
Secondary ID
Is Prioritized          False
Downgraded PRS          0.00 B
Chunk Instances
Labels                  []
Use Host                True
Allowed Host Ids
Allowed Host Group Ids
----------------------  ------------------------------------

Increasing iSCSI LUN replication factor and expanding LUN capacity

Procedure

Run the following command on a cluster node:

zbs-iscsi lun update <target_name> <lun_id> [--replica_num <REPLICA_NUM>][--new_name <NEW_NAME>] [--desc <DESC>] [--size <SIZE>]

ParameterDescription
target_nameThe name of the target to which the LUN belongs.
lun_idThe LUN ID.
--replica_num <REPLICA_NUM>Updates the LUN replication factor. Only increases are supported; decreases are not allowed.
--new_name <NEW_NAME>Specifies a new name for the LUN.
--desc <DESC>Specifies the LUN description.
--size <SIZE>Adjusts the LUN size. The new size cannot be smaller than the current size; otherwise, an error occurs. Only expansion is supported.

Output example

----------------------  ------------------------------------
LUN Id                  1
LUN Name                260246de-86f6-4c56-ba82-f409e17f388b
Size                    10.00 GiB
Perf Unique Size        0.00 B
Perf Shared Size        0.00 B
Cap Unique Size         0.00 B
Cap Shared Size         0.00 B
Logical Used Size       0.00 B
Volume id               260246de-86f6-4c56-ba82-f409e17f388b
Resiliency Type         RT_REPLICA
Encrypt Method          ENCRYPT_PLAIN_TEXT
Encrypt Metadata Id     0
Replica Num             2
EC Param
Thin Provision          True
Creation Time           2025-07-07 09:54:03.247136154
Description             new-desc
NAA                     33c4d6f6aded64206
Allowed Initiators
Single Access           False
PR                      Details
Prefer CID              0
Read Only               False
Secondary ID
Is Prioritized          False
Downgraded PRS          0.00 B
Chunk Instances
Labels                  []
Use Host                True
Allowed Host Ids
Allowed Host Group Ids
----------------------  ------------------------------------

Cloning an iSCSI LUN

Procedure

Run the following command on any node in the cluster to clone an iSCSI LUN:

zbs-iscsi lun clone [--lun_name <LUN_NAME>] [--src_target_name <SRC_TARGET_NAME>] [--src_lun_id <SRC_LUN_ID>] [--src_snapshot_id <SRC_SNAPSHOT_ID>] <dst_target_name> <dst_lun_id>

ParameterDescription
--lun_name <LUN_NAME>The name of the cloned LUN.
--src_target_name <SRC_TARGET_NAME>The source target name to clone from.
--src_lun_id <SRC_LUN_ID>The source LUN ID to clone from.
--src_snapshot_id <SRC_SNAPSHOT_ID>The source snapshot ID to clone from. If both the source LUN ID and source snapshot ID are specified, the source snapshot ID will be used as the clone source.
dst_target_nameThe target to which the cloned LUN belongs.
dst_lun_idThe ID of the cloned LUN.

Output example

[root@host-3 16:21:32 ~]$ zbs-iscsi lun clone --src_target_name t1 --src_lun_id 1 t2 1
----------------------  ------------------------------------
LUN Id                  1
LUN Name                50341729-faf6-4315-b7e9-b17bb7163010
Size                    10.00 GiB
Perf Unique Size        In Process
Perf Shared Size        In Process
Cap Unique Size         In Process
Cap Shared Size         In Process
Logical Used Size       In Process
Volume id               50341729-faf6-4315-b7e9-b17bb7163010
Resiliency Type         RT_REPLICA
Encrypt Method          ENCRYPT_PLAIN_TEXT
Encrypt Metadata Id     0
Replica Num             2
EC Param
Thin Provision          True
Creation Time           2025-07-07 10:08:49.433888331
Description
NAA                     3334d6fafd9271430
Allowed Initiators      */*
Single Access           False
PR                      Details
Prefer CID              0
Read Only               False
Secondary ID
Is Prioritized          False
Downgraded PRS          0.00 B
Chunk Instances
Labels                  []
Use Host                False
Allowed Host Ids
Allowed Host Group Ids
----------------------  ------------------------------------

Moving an iSCSI LUN to another iSCSI target

Procedure

Run the following command on any cluster node to move a LUN from its current target to another target:

zbs-iscsi lun move <src_target_name> <src_lun_id> <target_name> <lun_id> <lun_name>

ParameterDescription
src_target_nameThe source target to which the LUN belongs.
src_lun_idThe ID of the LUN to move.
target_nameThe destination target to which the LUN will be moved.
lun_idThe LUN ID after moving to the new target.
lun_nameThe LUN name after moving to the new target.

Output example

----------------------  ------------------------------------
LUN Id                  1
LUN Name                50341729-faf6-4315-b7e9-b17bb7163010
Size                    10.00 GiB
Perf Unique Size        In Process
Perf Shared Size        In Process
Cap Unique Size         In Process
Cap Shared Size         In Process
Logical Used Size       In Process
Volume id               50341729-faf6-4315-b7e9-b17bb7163010
Resiliency Type         RT_REPLICA
Encrypt Method          ENCRYPT_PLAIN_TEXT
Encrypt Metadata Id     0
Replica Num             2
EC Param
Thin Provision          True
Creation Time           2025-07-07 10:08:49.433888331
Description
NAA                     3334d6fafd9271430
Allowed Initiators      */*
Single Access           False
PR                      Details
Prefer CID              0
Read Only               False
Secondary ID
Is Prioritized          False
Downgraded PRS          0.00 B
Chunk Instances
Labels                  []
Use Host                False
Allowed Host Ids
Allowed Host Group Ids
----------------------  ------------------------------------

Adding client IQNs to the iSCSI LUN allowlist

Procedure

Run the following command on any cluster node to add client IQNs to the allowlist for accessing an iSCSI LUN:

zbs-iscsi lun add_allowed_initiators <target_name> <lun_id> <new_allowed_initiators>

ParameterDescription
target_nameThe name of the iSCSI target to which the LUN belongs.
lun_idThe LUN ID.
new_allowed_initiatorsThe client IQNs to add to the LUN allowlist. Separate multiple IQNs with commas (,), e.g., iqn.1994-05.com.redhat:d422cf1e7f5,iqn.1994-05.com.redhat:1.

Output note

If the command succeeds, no output is displayed.

Removing client IQNs from the iSCSI LUN allowlist

Procedure

Run the following command on any cluster node to remove client IQNs from the iSCSI LUN allowlist:

zbs-iscsi lun remove_allowed_initiators <target_name> <lun_id> <initiators>

ParameterDescription
target_nameThe name of the iSCSI target to which the LUN belongs.
lun_idThe LUN ID.
initiatorsThe client IQNs to remove from the LUN allowlist. Separate multiple clients with commas (,), e.g., iqn.1994-05.com.redhat:d422cf1e7f5, iqn.1994-05.com.redhat:1.

Output note

If the command succeeds, no output is displayed.

Deleting an iSCSI LUN

Procedure

Run the following command on any node in the cluster to delete the specified LUN under an iSCSI target:

zbs-iscsi lun delete <target_name> <lun_id>

Output note

If the command succeeds, no output is displayed.

Clearing the persistent reservation information about iSCSI LUNs

Clearing the persistent reservation information for a LUN in case of leftover PRs or unwanted registrants.

Procedure

Run the following command on any node in the cluster:

zbs-iscsi lun reset_pr <target_name> <lun_id>

Output note

If the command succeeds, no output is displayed.

Converting iSCSI LUNs to NFS files

Procedure

Run the following command on any node in the cluster:

zbs-nfs file convert_from_lun <parent_id> <name> <lun_uuid> [--mode MODE] [--uid UID] [--gid GID] [--atime_how <ATIME_HOW>] [--mtime_how <MTIME_HOW>] [--atime_sec <ATIME_SEC>] [--atime_nsec <ATIME_NSEC>] [--mtime_sec <MTIME_SEC>] [--mtime_nsec <MTIME_NSEC>]

ParameterDescription
parent_idThe directory ID of the inode file.
nameThe name of the inode file.
lun_uuidThe UUID of the LUN to be converted.
--mode MODERead/write permission settings for the file.
--atime_how <ATIME_HOW>Specifies the source for the file's access time. SET_TO_SERVER_TIME: The access time is set to the NFS file server's time. SET_TO_CLIENT_TIME: The access time is set to the client's time. DONT_CHANGE: The access time remains unchanged (default).
--atime_sec <ATIME_SEC>Specifies the access time. The unit: seconds (s).
--atime_nsec <ATIME_NSEC>Specifies the access time. The unit: nanoseconds (ns).
--mtime_how <MTIME_HOW>Specifies the source for the file's modification time. SET_TO_SERVER_TIME: The modification time is set to the NFS file server's time. SET_TO_CLIENT_TIME: The modification time is set to the client's time. DONT_CHANGE: The modification time remains unchanged (default).
--mtime_sec <MTIME_SEC>Specifies the modification time. The unit: seconds (s).
--mtime_nsec <MTIME_NSEC>Specifies the modification time. The unit: nanoseconds (ns).

Output example

-----------------  ------------------------------------
id                 9ab2f518-0947-4bd3
name               nfs5
pool               f6722181-7eb8-4ab4-ac39-7a06d29f6890
preallocate        False
volume             9ab2f518-0947-4bd3-b8b3-984e1a2d634f
type               FILE
mode               432
uid                0
gid                0
size               1024.00 GiB
perf unique size   In Process
perf shared size   In Process
cap unique size    In Process
cap shared size    In Process
logical used size  In Process
prioritized        False
downgraded_prs     0.00 B
-----------------  ------------------------------------