識別 LUN
您想要在計算主機上查閱所連接儲存磁區的 LUN ID 有各種原因。 例如,您可能有多個儲存裝置裝載在具有相同磁區大小的相同主機上。 您想要分離並解除其中一個的任務。 不過,您不確定如何將您在 Linux® 主機上看到的內容與您在主控台中看到的內容產生關聯。 另一個例子可能是,您有多個 Block Storage for Classic 磁碟區連接到 ESXi 伺服器。 您想要擴充其中一個 LUN 的磁區大小,且您需要知道儲存體的正確 LUN ID 才能這麼做。
在 Linux® 中檢視 LUN ID
-
在指令行中,執行
multipath -ll
並查看輸出。root@server:~# multipath -l 3600a098038303845372b4a5232346e35 dm-0 NETAPP ,LUN C-Mode size=12T features='4 queue_if_no_path pg_init_retries 50 retain_attached_hw_handle' hwhandler='1 alua' wp=rw -+- policy='round-robin 0' prio=50 status=active - `1:0:0:0 sdc 8:32 active ready running` 3600a098038304471562b4c4743384332 dm-1 NETAPP ,LUN C-Mode size=12T features='4 queue_if_no_path pg_init_retries 50 retain_attached_hw_handle' hwhandler='1 alua' wp=rw -+- policy='round-robin 0' prio=10 status=active `- 3:0:0:1 sdd 8:48 active ready running`
請注意 "1:0:0:0" 和 "3:0:0:1"。 這些欄位 "1:0:0:0" 和 "3:0:0:1" 中的最後一個數字,"0" 和 "1" 是區塊儲存裝置的 iscsi LUN ID 號碼。
-
輸入下列 ibmcloud cli 指令:
ibmcloud sl block volume-list
及ibmcloud sl block volume-detail
,以將其輸出與您在步驟 1 中收集的資訊進行比較。$ ibmcloud sl block volume-list id username datacenter storage_type capacity_gb bytes_used lunId 20973781 IBM02SEL1575811-1 dal09 endurance_block_storage 100 - 3 22030583 IBM02SEL1575811-3 dal12 endurance_block_storage 20 - 0 23976093 IBM02SEL1575811-4 dal12 performance_block_storage 80 - 1 24024217 IBM02SEL1575811-5 seo01 performance_block_storage 2000 - 2
$ ibmcloud sl block volume-detail 22030583 Name Value ID 22030583 User name IBM02SEL1575811-3 Type endurance_block_storage Capacity (GB) 20 LUN Id 0 Endurance Tier READHEAVY_TIER Endurance Tier Per IOPS 2 Datacenter dal12 Target IP 161.26.110.17 Snapshot Size (GB) 5 Snapshot Used (Bytes) 3325952 # of Active Transactions 0 Replicant Count 0
輸出會顯示儲存裝置的主機名稱、LUN ID 及目標 IP:
IBM02SEL1575811-3 lun id: 0 Target IP: 161.26.110.17 IBM02SEL1575811-4 lun id: 1 Target IP: 161.26.110.43
-
您可以使用下列指令
iscsiadm -m session -P 3
進一步確認此資訊。# iscsiadm -m session -P 3 iSCSI Transport Class version 2.0-870 version 6.2.0.874-7 Target: iqn.1992-08.com.netapp:stfdal1201 (non-flash) Current Portal: 161.26.110.17:3260,1027 # match this target iscsi IP to the block storage device Persistent Portal: 161.26.110.17:3260,1027 ********** Interface: ********** Iface Name: default Iface Transport: tcp Iface Initiatorname: iqn.2018-08.com.ibm:ibm02su1575811-i117305979 Iface IPaddress: 10.74.10.67 Iface HWaddress: <empty> Iface Netdev: <empty> SID: 1 iSCSI Connection State: LOGGED IN iSCSI Session State: LOGGED_IN Internal iscsid Session State: NO CHANGE ********* Timeouts: ********* Recovery Timeout: 5 Target Reset Timeout: 30 LUN Reset Timeout: 30 Abort Timeout: 15 ***** CHAP: ***** username: IBM02SU1575811-I117305979 password: ******** username_in: <empty> password_in: ******** ************************ Negotiated iSCSI params: ************************ HeaderDigest: None DataDigest: None MaxRecvDataSegmentLength: 262144 MaxXmitDataSegmentLength: 65536 FirstBurstLength: 65536 MaxBurstLength: 65536 ImmediateData: Yes InitialR2T: No MaxOutstandingR2T: 1 ************************ Attached SCSI devices: ************************ Host Number: 1 State: running scsi1 Channel 00 Id 0 Lun: 0 # match the "Lun: 0" here to the LUN ID. Attached scsi disk sdc State: running Current Portal: 161.26.110.43:3260,1041 # match this target iscsi IP to the block storage device. Persistent Portal: 161.26.110.43:3260,1041 ********** Interface: ********** Iface Name: default Iface Transport: tcp Iface Initiatorname: iqn.2018-08.com.ibm:ibm02su1575811-i11730597 Iface IPaddress: 10.74.10.67 Iface HWaddress: <empty> Iface Netdev: <empty> SID: 3 iSCSI Connection State: LOGGED IN iSCSI Session State: LOGGED_IN Internal iscsid Session State: NO CHANGE ********* Timeouts: ********* Recovery Timeout: 5 Target Reset Timeout: 30 LUN Reset Timeout: 30 Abort Timeout: 15 ***** CHAP: ***** username: IBM02SU1575811-I117305979 password: ******** username_in: <empty> password_in: ******** ************************ Negotiated iSCSI params: ************************ HeaderDigest: None DataDigest: None MaxRecvDataSegmentLength: 262144 MaxXmitDataSegmentLength: 65536 FirstBurstLength: 65536 MaxBurstLength: 65536 ImmediateData: Yes InitialR2T: No MaxOutstandingR2T: 1 ************************ Attached SCSI devices: ************************ Host Number: 3 State: running scsi3 Channel 00 Id 0 Lun: 1 # match the "Lun: 1" here to the LUN ID. Attached scsi disk sdd State: running
在 Windows 中檢視 LUN ID
-
在PowerShell,發出命令
iscsicli SessionList| findstr /c:"Device Number" /c:"Location" /c:"Target Portal"
。 輸出會顯示 IP 位址及 LUN ID。 在此範例中,IP 位址為 10.201.174.123,LUN ID 為 LUN 0。C:\Users\Adminisitrator>iscsicli SessionList| findstr /c:"Device Number" /c:"Location" /c:"Target Portal" Target Portal : 10.201.174.124/3260 Device Number : 3 Location : Bus Number 0, Target Id O, LUN 0 Target Portal : 10.201.174.123/3260 Device Number : 4 Location: : Bus Number 0, Target ID 1, LUN 0
-
然後,輸入下列 ibmcloud cli 指令:
ibmcloud sl block volume-list
及ibmcloud sl block volume-detail
,以將其輸出與您在步驟 1 中收集的資訊進行比較。$ ibmcloud sl block volume-list id username datacenter storage_type capacity_gb bytes_used lunId 333280508 SL02SEL1160157-221 dal10 endurance_block_storage 200 - 0 333506786 SL02SEL1160157-222 tok02 endurance_block_storage 200 - 0
$ ibmcloud sl block volume-detail 333506786 Name Value ID 333506786 User name SL02SEL1160157-222 Type endurance_block_storage Capacity (GB) 200 LUN Id 0 Endurance Tier READHEAVY_TIER Endurance Tier Per IOPS 2 Datacenter tok02 Target IP 10.201.174.123 # of Active Transactions 0 Replicant Count 0
檢視 VMWare ® 中的 LUN ID
-
執行
esxcli storage vmfs extent list
指令。 輸出包括磁區名稱iscsi-datastore
及其唯一網路定址權限 (naa
) ID。 該號碼保證對該 LUN 而言是唯一的。Volume Name VMFS UUID Extent Device Name Partition Number --------------- ----------------------------------- ------ ------------------------------------ ---- datastore1 5f69774e-f1031e44-7bdb-ac1f6bc4b812 0 naa.600062b2049d040026fc1e4b2f305682 3 iscsi-datastore 621f425f-0dc2da8a-927b-ac1f6bc4b812 0 naa.600a098038305674695d51694b427849 1
-
接下來,輸入
esxcfg-mpath -b
指令。 輸出包含相同的naa
號碼、LUN ID 及 PortalTag。naa.600a098038305674695d51694b427849 : NETAPP iSCSI Disk (naa.600a098038305674695d51694b427849) vmhba64:C0:T1:L0 LUN:0 state:active iscsi Adapter: iqn.2020-10.com.ibm:sl02su1160157-h1907004 Target: IQN=iqn.1992-08.com.netapp:stfdal1007 Alias= Session=00023d000001 PortalTag=1034 vmhba64:C1:T1:L0 LUN:0 state:active iscsi Adapter: iqn.2020-10.com.ibm:sl02su1160157-h1907004 Target: IQN=iqn.1992-08.com.netapp:stfdal1007 Alias= Session=00023d000002 PortalTag=1030
在此範例中,字串
LUN:0
表示 LUN ID 為 0。 -
發出
esxcli iscsi adapter target portal list
指令。 從輸出中,記下符合「入口網站標籤」的 IP 位址及 Tpgt 值。Adapter Target IP Port Tpgt ------- --------------------------------- ------------- ---- ---- vmhba64 iqn.1992-08.com.netapp:stfdal1007 161.26.99.155 3260 1034 vmhba64 iqn.1992-08.com.netapp:stfdal1007 161.26.99.152 3260 1030
在範例中,IP 位址 "161.26.99.155" 是 Block Storage for Classic 的目標 IP 位址,而 "1034" 是 PortalTag。
-
接下來,使用 IBMCLOUD CLI 指令
ibmcloud sl block volume-list
。 輸出包含磁碟區 ID、儲存裝置的主機名稱、DC 位置、儲存類型、容量、已使用的空間大小,以及 LUN ID。$ ibmcloud sl block volume-list id username datacenter storage_type capacity_gb bytes_used lunId 221426384 SL02SEL1160157-195 che01 endurance_block_storage 1500 - 2 332299016 SL02SEL1160157-220 dal13 endurance_block_storage 20 - 2 333280508 SL02SEL1160157-221 dal10 endurance_block_storage 200 - 0
在範例中,字串 "33328508" 是磁區 ID,而 "0" 是 Block Storage for Classic LUN 的 LUN ID。
發出指令
ibmcloud sl block volume-detail
,以取得儲存磁區的詳細資訊。$ ibmcloud sl block volume-detail 333280508 Name Value ID 333280508 User name SL02SEL1160157-221 Type endurance_block_storage Capacity (GB) 200 LUN Id 0 Endurance Tier READHEAVY_TIER Endurance Tier Per IOPS 2 Datacenter dal10 Target IP 161.26.99.155 # of Active Transactions 0 Replicant Count 0
因此,您可以將 iscsi LUN ID 對映至區塊裝置的主機名稱:
SL02SEL1160157-221 lun id: 0 Target IP: 161.26.99.155
在控制台查看LUN ID
您也可以收集 LUN ID、目標 IP 位址和主機名Block Storage for Classic控制台磁碟區詳細資料頁面上的裝置。