./stor target ls [ -c | --connection ] [ { -n | --name } TARGET_NAME ]
此命令用来查询iSCSI target信息。
参数
参数 | 描述 |
---|---|
-c 或 --connection | 查询iSCSI target连接。 |
-n TARGET_NAME 或 --name TARGET_NAME | 查询指定iSCSI target的信息。 |
示例
示例1
查询HBlock服务中所有iSCSI target信息
[root@hblockserver CTYUN_HBlock_Plus_3.10.0_x64]# ./stor target ls
+-----+--------------------+--------------+-------------------------------------------------------------+---------------+
| No. | Target Name | Max Sessions | iSCSI Target | CHAP |
+-----+--------------------+--------------+-------------------------------------------------------------+---------------+
| 1. | target01 | 1 | iqn.2012-08.cn.ctyunapi.oos:target01.3(192.168.0.117:3260) | test,Disabled |
| | | | iqn.2012-08.cn.ctyunapi.oos:target01.4(192.168.0.102:3260) | |
| 2. | target02 | 1 | iqn.2012-08.cn.ctyunapi.oos:target02.5(192.168.0.192:3260) | Disabled |
| | | | iqn.2012-08.cn.ctyunapi.oos:target02.6(192.168.0.117:3260) | |
| 3. | target03 | 1 | iqn.2012-08.cn.ctyunapi.oos:target03.7(192.168.0.192:3260) | Disabled |
| | | | iqn.2012-08.cn.ctyunapi.oos:target03.8(192.168.0.102:3260) | |
| 4. | target05(Deleting) | 1 | iqn.2012-08.cn.ctyunapi.oos:target05.9(192.168.0.117:3260) | Disabled |
| | | | iqn.2012-08.cn.ctyunapi.oos:target05.10(192.168.0.192:3260) | |
| 5. | tg001 | 2 | iqn.2012-08.cn.ctyunapi.oos:tg001.1(192.168.0.117:3260) | Disabled |
| | | | iqn.2012-08.cn.ctyunapi.oos:tg001.2(192.168.0.192:3260) | |
+-----+--------------------+--------------+-------------------------------------------------------------+---------------+
项目 | 描述 |
---|---|
No. | 序号。 |
Target Name | iSCSI tTarget名称。 说明 如果iSCSI target处于删除中,iSCSI target名称后面会显示“Deleting”。 |
Max Sessions | iSCSI target下每个IQN允许建立的最大会话数。 |
ISCSI Target | iSCSI target IQN、IP和端口号。 |
CHAP | CHAP认证信息,包含CHAP名称、CHAP密码、CHAP状态。 只有配置了CHAP认证信息,才会显示CHAP名称。 CHAP状态:
|
示例2
单机版:查询iSCSI target名称为targeta的信息。
[root@hblockserver CTYUN_HBlock_Plus_3.10.0_x64]# ./stor target ls -n targeta
Target Name: targeta
Max Sessions: 3
Create Time: 2025-07-22 16:18:57
iSCSI Target: iqn.2012-08.cn.ctyunapi.oos:targeta.1 (192.168.0.66:3260)
LUN: luna1 (LUN 0),luna2 (LUN 1),luna3 (LUN 2)
Reclaim Policy: Delete
CHAP: chanptest,Hblockhblock,Disabled
Allowlist for iqn.2012-08.cn.ctyunapi.oos:targeta.1 (192.168.0.66:3260):
Initiator allowlist:
+-----+--------------+-------+
| No. | IPs | Names |
+-----+--------------+-------+
| 1. | 192.168.0.68 | |
| 2. | 192.168.0.70 | |
+-----+--------------+-------+
Target allowlist:
+-----+--------------+------+
| No. | IPs | NICs |
+-----+--------------+------+
| 1. | 192.168.0.66 | |
+-----+--------------+------+
集群版:查询iSCSI target名称为target03的信息。
[root@hblockserver CTYUN_HBlock_Plus_3.10.0_x64]# ./stor target ls -n target03
Target Name: target03
Max Sessions: 1
Create Time: 2025-07-10 09:42:00
Number of Servers: 2
iSCSI Target: iqn.2012-08.cn.ctyunapi.oos:target03.5 (192.168.0.64:3260)
iqn.2012-08.cn.ctyunapi.oos:target03.6 (192.168.0.65:3260)
LUN: lun03a (LUN 0),lun03b (LUN 1)
Reclaim Policy: Delete
CHAP: chap-test,Hblockhblock,Disabled
Server ID: hblock_1,hblock_2
Allowlist for iqn.2012-08.cn.ctyunapi.oos:target03.5 (192.168.0.64:3260):
Initiator allowlist:
+-----+--------------+--------------------------------------+
| No. | IPs | Names |
+-----+--------------+--------------------------------------+
| 1. | 192.168.0.70 | iqn.1991-05.com.microsoft:songt-0001 |
| 2. | 192.168.0.66 | |
+-----+--------------+--------------------------------------+
Target allowlist:
+-----+--------------+------+
| No. | IPs | NICs |
+-----+--------------+------+
| 1. | 192.168.0.64 | |
| 2. | 192.168.0.65 | |
| 3. | 192.168.0.67 | |
+-----+--------------+------+
Allowlist for iqn.2012-08.cn.ctyunapi.oos:target03.6 (192.168.0.65:3260):
Initiator allowlist:
+-----+--------------+--------------------------------------+
| No. | IPs | Names |
+-----+--------------+--------------------------------------+
| 1. | 192.168.0.70 | iqn.1991-05.com.microsoft:songt-0001 |
| 2. | 192.168.0.66 | |
+-----+--------------+--------------------------------------+
Target allowlist:
+-----+--------------+------+
| No. | IPs | NICs |
+-----+--------------+------+
| 1. | 192.168.0.64 | |
| 2. | 192.168.0.65 | |
| 3. | 192.168.0.67 | |
+-----+--------------+------+
项目 | 描述 |
---|---|
Target Name | iSCSI target名称。 |
Status | iSCSI target的状态:
仅iSCSI target处于删除中会返回此项。 |
Max Sessions | iSCSI target下每个IQN允许建立的最大会话数。 |
Create Time | iSCSI target创建时间。 |
Number of Servers | iSCSI target所在的服务器数量(仅集群版支持)。 |
iSCSI Target | iSCSI target IQN、客户端 IP和端口号。 |
LUN | iSCSI target对应的卷。括号内容表示卷编号。 |
Reclaim Policy | iSCSI target的回收策略:
|
CHAP | CHAP认证信息,包含CHAP名称、CHAP密码、CHAP状态。 说明 只有配置了CHAP认证信息,才会显示CHAP名称。 CHAP状态:
|
ServerID | iSCSI target对应的服务器ID(仅集群版支持)。 |
Initiator allowlist | iSCSI发起方(initiator)允许访问列表。
|
Target allowlist | 目标端(target)允许访问列表。
|
示例3
查询iSCSI Target连接信息。
[root@hblockserver CTYUN_HBlock_Plus_3.10.0_x64]# ./stor target ls -c
+-----------+----------------------------------------+---------------+--------------------------------------------+---------------+-------------+
| SessionId | Target IQN | Target IP | Initiator name | Client IP | Client Port |
+-----------+----------------------------------------+---------------+--------------------------------------------+---------------+-------------+
| 0x8 | iqn.2012-08.cn.ctyunapi.oos:target01.3 | 192.168.0.102 | iqn.1991-05.com.microsoft:ecs-e16f-0915299 | 192.168.0.116 | 61314 |
| 0x3 | iqn.2012-08.cn.ctyunapi.oos:target01.4 | 192.168.0.192 | iqn.1991-05.com.microsoft:ecs-e16f-0915299 | 192.168.0.116 | 61416 |
| 0x2 | iqn.2012-08.cn.ctyunapi.oos:target03.5 | 192.168.0.192 | iqn.1994-05.com.redhat:ca375039f35f | 127.0.0.1 | 58978 |
| 0x1 | iqn.2012-08.cn.ctyunapi.oos:target1.1 | 192.168.0.192 | iqn.1994-05.com.redhat:ca375039f35f | 127.0.0.1 | 58976 |
+-----------+----------------------------------------+---------------+--------------------------------------------+---------------+-------------+
项目 | 描述 |
---|---|
SessionId | iSCSI会话ID。 |
Target IQN | iSCSI target IQN。 |
Target IP | iSCSI target 对应的IP。 |
Initiator name | 连接所属的intiator名称。 |
Client IP | 客户端IP。 |
Client Port | 客户端端口号。 |
示例4
查询target02的iSCSI target连接信息。
[root@hblockserver CTYUN_HBlock_Plus_3.10.0_x64]# ./stor target ls -c -n target02
+-----------+----------------------------------------+---------------+------------------------------------+--------------+-------------+
| SessionId | Target IQN | Target IP | Initiator name | Client IP | Client Port |
+-----------+----------------------------------------+---------------+------------------------------------+--------------+-------------+
| 0x5 | iqn.2012-08.cn.ctyunapi.oos:target02.7 | 192.168.0.121 | iqn.1991-05.com.microsoft:ecs-28f3 | 192.168.0.46 | 52594 |
| 0x7 | iqn.2012-08.cn.ctyunapi.oos:target02.8 | 192.168.0.72 | iqn.1991-05.com.microsoft:ecs-28f3 | 192.168.0.46 | 52795 |
+-----------+----------------------------------------+---------------+------------------------------------+--------------+-------------+
项目 | 描述 |
---|---|
SessionId | iSCSI会话ID。 |
Target IQN | iSCSI target IQN。 |
Target IP | iSCSI target对应的IP。 |
Initiator name | 连接所属的intiator名称。 |
Client IP | 客户端IP。 |
Client Port | 客户端端口号。 |