EMC PowerPath 系統管理
假使你的主機具有兩片 HBA 卡 , 連接到 EMC SAN storgae 設備上 , 再透過 EMC PowerPath 軟體 , 就來可以建置負載平衡(load-balancing)與 故障復原 (fail over) 的高可用性系統.
Powermt這個管理工具 ,就是用來輔助管理EMC儲存設備的多多路徑存取功能的 .在這篇文章裡 , 我們會討論這個指令要如何來應用 .
1. powermt display – 顯示 HBA I/O路徑資訊powermt display指令 ,不帶參數 , 則會列出所有可用的 HBAs 與它們目前的狀態 . 下面的例子,顯示出主機連接兩片HBA , 每一片卡都擁有兩條路徑 ,並處於正常運作狀態 . qla2xxx 則表示它是使用 Q-logic 的 HBA .
# powermt display
Symmetrix logical device count=0
CLARiiON logical device count=1 所連接的EMC儲存裝置是 CLARiiON系列.
Hitachi logical device count=0
Invista logical device count=0
HP xp logical device count=0
Ess logical device count=0
HP HSx logical device count=0
==============================================================================
----- Host Bus Adapters --------- ------ I/O Paths ----- ------ Stats ------
### HW Path Summary Total Dead IO/Sec Q-IOs Errors
==============================================================================
1 qla2xxx optimal 2 0 - 0 0
2 qla2xxx optimal 2 0 - 0 0
2. powermt display dev=all –列舉出所掛載的 LUN
這是最常用到的指令 , 它會列舉出server 所掛載的所有邏輯裝置.
# powermt display dev=all
Pseudo name=emcpowera
CLARiiON ID=AAA00000000000 [dev-server]
Logical device ID=1111111111111111111 [LUN 1]
state=alive; policy=CLAROpt; priority=0; queued-IOs=0
Owner: default=SP B, current=SP B Array failover mode: 1
==============================================================================
---------------- Host --------------- - Stor - -- I/O Path - -- Stats ---
### HW Path I/O Paths Interf. Mode State Q-IOs Errors
==============================================================================
1 qla2xxx sdd SP A4 active alive 0 0
1 qla2xxx sde SP B4 active alive 0 0
2 qla2xxx sdf SP A5 active alive 0 0
2 qla2xxx sdg SP B5 active alive 0 0
Pseudo name=emcpowerb
CLARiiON ID=AAA00000000000 [dev-server]
Logical device ID=2111111111111111111 [LUN 2]
state=alive; policy=CLAROpt; priority=0; queued-IOs=0
Owner: default=SP A, current=SP A Array failover mode: 1
==============================================================================
---------------- Host --------------- - Stor - -- I/O Path - -- Stats ---
### HW Path I/O Paths Interf. Mode State Q-IOs Errors
==============================================================================
1 qla2xxx sdh SP A4 active alive 0 0
1 qla2xxx sdi SP B4 active alive 0 0
2 qla2xxx sdj SP A5 active alive 0 0
2 qla2xxx sdk SP B5 active alive 0 0
上面訊息表示 server透過四條I/O路徑與 storage連接 , 並掛載了兩個邏輯裝置 . 並載明了以下資訊:
- Pseudo name=emcpowera – 主機所使用的裝置名稱. 例如 /dev/emcpowera.
- CLARiiON ID=AAA00000000000 [dev-server] - EMC CLARiiON CX3 序號 and主機名稱.
- Logical device ID=11111111 [LUN 1] – LUN 編號
- state=alive; policy=CLAROpt; – 表示此 LUN 是可用的並設定 CLAROpt policy.
- Owner: default=SP B, current=SP B – 表示此 LUN 內定是storage 的 SP B 所擁有 .
3. powermt display dev=emcpowera – 只顯示指定 LUN 的資訊
當主機連接到多個邏輯裝置時 , 可只指定特定 LUN 顯示來顯示它的資訊 .例如:
# powermt display dev=emcpowera
Pseudo name=emcpowera
CLARiiON ID=AAA00000000000 [dev-server]
Logical device ID=1111111111111111111 [LUN 1]
state=alive; policy=CLAROpt; priority=0; queued-IOs=0
Owner: default=SP B, current=SP B Array failover mode: 1
==============================================================================
---------------- Host --------------- - Stor - -- I/O Path - -- Stats ---
### HW Path I/O Paths Interf. Mode State Q-IOs Errors
==============================================================================
1 qla2xxx sdd SP A4 active alive 0 0
1 qla2xxx sde SP B4 active alive 0 0
2 qla2xxx sdf SP A5 active alive 0 0
2 qla2xxx sdg SP B5 active alive 0 0
假使無此邏輯裝置不能正常使用 , 你會得到一個 "Bad dev value" 的訊息.
# powermt display dev=emcpowerc
Bad dev value emcpowerc, or not under Powerpath control.
4. powermt check_registration – 顯示 PowerPath 註冊碼與註冊狀態
假使你遺失了 Powerpath 註冊碼 , 你可以用下面的指令查詢註冊狀態 :
# powermt check_registration
Key AAAA-BBBB-CCCC-DDDD-EEEE-FFFF
Product: PowerPath
Capabilities: All
5. powermt display options – 顯示 EMC PowerPath 設定選項
# powermt display options
Default storage system class: all
Show CLARiiON LUN names: true
Path Latency Monitor: Off
Path Latency Threshold: 0 Sec.
Storage
System Class Attributes
------------ ----------
Symmetrix periodic autorestore = on
status = managed
CLARiiON periodic autorestore = on
status = managed
Hitachi periodic autorestore = on
status = managed
Invista periodic autorestore = on
status = managed
HP xp periodic autorestore = on
status = managed
Ess periodic autorestore = on
status = managed
HP HSx periodic autorestore = on
status = managed
6. powermt display hba_mode – 顯示某 PowerPath HBA 操作模式
# powermt display hba_mode
Symmetrix logical device count=0
CLARiiON logical device count=1
Hitachi logical device count=0
Invista logical device count=0
HP xp logical device count=0
Ess logical device count=0
HP HSx logical device count=0
==============================================================================
----- Host Bus Adapters --------- ------ I/O Paths ----- Stats
### HW Path Summary Total Dead Q-IOs Mode
==============================================================================
1 qla2xxx optimal 2 0 0 Enabled
2 qla2xxx optimal 2 0 0 Enabled
7. powermt display path –顯示所有可用路徑
# powermt display paths
Symmetrix logical device count=0
==============================================================================
----- Host Bus Adapters --------- ------ Storage System ----- - I/O Paths -
### HW Path ID Interface Total Dead
==============================================================================
CLARiiON logical device count=1
==============================================================================
----- Host Bus Adapters --------- ------ Storage System ----- - I/O Paths -
### HW Path ID Interface Total Dead
==============================================================================
1 qla2xxx AAA00000000000 SP A4 1 0
1 qla2xxx AAA00000000000 SP B4 1 0
2 qla2xxx AAA00000000000 SP A5 1 0
2 qla2xxx AAA00000000000 SP B5 1 0
Hitachi logical device count=0
==============================================================================
----- Host Bus Adapters --------- ------ Storage System ----- - I/O Paths -
### HW Path ID Interface Total Dead
==============================================================================
Invista logical device count=0
==============================================================================
----- Host Bus Adapters --------- ------ Storage System ----- - I/O Paths -
### HW Path ID Interface Total Dead
==============================================================================
HP xp logical device count=0
==============================================================================
----- Host Bus Adapters --------- ------ Storage System ----- - I/O Paths -
### HW Path ID Interface Total Dead
==============================================================================
Ess logical device count=0
==============================================================================
----- Host Bus Adapters --------- ------ Storage System ----- - I/O Paths -
### HW Path ID Interface Total Dead
==============================================================================
HP HSx logical device count=0
==============================================================================
----- Host Bus Adapters --------- ------ Storage System ----- - I/O Paths -
### HW Path ID Interface Total Dead
==============================================================================
8. powermt displays port_mode – 顯示各 HBA Port 狀態
# powermt display port_mode
Storage class = Symmetrix
==============================================================================
----------- Storage System --------------- -- I/O Paths -- --- Stats ---
ID Interface Wt_Q Total Dead Q-IOs Mode
==============================================================================
Storage class = CLARiiON
==============================================================================
----------- Storage System --------------- -- I/O Paths -- --- Stats ---
ID Interface Wt_Q Total Dead Q-IOs Mode
==============================================================================
AAA00000000000 SP A4 256 1 0 0 Enabled
AAA00000000000 SP B4 256 1 0 0 Enabled
AAA00000000000 SP A5 256 1 0 0 Enabled
AAA00000000000 SP B5 256 1 0 0 Enabled
9. powermt version – 顯示EMC PowerPath 版本信息
# powermt version
EMC powermt for PowerPath (c) Version 5.3 (build 185)
10. powermt check –檢查路徑狀態資訊
假使路徑有所變動 , 則可使用此指令確認路徑狀態 .
# powermt check
Warning: storage_system I/O path path_name is dead.
Do you want to remove it (y/n/a/q)?
Note: If you want powermt to automatically remove all dead paths, without any confirmation, execute “powermt check force”.
11. powermt set mode hba – 設定 HBA mode
可將特定HBA 設定成 standby 或 active 模式. 下面的例子是將 HBA1 從 active 改設成 standby mode .
# powermt set mode=standby hba=1
執行玩上一步驟, 再查詢 HBA 1 已經變為 standby mode 了 :
# powermt display dev=all
Pseudo name=emcpowera
CLARiiON ID=AAA00000000000 [dev-server]
Logical device ID=1111111111111111111 [LUN 1]
state=alive; policy=CLAROpt; priority=0; queued-IOs=0
Owner: default=SP B, current=SP B Array failover mode: 1
==============================================================================
---------------- Host --------------- - Stor - -- I/O Path - -- Stats ---
### HW Path I/O Paths Interf. Mode State Q-IOs Errors
==============================================================================
1 qla2xxx sdd SP A4 standby alive 0 0
1 qla2xxx sde SP B4 standby alive 0 0
2 qla2xxx sdf SP A5 active alive 0 0
2 qla2xxx sdg SP B5 active alive 0 0
Note: Path mode 也可能是 “unlic” , 表示你 PowerPath 還沒有註冊 License key.
12. powermt remove – 刪除 I/O Path
下面的例子有 4個 I/O 路徑 :# powermt display dev=all
==============================================================================
---------------- Host --------------- - Stor - -- I/O Path - -- Stats ---
### HW Path I/O Paths Interf. Mode State Q-IOs Errors
==============================================================================
1 qla2xxx sdd SP A4 standby alive 0 0
1 qla2xxx sde SP B4 standby alive 0 0
2 qla2xxx sdf SP A5 active alive 0 0
2 qla2xxx sdg SP B5 active alive 0 0
把I/O Path sdd 拿掉 , 執行:
# powermt remove dev=sdd
# powermt display dev=all
==============================================================================
---------------- Host --------------- - Stor - -- I/O Path - -- Stats ---
### HW Path I/O Paths Interf. Mode State Q-IOs Errors
==============================================================================
1 qla2xxx sde SP B4 standby alive 0 0
2 qla2xxx sdf SP A5 active alive 0 0
2 qla2xxx sdg SP B5 active alive 0 0
也可移除所指定邏輯裝置的所有 I/O路徑 , 列如:
# powermt remove dev=emcpowera
但假使/dev/emcpowera 正被某些程式掛載或使用 , 上面的指令就不會產生作用 .
13. powermt config – 顯列 PowerPath 組態
# powermt config這個指令會檢查 EMC SAN 所有邏輯裝置 , 並產生組態列表 .並將某些功能選項射為自訂值.
例如 write throttling = off, HBA mode = active, CLARiiON policy = CLAROpt, etc.
Possible EMC SAN LUN policy values are: Adaptive, BasicFailover, CLAROpt, LeastBlocks, LeastIos, NoRedirect, Request, RoundRobin, StreamIO, or SymmOpt.
當你執行過 powermt config , 假使你不想要某個選項為自訂值 , 你必須後續做適當修正 .
14. powermt restore –將失效 I/O path 重新啟用
假使你有某失效的路徑 (俗稱 dead I/O paths), 並在後續已將實體問題解決 ,則你可以使用 powermt restore指令 ,
要求 PowerPath 去種個重新檢查路徑 , 並將它重新啟用 .
當你執行 powermt restore, 它會進行 I/O path check. 假使有dead path 已經復原可用 (alive) , 它就會將它重新標記為 alive , 反之反之如果有某些alive path 死掉了(dead ), 它也會標記為 dead.
假設因為某種原因 , 你可能會看到某個LUN 的 default ower 不是原來的 SP , 你就可以執行下面一航指令 , 它就會修正這個問題.
# powermt restore dev=all
除了指定 dev, 你也可以在 powermt restore 指令下指定其他類別 . 根據你的系統可能有以下幾種類別 :
- symm – Symmetrix
- clariion - CLARiiON
- invista – Invista
- ess – IBM ESS
- hitachi – Hitachi Lightning TagmaStore
- hpxp - HP StorageWorks XP, or EVA series
- hphsx – HP StorageWorks EMA, or MA
- all – All systems
15. Powermt Save and Load – 儲存與回覆 PowerPath組態
powermt save – 儲存目前 Powerpath組態
假使你因為測試或實做而修改了組態 , 你可以使用下面的指令儲存目前組態資訊 .
# powermt save它將會把組態資訊儲存在 /etc/powermt.custom 檔案裡 .它的內容如下:
# cat /etc/powermt.custom
global:version:5.3.0.0.0:4.1.0
path_c:sdd:sdd:qla2xxx:0x111
path_c:sde:sde:qla2xxx:0x111
adapter: 1: 1:qla2xxx:0x111:1:0:111:0:11:0
adapter: 2: 2:qla2xxx:0x111:1:0:111:0:111:0
arrPort_c:04000000:04000000:111:111
mpext_cfg:unused:Mp:0:symm:0:0
...
...
假使你要儲存母錢組態到其他檔案路徑 , 執行以下 :
# powermt save file=/etc/powermt.21-Aug-2010
powermt load – 載入先前儲存的 EMC PowerPath 組態設定
當你在測試組態的時候 , 假使不滿意新的組態 , 你可以透過以下指令 , 定先前的組態備份檔 ,來回復設定列如 :
# powermt load file=/etc/powermt.21-Aug-2010