# 用命令操作 Brocade SAN 交換器 - Part3: 交換器互連 ###### tags: `san` `storage` `brocade` [toc] # 主要目標 想成功互連兩台 SAN 交換器任務,必須要有以下**所有條件**: - **網域識別碼(Domain ID) 必須要不同** - **其中一台的 Zone Config 必須要空的** # 直接互連? 如果將 2 台已經獨立運作的 SAN 交換器的 **port 1,32; port 1,34** ,直接用 2 條光纖線路連接會發生什麼狀況? :::warning 這裡設定的狀態是: - 2 台獨立 SAN 交換器的網域識別碼皆為預設 `1`,並未變更過。 - 2 台獨立 SAN 交換器有獨立設定的 alias, zone { **`HDS_ZONE`** }, cfg {**`HDS_ZONE_CONFIG`**} 組態。雖然名稱一樣,但其中的配置稍有不同。(~~一邊一國,各自表述?~~)。 - 2 台獨立 SAN 交換器皆是電源開啟狀態下,並為重新啟動任何一台 SAN 交換器。 - 2 台獨立 SAN 交換器的連接埠 port-32, port-34 並未停用(portdisable),僅透過光纖線路直接對接(~~沒有對談,直接通?~~)。 ::: ## switchshow 我們可以使用 **`switchshow`** 檢視 SAN 交換器的資訊和連接埠狀態。可以發現: - 2 台 SAN 交換器的 **網域識別碼都是 `1`**。 - Port 32 & 34 顯示為 E-port,但都顯示 **Domain Overlap 狀態**。 **SAN48-111(SAN SW1)** ```bash SAN48-111:admin> switchshow switchName: SAN48-111 switchType: 109.1 switchState: Online switchMode: Native switchRole: Principal switchDomain: 1 switchId: fffc01 switchWwn: 10:00:50:eb:1a:7a:fe:5e zoning: ON (HDS_ZONE_CONFIG) switchBeacon: OFF FC Router: OFF FC Router BB Fabric ID: 1 Address Mode: 0 HIF Mode: OFF Index Port Address Media Speed State Proto ================================================== 0 0 010000 id N16 No_Light FC 1 1 010100 id N16 No_Light FC 2 2 010200 id N16 No_Light FC 3 3 010300 id N16 No_Light FC 4 4 010400 id N16 No_Light FC 5 5 010500 id N16 No_Light FC <中間省略> 30 30 011e00 id N16 No_Light FC 31 31 011f00 id N16 No_Light FC 32 32 012000 id N16 Online FC E-Port segmented,10:00:50:eb:1a:42:88:7c (domain overlap) 33 33 012100 id N16 No_Light FC 34 34 012200 id N16 Online FC E-Port segmented,10:00:50:eb:1a:42:88:7c (domain overlap) 35 35 012300 id N16 No_Light FC <以下省略> ``` **SAN48-112(SAN SW2)** ```bash SAN48-112:admin> switchshow switchName: SAN48-112 switchType: 109.1 switchState: Online switchMode: Native switchRole: Principal switchDomain: 1 switchId: fffc01 switchWwn: 10:00:50:eb:1a:42:88:7c zoning: ON (HDS_ZONE_CONFIG) switchBeacon: OFF FC Router: OFF FC Router BB Fabric ID: 1 Address Mode: 0 HIF Mode: OFF Index Port Address Media Speed State Proto ================================================== 0 0 010000 id N16 No_Light FC 1 1 010100 id N16 No_Light FC 2 2 010200 id N16 No_Light FC 3 3 010300 id N16 No_Light FC 4 4 010400 id N16 No_Light FC 5 5 010500 id N16 No_Light FC <中間省略> 30 30 011e00 id N16 No_Light FC 31 31 011f00 id N16 No_Light FC 32 32 012000 id N16 Online FC E-Port segmented,10:00:50:eb:1a:7a:fe:5e (domain overlap) 33 33 012100 id N16 No_Light FC 34 34 012200 id N16 Online FC E-Port segmented,10:00:50:eb:1a:7a:fe:5e (domain overlap) 35 35 012300 id N16 No_Light FC <以下省略> ``` ## fabricshow 使用 **`fabricshow`** 直接檢視 fabric 資訊,可以迅速取得交換器識別碼,兩台 SAN 交換器的網域識別碼都是 `1`,所以不滿足 SAN 交換器互連的第一個條件。 **SAN48-111(SAN SW1)** ```bash SAN48-111:admin> fabricshow Switch ID Worldwide Name Enet IP Addr FC IP Addr Name ------------------------------------------------------------------------- 1: fffc01 10:00:50:eb:1a:7a:fe:5e 10.7.150.111 0.0.0.0 >"SAN48-111" ``` **SAN48-112(SAN SW2)** ```bash SAN48-112:admin> fabricshow Switch ID Worldwide Name Enet IP Addr FC IP Addr Name ------------------------------------------------------------------------- 1: fffc01 10:00:50:eb:1a:42:88:7c 10.7.150.112 0.0.0.0 >"SAN48-112" ``` # 重啟 SAN 交換器 接著在上述 **domain overlap** 的狀態下,重新啟動其中一台 SAN 交換器,重新觀察互連狀態。 重啟任何一台 SAN 交換器之後,顯示的結果都會是一樣的。因為 2 台獨立 SAN 交換器的 zone 物件有所不同。使用 **`cfgshow`** 可以檢視兩台設備配置的不同物件。 - **SAN48-111(SAN SW1) CFG 資訊** ```bash SAN48-111:admin> cfgshow Defined configuration: cfg: HDS_ZONE_CONFIG HDS_ZONE zone: HDS_ZONE ESXi_vmhba3; HDS_CT1_1A; HDS_CT2_2A alias: ESXi_vmhba2 21:00:00:24:ff:20:3d:6e alias: ESXi_vmhba3 21:00:00:24:ff:20:3d:6f alias: HDS_CT1_1A 50:06:0e:80:22:4b:46:00 alias: HDS_CT1_3A 50:06:0e:80:22:4b:46:20 alias: HDS_CT2_2A 50:06:0e:80:22:4b:46:10 alias: HDS_CT2_4A 50:06:0e:80:22:4b:46:30 alias: connect_array 1,4; 1,5; 1,6; 1,7 Effective configuration: cfg: HDS_ZONE_CONFIG zone: HDS_ZONE 21:00:00:24:ff:20:3d:6f 50:06:0e:80:22:4b:46:00 50:06:0e:80:22:4b:46:10 ``` - **SAN48-112(SAN SW2) CFG 資訊** ```bash SAN48-112:admin> cfgshow Defined configuration: cfg: HDS_ZONE_CONFIG HDS_ZONE zone: HDS_ZONE ESXi_vmhba3; HDS_CT1_3A; HDS_CT2_4A alias: ESXi_vmhba2 21:00:00:24:ff:20:3d:6e alias: ESXi_vmhba3 21:00:00:24:ff:20:3d:6f alias: HDS_CT1_1A 50:06:0e:80:22:4b:46:00 alias: HDS_CT1_3A 50:06:0e:80:22:4b:46:20 alias: HDS_CT2_2A 50:06:0e:80:22:4b:46:10 alias: HDS_CT2_4A 50:06:0e:80:22:4b:46:30 alias: connect_array 1,4; 1,5; 1,6; 1,7 Effective configuration: cfg: HDS_ZONE_CONFIG zone: HDS_ZONE 21:00:00:24:ff:20:3d:6f 50:06:0e:80:22:4b:46:20 50:06:0e:80:22:4b:46:30 ``` 使用 **`reboot`** 或是 **`fastboot`** 重啟任一台互連的 SAN 交換器。 ```bash SAN48-111:admin> echo y | reboot Warning: This command would cause the switch to reboot and result in traffic disruption. Broadcast message from root Mon Jun 19 09:03:33 2023... The system is going down for reboot NOW !! SAN48-111:admin> ``` :::info 使用 **`fastboot`** 進行冷重啟(cold reboot),會省略開機自我檢測程序,應可減少設備重啟時間。 ::: 重啟交換器之後,使用 **`switchshow`** 顯示 SAN 交換器資訊和互連埠狀態。使用 **`fabricshow`** 顯示交換器識別碼。 我們可以發現重啟 SAN 交換器後,相互互連的設備會重新交換資訊,而且系統會**自動解決網域識別碼(domain id) 重複**的問題。進行重啟的設備(SAN SW1)會自動調整網域識別碼,這裡可以看到已經將識別碼變更為 **`2`**,使得串接 SAN 交換器具備唯一的識別碼。 但由於 2 台 SAN 交換器原有的 Zone 名稱相同,但其物件並不相同,所以會顯示 **zone conflict 衝突資訊**。 **SAN48-111(SAN SW1)** ```bash SAN48-111:admin> switchshow switchName: SAN48-111 switchType: 109.1 switchState: Online switchMode: Native switchRole: Principal switchDomain: 2 switchId: fffc02 switchWwn: 10:00:50:eb:1a:7a:fe:5e zoning: ON (HDS_ZONE_CONFIG) switchBeacon: OFF FC Router: OFF FC Router BB Fabric ID: 1 Address Mode: 0 HIF Mode: OFF Index Port Address Media Speed State Proto ================================================== 0 0 020000 id N16 No_Light FC 1 1 020100 id N16 No_Light FC 2 2 020200 id N16 No_Light FC 3 3 020300 id N16 No_Light FC 4 4 020400 id N16 No_Light FC 5 5 020500 id N16 No_Light FC <中間省略> 30 30 021e00 id N16 No_Light FC 31 31 021f00 id N16 No_Light FC 32 32 022000 id N16 Online FC E-Port segmented,10:00:50:eb:1a:42:88:7c (zone conflict) 33 33 022100 id N16 No_Light FC 34 34 022200 id N16 Online FC E-Port segmented,10:00:50:eb:1a:42:88:7c (zone conflict) 35 35 022300 id N16 No_Light FC <以下省略> SAN48-111:admin> fabricshow Switch ID Worldwide Name Enet IP Addr FC IP Addr Name ------------------------------------------------------------------------- 2: fffc02 10:00:50:eb:1a:7a:fe:5e 10.7.150.111 0.0.0.0 >"SAN48-111" ``` **SAN48-112(SAN SW2)** ```bash SAN48-112:admin> switchshow switchName: SAN48-112 switchType: 109.1 switchState: Online switchMode: Native switchRole: Principal switchDomain: 1 switchId: fffc01 switchWwn: 10:00:50:eb:1a:42:88:7c zoning: ON (HDS_ZONE_CONFIG) switchBeacon: OFF FC Router: OFF FC Router BB Fabric ID: 1 Address Mode: 0 HIF Mode: OFF Index Port Address Media Speed State Proto ================================================== 0 0 010000 id N16 No_Light FC 1 1 010100 id N16 No_Light FC 2 2 010200 id N16 No_Light FC 3 3 010300 id N16 No_Light FC 4 4 010400 id N16 No_Light FC 5 5 010500 id N16 No_Light FC <中間省略> 30 30 011e00 id N16 No_Light FC 31 31 011f00 id N16 No_Light FC 32 32 012000 id N16 Online FC E-Port segmented,10:00:50:eb:1a:7a:fe:5e (zone conflict) 33 33 012100 id N16 No_Light FC 34 34 012200 id N16 Online FC E-Port segmented,10:00:50:eb:1a:7a:fe:5e (zone conflict) 35 35 012300 id N16 No_Light FC <以下省略> SAN48-112:admin> fabricshow Switch ID Worldwide Name Enet IP Addr FC IP Addr Name ------------------------------------------------------------------------- 1: fffc01 10:00:50:eb:1a:42:88:7c 10.7.150.112 0.0.0.0 >"SAN48-112" ``` :::danger 所以要完成互連 SAN 交換器,其中一台的 **Zone Config 必須要空的**! ::: :::success 接著我們將 SAN48-111(SAN SW1) 的網域識別碼重新調整回來為 `1`,了解該如何變更 SAN 交換器的網域識別碼。 ::: # 變更網域識別碼 ## 網域識別碼(Domain ID) **SAN 交換器的網域識別碼類似於乙太網路中 VLAN 閘道 IP 位址**。每台 SAN 交換器的**網域識別碼必須是唯一的**。SAN 交換器的網域識別碼可以動態配置,**預設識別碼為 1**。 **SAN 交換器互連**時,有可能會發生**網域識別碼衝突 (conflict)** 的狀態。只要 2 台 SAN 交換器的網域識別碼不是設定成**永久模式(permanent mode)** 或是 **Insistent Domain ID Mode: true**,**識別碼衝突問題都會自動解決**。 ![](https://hackmd.io/_uploads/BJ7XhdPNh.png) ![](https://hackmd.io/_uploads/SyvE2OPV2.png) :::info 預設配置應為 **Non-insistent Domain ID**,系統才能自動調整網域識別碼。 ::: ## 變更流程 當然,想要手動指定網域識別碼也是沒有問題的。請參考以下步驟完成: :::danger 為了順利調整 SAN48-111(SAN SW1) 的網域識別碼,請先在 SAN48-112(SAN SW2) 上將與其互連的 port-32 和 port-34 停用。所以,一般在**正式互連 SAN 交換器之前,先不要連接實體光纖線路**。 ```bash SAN48-112:admin> portdisable 32 34 ``` ::: ### 停用 SAN 交換器 使用 **`switchdisable`** 關閉交換器所有用戶端界面。前方面板界面埠 LED 指示燈號會變成緩慢閃動的琥珀色(slow-flashing amber)。 ```bash SAN48-111:admin> switchdisable SAN48-111:admin> switchshow switchName: SAN48-111 switchType: 109.1 switchState: Offline switchMode: Native switchRole: Disabled switchDomain: 2 (unconfirmed) switchId: fffc02 switchWwn: 10:00:50:eb:1a:7a:fe:5e zoning: ON (HDS_ZONE_CONFIG) switchBeacon: OFF FC Router: OFF FC Router BB Fabric ID: 1 Address Mode: 0 HIF Mode: OFF Index Port Address Media Speed State Proto ================================================== 0 0 020000 id N16 No_Light FC Disabled 1 1 020100 id N16 No_Light FC Disabled 2 2 020200 id N16 No_Light FC Disabled 3 3 020300 id N16 No_Light FC Disabled 4 4 020400 id N16 No_Light FC Disabled 5 5 020500 id N16 No_Light FC Disabled <中間省略> 32 32 022000 id N16 No_Sync FC Disabled 33 33 022100 id N16 No_Light FC Disabled 34 34 022200 id N16 No_Sync FC Disabled <中間省略> 44 44 022c00 id N16 No_Light FC Disabled 45 45 022d00 id N16 No_Light FC Disabled 46 46 022e00 id N16 No_Light FC Disabled 47 47 022f00 id N16 No_Light FC Disabled ``` ### 變更網域識別碼 :::danger - 若沒有先使用 **`switchdisable`** 停用 SAN 交換器,使用 **`configure`** 並不會出現網域識別碼調整的選項。<font color=red>變更網域識別碼必須先停用 SAN 交換器。</font> - 重新開關機後,使用 **`switchdisable`** 的 SAN 交換器會自動取消停用。若要持續停用交換器狀態,可以改用 **`switchcfgpersistentdisable`** 命令。使用 **`switchcfgpersistentdisable`** 恢復持續啟用狀態。 ::: 使用 **`configure`** 進行網域識別碼變更。 - Fabric parameters: **yes** - Domain: **'ID'** <<< 輸入要變更的識別碼 - 依次完成其他選項 ```bash SAN48-111:admin> configure Configure... Fabric parameters (yes, y, no, n): [no] y Domain: (1..239) [2] 1 WWN Based persistent PID (yes, y, no, n): [no] n Location ID: (0..4) [0] R_A_TOV: (4000..120000) [10000] E_D_TOV: (1000..5000) [2000] WAN_TOV: (0..30000) [0] MAX_HOPS: (7..19) [7] Data field size: (256..2112) [2112] Sequence Level Switching: (0..1) [0] Disable Device Probing: (0..1) [0] Suppress Class F Traffic: (0..1) [0] Per-frame Route Priority: (0..1) [0] Long Distance Fabric: (0..1) [0] BB credit: (1..27) [16] Disable FID Check (yes, y, no, n): [no] Insistent Domain ID Mode (yes, y, no, n): [no] Disable Default PortName (yes, y, no, n): [no] Display FDMI Host Name (yes, y, no, n): [no] Dynamic Portname (on, off): [off] Edge Hold Time(Low(80ms), Medium(220ms), High(500ms), UserDefined(80-500ms): (80..500) [220] Remote Fosexec feature: (on, off): [off] High Integrity Fabric Mode (yes, y, no, n): [no] Virtual Channel parameters (yes, y, no, n): [no] F-Port login parameters (yes, y, no, n): [no] D-Port Parameters (yes, y, no, n): [no] RDP Polling Cycle(hours)[0 = Disable Polling]: (0..24) [1] Zoning Operation parameters (yes, y, no, n): [no] RSCN Transmission Mode (yes, y, no, n): [no] Arbitrated Loop parameters (yes, y, no, n): [no] System services (yes, y, no, n): [no] Portlog events enable (yes, y, no, n): [no] ssl attributes (yes, y, no, n): [no] rpcd attributes (yes, y, no, n): [no] cfgload attributes (yes, y, no, n): [no] webtools attributes (yes, y, no, n): [no] SAN48-111:admin> ``` 或是按下 **`Ctrl+D`** 直接儲存設定離開! ```bash SAN48-111:admin> configure Configure... Fabric parameters (yes, y, no, n): [no] y Domain: (1..239) [2] 1 WWN Based persistent PID (yes, y, no, n): [no] WARNING: The domain ID will be changed. The port level zoning may be affected SAN48-111:admin> ``` ### 再次啟用 SAN 交換器 輸入 **`switchenable`** 再次啟用交換器所有用戶端界面埠。使用 **`switchshow`** 顯示網域識別碼已經成功變更為 `1`。 ```bash SAN48-111:admin> switchenable SAN48-111:admin> switchshow switchName: SAN48-111 switchType: 109.1 switchState: Online switchMode: Native switchRole: Principal switchDomain: 1 switchId: fffc01 switchWwn: 10:00:50:eb:1a:7a:fe:5e zoning: ON (HDS_ZONE_CONFIG) switchBeacon: OFF FC Router: OFF FC Router BB Fabric ID: 1 Address Mode: 0 HIF Mode: OFF Index Port Address Media Speed State Proto ================================================== 0 0 010000 id N16 No_Light FC 1 1 010100 id N16 No_Light FC 2 2 010200 id N16 No_Light FC 3 3 010300 id N16 No_Light FC 4 4 010400 id N16 No_Light FC 5 5 010500 id N16 No_Light FC <中間省略> 30 30 011e00 id N16 No_Light FC 31 31 011f00 id N16 No_Light FC 32 32 012000 id N16 No_Light FC 33 33 012100 id N16 No_Light FC 34 34 012200 id N16 No_Light FC 35 35 012300 id N16 No_Light FC <中間省略> 45 45 012d00 id N16 No_Light FC 46 46 012e00 id N16 No_Light FC 47 47 012f00 id N16 No_Light FC SAN48-111:admin> fabricshow Switch ID Worldwide Name Enet IP Addr FC IP Addr Name ------------------------------------------------------------------------- 1: fffc01 10:00:50:eb:1a:7a:fe:5e 10.7.150.111 0.0.0.0 >"SAN48-111" ``` # 清除 Zoning 組態 既然已經知道保留既有 zoning 組態的 SAN 交換器,並無法成功完成互連。所以接著讓我們依序使用以下命令清除 SAN48-112(SAN SW2) 上原有的 Zoning 組態。 - cfgdisable - cfgclear - cfgsave :::info 清除 SAN48-112(SAN SW2) 的設定,為了讓 SAN48-111(SAN SW1) 作為**主要交換器(principal switch) 角色**,可讓 SAN SW2 進行交換器互連時可以確保有不同的網域識別碼。而且 SAN48-112 將成為**次要交換器(subordinate switch) 角色**。 ::: 使用 **`cfgshow`** 檢視目前的 zoning 組態資訊。 ```bash SAN48-112:admin> cfgshow Defined configuration: cfg: HDS_ZONE_CONFIG HDS_ZONE zone: HDS_ZONE ESXi_vmhba3; HDS_CT1_3A; HDS_CT2_4A alias: ESXi_vmhba2 21:00:00:24:ff:20:3d:6e alias: ESXi_vmhba3 21:00:00:24:ff:20:3d:6f alias: HDS_CT1_1A 50:06:0e:80:22:4b:46:00 alias: HDS_CT1_3A 50:06:0e:80:22:4b:46:20 alias: HDS_CT2_2A 50:06:0e:80:22:4b:46:10 alias: HDS_CT2_4A 50:06:0e:80:22:4b:46:30 alias: connect_array 1,4; 1,5; 1,6; 1,7 Effective configuration: cfg: HDS_ZONE_CONFIG zone: HDS_ZONE 21:00:00:24:ff:20:3d:6f 50:06:0e:80:22:4b:46:20 50:06:0e:80:22:4b:46:30 ``` 使用 **`cfgdisable`** 停用 zoning 組態,並重新檢視 **Effective configuration** 狀態。 ```bash SAN48-112:admin> echo y | cfgdisable You are about to disable zoning configuration. This action will disable any previous zoning configuration enabled. Do you want to disable zoning configuration? (yes, y, no, n): [no] Updating flash ... SAN48-112:admin> cfgshow Defined configuration: cfg: HDS_ZONE_CONFIG HDS_ZONE zone: HDS_ZONE ESXi_vmhba3; HDS_CT1_3A; HDS_CT2_4A alias: ESXi_vmhba2 21:00:00:24:ff:20:3d:6e alias: ESXi_vmhba3 21:00:00:24:ff:20:3d:6f alias: HDS_CT1_1A 50:06:0e:80:22:4b:46:00 alias: HDS_CT1_3A 50:06:0e:80:22:4b:46:20 alias: HDS_CT2_2A 50:06:0e:80:22:4b:46:10 alias: HDS_CT2_4A 50:06:0e:80:22:4b:46:30 alias: connect_array 1,4; 1,5; 1,6; 1,7 Effective configuration: no configuration in effect ``` 使用 **`cfgclear`** 清除所有相關 zoning 組態,再次檢視 zoning 組態資訊,已經全部清除完畢。 ```bash SAN48-112:admin> echo y | cfgclear The Clear All action will clear all Aliases, Zones, FA Zones and configurations in the Defined configuration. Run cfgSave to commit the transaction or cfgTransAbort to cancel the transaction. Do you really want to clear all configurations? (yes, y, no, n): [no] SAN48-112:admin> SAN48-112:admin> cfgshow Defined configuration: no configuration defined Effective configuration: no configuration in effect ``` :::info 當然也可以使用 **`alidelete`**, **`zonedelete`** 和 **`cfgdelete`** 完成,但使用 **`cfgclear`** 簡化完全清除步驟。 ::: 將目前狀態使用 **`cfgsave`** 命令完成組態儲存。 ```bash SAN48-112:admin> echo y | cfgsave You are about to save the Defined zoning configuration. This action will only save the changes on Defined configuration. If the update includes changes to one or more traffic isolation zones, you must issue the 'cfgenable' command for the changes to take effect. Do you want to save the Defined zoning configuration only? (yes, y, no, n): [no] Updating flash ... SAN48-112:admin> SAN48-112:admin> cfgshow Defined configuration: no configuration defined Effective configuration: no configuration in effect ``` 剩下來的工作,只要重啟 SAN48-112(SAN SW2) 就會自動完成了。 :::info 先前停用的 port-32 和 port-34 在 SAN 交換器重新啟動後會再自動啟用。 ::: ```bash SAN48-112:admin> echo y | fastboot Warning: This command would cause the switch to reboot and result in traffic disruption. Broadcast message from root Mon Jun 19 11:34:05 2023... The system is going down for reboot NOW !! SAN48-112:admin> ``` # 完成 SAN 交換器互連 等待幾分鐘讓 SAN 交換器上線,使用 **`switchshow`** 和 **`fabricshow`** 檢視互連狀態。顯示 2 台 SAN 交換器已經正確完成互連,形成一組核心架構(fabric)。 其中 SAN48-111(SAN SW1) 為 upstream 交換器,SAN48-112(SAN SW2) 為 downstream 交換器。 **SAN48-111(SAN SW1)** ```bash SAN48-111:admin> switchshow switchName: SAN48-111 switchType: 109.1 switchState: Online switchMode: Native switchRole: Principal switchDomain: 1 switchId: fffc01 switchWwn: 10:00:50:eb:1a:7a:fe:5e zoning: ON (HDS_ZONE_CONFIG) switchBeacon: OFF FC Router: OFF FC Router BB Fabric ID: 1 Address Mode: 0 HIF Mode: OFF Index Port Address Media Speed State Proto ================================================== 0 0 010000 id N16 No_Light FC 1 1 010100 id N16 No_Light FC 2 2 010200 id N16 No_Light FC 3 3 010300 id N16 No_Light FC 4 4 010400 id N16 No_Light FC 5 5 010500 id N16 No_Light FC <中間省略> 30 30 011e00 id N16 No_Light FC 31 31 011f00 id N16 No_Light FC 32 32 012000 id N16 Online FC E-Port 10:00:50:eb:1a:42:88:7c "SAN48-112" (downstream) 33 33 012100 id N16 No_Light FC 34 34 012200 id N16 Online FC E-Port 10:00:50:eb:1a:42:88:7c "SAN48-112" 35 35 012300 id N16 No_Light FC <以下省略> SAN48-111:admin> fabricshow Switch ID Worldwide Name Enet IP Addr FC IP Addr Name ------------------------------------------------------------------------- 1: fffc01 10:00:50:eb:1a:7a:fe:5e 10.7.150.111 0.0.0.0 >"SAN48-111" 2: fffc02 10:00:50:eb:1a:42:88:7c 10.7.150.112 0.0.0.0 "SAN48-112" The Fabric has 2 switches ``` **SAN48-112(SAN SW2)** ```bash SAN48-112:admin> switchshow switchName: SAN48-112 switchType: 109.1 switchState: Online switchMode: Native switchRole: Subordinate switchDomain: 2 switchId: fffc02 switchWwn: 10:00:50:eb:1a:42:88:7c zoning: ON (HDS_ZONE_CONFIG) switchBeacon: OFF FC Router: OFF FC Router BB Fabric ID: 1 Address Mode: 0 HIF Mode: OFF Index Port Address Media Speed State Proto ================================================== 0 0 020000 id N16 No_Light FC 1 1 020100 id N16 No_Light FC 2 2 020200 id N16 No_Light FC 3 3 020300 id N16 No_Light FC 4 4 020400 id N16 No_Light FC 5 5 020500 id N16 No_Light FC <中間省略> 30 30 021e00 id N16 No_Light FC 31 31 021f00 id N16 No_Light FC 32 32 022000 id N16 Online FC E-Port 10:00:50:eb:1a:7a:fe:5e "SAN48-111" (upstream) 33 33 022100 id N16 No_Light FC 34 34 022200 id N16 Online FC E-Port 10:00:50:eb:1a:7a:fe:5e "SAN48-111" 35 35 022300 id N16 No_Light FC <以下省略> SAN48-112:admin> fabricshow Switch ID Worldwide Name Enet IP Addr FC IP Addr Name ------------------------------------------------------------------------- 1: fffc01 10:00:50:eb:1a:7a:fe:5e 10.7.150.111 0.0.0.0 >"SAN48-111" 2: fffc02 10:00:50:eb:1a:42:88:7c 10.7.150.112 0.0.0.0 "SAN48-112" The Fabric has 2 switches ``` SAN48-111(SAN SW1) 的 switchRole 是 Principal,SAN48-112(SAN SW2) 的 switchRole 是 Subordinate。所以 SAN48-112 會先同步 SAN48-111 的 zoning 組態,使得 2 台 SAN 交換器互連後有著相同的 zoning 設定。 ```bash ## SAN-SW1 的 zoning 組態 SAN48-111:admin> cfgshow Defined configuration: cfg: HDS_ZONE_CONFIG HDS_ZONE zone: HDS_ZONE ESXi_vmhba3; HDS_CT1_1A; HDS_CT2_2A alias: ESXi_vmhba2 21:00:00:24:ff:20:3d:6e alias: ESXi_vmhba3 21:00:00:24:ff:20:3d:6f alias: HDS_CT1_1A 50:06:0e:80:22:4b:46:00 alias: HDS_CT1_3A 50:06:0e:80:22:4b:46:20 alias: HDS_CT2_2A 50:06:0e:80:22:4b:46:10 alias: HDS_CT2_4A 50:06:0e:80:22:4b:46:30 alias: connect_array 1,4; 1,5; 1,6; 1,7 Effective configuration: cfg: HDS_ZONE_CONFIG zone: HDS_ZONE 21:00:00:24:ff:20:3d:6f 50:06:0e:80:22:4b:46:00 50:06:0e:80:22:4b:46:10 ## SAN-SW2 同步自 SAN-SW1,具有完全相同的 zoning 組態 SAN48-112:admin> cfgshow Defined configuration: cfg: HDS_ZONE_CONFIG HDS_ZONE zone: HDS_ZONE ESXi_vmhba3; HDS_CT1_1A; HDS_CT2_2A alias: ESXi_vmhba2 21:00:00:24:ff:20:3d:6e alias: ESXi_vmhba3 21:00:00:24:ff:20:3d:6f alias: HDS_CT1_1A 50:06:0e:80:22:4b:46:00 alias: HDS_CT1_3A 50:06:0e:80:22:4b:46:20 alias: HDS_CT2_2A 50:06:0e:80:22:4b:46:10 alias: HDS_CT2_4A 50:06:0e:80:22:4b:46:30 alias: connect_array 1,4; 1,5; 1,6; 1,7 Effective configuration: cfg: HDS_ZONE_CONFIG zone: HDS_ZONE 21:00:00:24:ff:20:3d:6f 50:06:0e:80:22:4b:46:00 50:06:0e:80:22:4b:46:10 ``` 然後嘗試在 SAN48-112(SAN SW2) 變更 zoning 組態。 ```bash SAN48-112:admin> zoneadd "HDS_ZONE", "HDS_CT1_3A;HDS_CT2_4A" SAN48-112:admin> echo y | cfgenable "HDS_ZONE_CONFIG" You are about to enable a new zoning configuration. This action will replace the old zoning configuration with the current configuration selected. If the update includes changes to one or more traffic isolation zones, the update may result in localized disruption to traffic on ports associated with the traffic isolation zone changes Do you want to enable 'HDS_ZONE_CONFIG' configuration (yes, y, no, n): [no] zone config "HDS_ZONE_CONFIG" is in effect Updating flash ... SAN48-112:admin> SAN48-112:admin> echo y | cfgsave You are about to save the Defined zoning configuration. This action will only save the changes on Defined configuration. If the update includes changes to one or more traffic isolation zones, you must issue the 'cfgenable' command for the changes to take effect. Do you want to save the Defined zoning configuration only? (yes, y, no, n): [no] Nothing changed: nothing to save, returning ... SAN48-112:admin> cfgshow Defined configuration: cfg: HDS_ZONE_CONFIG HDS_ZONE zone: HDS_ZONE ESXi_vmhba3; HDS_CT1_1A; HDS_CT2_2A; HDS_CT1_3A; HDS_CT2_4A alias: ESXi_vmhba2 21:00:00:24:ff:20:3d:6e alias: ESXi_vmhba3 21:00:00:24:ff:20:3d:6f alias: HDS_CT1_1A 50:06:0e:80:22:4b:46:00 alias: HDS_CT1_3A 50:06:0e:80:22:4b:46:20 alias: HDS_CT2_2A 50:06:0e:80:22:4b:46:10 alias: HDS_CT2_4A 50:06:0e:80:22:4b:46:30 alias: connect_array 1,4; 1,5; 1,6; 1,7 Effective configuration: cfg: HDS_ZONE_CONFIG zone: HDS_ZONE 21:00:00:24:ff:20:3d:6f 50:06:0e:80:22:4b:46:00 50:06:0e:80:22:4b:46:10 50:06:0e:80:22:4b:46:20 50:06:0e:80:22:4b:46:30 ## 接著在 SAN48-111 檢視 zoning 組態也已被同步更新 SAN48-111:admin> cfgshow Defined configuration: cfg: HDS_ZONE_CONFIG HDS_ZONE zone: HDS_ZONE ESXi_vmhba3; HDS_CT1_1A; HDS_CT2_2A; HDS_CT1_3A; HDS_CT2_4A alias: ESXi_vmhba2 21:00:00:24:ff:20:3d:6e alias: ESXi_vmhba3 21:00:00:24:ff:20:3d:6f alias: HDS_CT1_1A 50:06:0e:80:22:4b:46:00 alias: HDS_CT1_3A 50:06:0e:80:22:4b:46:20 alias: HDS_CT2_2A 50:06:0e:80:22:4b:46:10 alias: HDS_CT2_4A 50:06:0e:80:22:4b:46:30 alias: connect_array 1,4; 1,5; 1,6; 1,7 Effective configuration: cfg: HDS_ZONE_CONFIG zone: HDS_ZONE 21:00:00:24:ff:20:3d:6f 50:06:0e:80:22:4b:46:00 50:06:0e:80:22:4b:46:10 50:06:0e:80:22:4b:46:20 50:06:0e:80:22:4b:46:30 ``` # Port Trunking 以網路交換器的術語來說應該是 **Link Aggregation**,就是將多組實體介面埠彙整在一起,成為一個邏輯介面埠。這種單一邏輯鏈路在 SAN 交換器中稱為 **trunk group**,SAN 交換器透過 Trunking 方式可優化網路頻寬效能的使用,另一方面也進而簡化了管理成本。若 trunk group 其中的實體鏈路出現故障,也能持續地完成有序的資料傳輸和避免 I/O 重試來提高系統可靠度。 Trunking 類型在 SAN 交換器有多種型態,也跟介面類型及設備連接有關,這部份的詳細資訊就請自行參考官方說明 [[**Types of Trunking**]](https://techdocs.broadcom.com/us/en/fibre-channel-networking/fabric-os/fabric-os-administration/9-1-x/v26799888/v26762691.html)。 ## 授權 不同類型的 Trunking 應用,也需要有對應的授權安裝在 SAN 交換器中,才能正常組態及使用。以下是官方說明 [[License Requirements for Trunking]](https://techdocs.broadcom.com/us/en/fibre-channel-networking/fabric-os/fabric-os-administration/9-1-x/v26799888/v26799898.html): - **Trunking of non-ICL ports** (E_Ports, EX_Ports, and F_Ports) **requires the Trunking license**. This license must be installed on each switch that participates in trunking. - **Trunking of ICL ports** (E_Ports and EX_Ports) **does not require a Trunking license**. 參與 Trunking 設定的**所有 SAN 交換器** 都需要安裝滿足需求的授權。使用 **`licenseshow`** 可以檢視授權安裝狀態。 ```bash SAN48-111:admin> licenseshow *Z*T*S*fY*Rg**T***SgSZm*ra*Z*YX**S*T*: Fabric Watch license *P*a****m**PQ*g*XZrPm*m*m**R**m***ZTP: Full Ports on Demand license - additional 24 port upgrade license *fgP*TY*r**ma**a***WQT***Z**R*XZ**QT*gSaP*Q*T*Yt**: Trunking license Expiry Date 04/11/2016 License has expired ``` ## 設定 :::warning 哈!目前手邊的 SAN 交換器並**沒有適當的授權**可以滿足完成 **ISL Trunking** or **E_Port Trunking**,但還是可以透過命令稍微了解一下配置狀態。 ::: ### 先決條件 另外要形成 Trunking(**trunk group**) 的介面埠必須是在**同一個介面埠群組 (port group)** 當中。而介面埠群組是一個包含 8 個介面埠的群組,通常是 0~7, 8~15, 16~23 等。最大值就是 SAN 交換器上的介面埠數量,這個數量與設備相關。至於同一介面埠群組中的介面埠是否可用於 trunking 設定,請參考該設備的硬體說明文件。 以下是 Brocade G620 的介面埠群組配置。 ![](https://hackmd.io/_uploads/ByLrq9pDn.png) 接著要形成 trunk group 的條件,可參考官方說明 [[**Requirements for Trunk Groups**]](https://techdocs.broadcom.com/us/en/fibre-channel-networking/fabric-os/fabric-os-administration/9-1-x/v26799888/v26799647.html) 和 [[**Recommendations for Trunk Groups**]](https://techdocs.broadcom.com/us/en/fibre-channel-networking/fabric-os/fabric-os-administration/9-1-x/v26799888/v26800068.html)。基本原則應該就是**所有加入 Trunking 介面埠的配置及條件都要相同**,介面埠必須要同一廠牌且直接連結。初心者就沒辦法囉!:beginner: ### 初始化介面埠 安裝 Trunking 授權後必須重新初始化要形成 trunk group 的介面埠,該程序只需要執行一次,但對於所有的 Trunking 類型都是必要的。 輸入 **`islshow [-slotport]`** 可顯示用於 ISL 的介面埠。 ```bash SAN48-111:admin> islshow -slotport 1: 32-> 32 10:00:50:eb:1a:42:88:7c 2 SAN48-112 sp: 16.000G bw: 16.000G QOS CR_RECOV FEC 2: 34-> 34 10:00:50:eb:1a:42:88:7c 2 SAN48-112 sp: 16.000G bw: 16.000G QOS CR_RECOV FEC SAN48-112:admin> islshow -slotport 1: 32-> 32 10:00:50:eb:1a:7a:fe:5e 1 SAN48-111 sp: 16.000G bw: 16.000G QOS CR_RECOV FEC 2: 34-> 34 10:00:50:eb:1a:7a:fe:5e 1 SAN48-111 sp: 16.000G bw: 16.000G QOS CR_RECOV FEC ``` 初始化的動作就是先停用 **`portdisable`** 再啟用介面埠 **`portenable`**。或用 **`switchdisable`/`switchenable`** 控制整個 SAN 交換器的介面埠。 ### 啟用或停用 Trunking 只要 Trunking 授權安裝並存在於 SAN 交換器中,預設就會啟用 Trunking 功能。除非先前在該介面埠或交換器上停用 Trunking 功能。 使用 **`portcfgshow`** 檢視介面埠組態資訊。以下顯示 port 32-34 的 **Trunk Port 狀態皆為啟用狀態 (ON)**。 ```bash SAN48-111:admin> portcfgshow -i 32-34 Index: 32 33 34 --------------------+---+---+--- Octet Speed Combo 1 1 1 Speed AN AN AN AL_PA Offset 13 .. .. .. Trunk Port ON ON ON Long Distance .. .. .. VC Link Init .. .. .. <以下省略> SAN48-112:admin> portcfgshow -i 32-34 Index: 32 33 34 --------------------+---+---+--- Octet Speed Combo 1 1 1 Speed AN AN AN AL_PA Offset 13 .. .. .. Trunk Port ON ON ON Long Distance .. .. .. <以下省略> ``` 使用 **`portcfgtrunkport [slot/]port mode`** 命令可指定介面埠進行 Trunking 功能開關切換。使用 **`switchcfgtrunk mode`** 命令則是針對整台 SAN 交換器的所有介面埠進行控制。 其中 **`mode`** 定義為: - Mode **`0`**: 關閉 (disable) - Mode **`1`**: 啟用 (enable) 關閉後檢視 port-33 的 Trunk 功能。發現 port-33 的 Trunk 功能已經取消。 ```bash SAN48-111:admin> portcfgtrunkport 33 0 SAN48-111:admin> portcfgshow -i 32-34 Index: 32 33 34 --------------------+---+---+--- Octet Speed Combo 1 1 1 Speed AN AN AN AL_PA Offset 13 .. .. .. Trunk Port ON .. ON Long Distance .. .. .. ``` 再次開啟 port-33 的 Trunk 功能。 ```bash SAN48-111:admin> portcfgtrunkport 33 1 Trunking license required SAN48-111:admin> switchcfgtrunk 1 Trunking license required. SAN48-111:admin> portcfgtrunkport 34 1 Trunking license required. ``` :::danger **GG了!!** 啟用介面埠的 Trunk 功能,一定要具備**有效的 Trunking 授權**! ::: ```bash SAN48-111:admin> trunkshow No trunking links SAN48-112:admin> trunkshow No trunking links ``` 以上。大概就是 SAN 交換器互連的測試紀錄了,其他就要請教專家了。 --- # 其他 用命令操作 Brocade SAN 交換器 - [Part1: 基本操作](https://hackmd.io/@farmer87/brocade_learning_01) - [Part2: Zoning 設定](https://hackmd.io/@farmer87/brocade_learning_02) - [Part3: 交換器互連](https://hackmd.io/@farmer87/brocade_learning_03)