./stor target ls [ { -n | --name } TARGET_NAME ] [ { -c | --connection } | --no-connection ]
此命令用来查询iSCSI target信息。
参数
| 参数 | 描述 |
|---|---|
| -n TARGET_NAME 或 --name TARGET_NAME | 查询指定iSCSI target的信息。 |
| -c 或 --connection | 查询iSCSI target连接信息。 |
| --no-connection | 查询iSCSI target未连接信息。 |
示例
示例1
查询HBlock服务中所有iSCSI target信息
[root@hblockserver CTYUN_HBlock_Plus_4.1.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 target名称。 说明 如果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_4.1.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_4.1.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_4.1.0_x64]# ./stor target ls -c
+----------------------------------------+--------------+---------------+------------+--------------------------------------+--------------+-------------+
| Target IQN | Target IP | Session Count | Session ID | Initiator name | Client IP | Client Port |
+----------------------------------------+--------------+---------------+------------+--------------------------------------+--------------+-------------+
| iqn.2012-08.cn.ctyunapi.oos:target01.1 | 192.168.0.67 | 2 | 0x1 | iqn.1991-05.com.microsoft:songt-0001 | 192.168.0.70 | 64057 |
| | | | 0x8c1f | iqn.1991-05.com.microsoft:songt-0008 | 192.168.0.69 | 52637 |
| iqn.2012-08.cn.ctyunapi.oos:target01.2 | 192.168.0.65 | 2 | 0x3 | iqn.1991-05.com.microsoft:songt-0001 | 192.168.0.70 | 64053 |
| | | | 0x22d2 | iqn.1991-05.com.microsoft:songt-0008 | 192.168.0.69 | 52641 |
| iqn.2012-08.cn.ctyunapi.oos:target02.3 | 192.168.0.68 | 1 | 0x208c | iqn.1991-05.com.microsoft:songt-0001 | 192.168.0.70 | 51507 |
| iqn.2012-08.cn.ctyunapi.oos:target02.4 | 192.168.0.64 | 1 | 0x4152 | iqn.1991-05.com.microsoft:songt-0001 | 192.168.0.70 | 51510 |
+----------------------------------------+--------------+---------------+------------+--------------------------------------+--------------+-------------+查询未连接客户端的iSCSI target信息。
[root@hblockserver CTYUN_HBlock_Plus_4.1.0_x64]# ./stor target ls --no-connection
+----------------------------------------+--------------+
| Target IQN | Target IP |
+----------------------------------------+--------------+
| iqn.2012-08.cn.ctyunapi.oos:target03.5 | 192.168.0.64 |
| iqn.2012-08.cn.ctyunapi.oos:target03.6 | 192.168.0.68 |
| iqn.2012-08.cn.ctyunapi.oos:target04.7 | 192.168.0.68 |
| iqn.2012-08.cn.ctyunapi.oos:target04.8 | 192.168.0.64 |
+----------------------------------------+--------------+| 项目 | 描述 |
|---|---|
| SessionId | iSCSI会话ID。 |
| Target IQN | iSCSI target IQN。 |
| Target IP | iSCSI target 对应的IP。 |
| Initiator name | 连接所属的intiator名称。 |
| Client IP | 客户端IP。 |
| Client Port | 客户端端口号。 |
示例4
查询target01的iSCSI target连接信息。
[root@hblockserver CTYUN_HBlock_Plus_4.1.0_x64]# ./stor target ls -c -n target01
+----------------------------------------+--------------+---------------+------------+--------------------------------------+--------------+-------------+
| Target IQN | Target IP | Session Count | Session ID | Initiator name | Client IP | Client Port |
+----------------------------------------+--------------+---------------+------------+--------------------------------------+--------------+-------------+
| iqn.2012-08.cn.ctyunapi.oos:target01.1 | 192.168.0.67 | 2 | 0x1 | iqn.1991-05.com.microsoft:songt-0001 | 192.168.0.70 | 64057 |
| | | | 0x8c1f | iqn.1991-05.com.microsoft:songt-0008 | 192.168.0.69 | 52637 |
| iqn.2012-08.cn.ctyunapi.oos:target01.2 | 192.168.0.65 | 2 | 0x22d2 | iqn.1991-05.com.microsoft:songt-0008 | 192.168.0.69 | 52641 |
| | | | 0x3 | iqn.1991-05.com.microsoft:songt-0001 | 192.168.0.70 | 64053 |
+----------------------------------------+--------------+---------------+------------+--------------------------------------+--------------+-------------+| 项目 | 描述 |
|---|---|
| SessionId | iSCSI会话ID。 |
| Target IQN | iSCSI target IQN。 |
| Target IP | iSCSI target对应的IP。 |
| Initiator name | 连接所属的intiator名称。 |
| Client IP | 客户端IP。 |
| Client Port | 客户端端口号。 |