./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 | 客戶端端口號。 |