powermt 命令簡介
PowerPath 將多路徑 I/O 功能、自動負載平衡和路徑故障切換功能集成於一身,使存儲管理更加輕松。本文總結了 PowerPath 常用命令的使用方法操作注意事項,為主機系統管理員對 HBA/ 路徑 / 端口 / 磁盤設備 / 存儲系統執行配置、查看、刪除、保存、恢復等操作提供參考。
powermt 語法
[root@ora27 ~]# powermt -h
Usage:
powermt <command>
[class={all|symm|vnx|clariion|vplex|invista|netapp|hitachi|hpxp|ess|xtremio|generic}]
powermt check [hba=<hba#>|all] [dev=<path>|<device>|all] [class=<class>|all]
[force]
powermt check_registration
powermt config
powermt disable hba=<hba#>
powermt display [dev=<device>|all] [class=<class>|all] [every=<#seconds>]
[wide|width=<#col>]
powermt display alua dev=<device>|all [class=<class>|all] [every=<#seconds>]
[wide|width=<#col>]
powermt display hba_mode [class=<class>|all]
powermt display latency [dev=<device>|all] [class=<class>|all]
[every=<#seconds>] [wide|width=<#col>]
powermt display nonvirtual dev=<device>|all
[every=<#seconds>] [class=<class>|all] [wide|width=<#col>]
powermt display options
powermt display bus [class=<class>|all] [every=<#seconds>]
[wide|width=<#col>]
powermt display perf dev=<device>|all [continuous] [verbose] [xml] [nowait]
powermt display perf bus [continuous] [verbose] [xml] [nowait]
powermt display port_mode [class=<class>|all]
powermt display ports [dev=<device>|all] [class=<class>|all]
[every=<#seconds>] [wide|width=<#col>]
powermt display unmanaged
powermt enable hba=<hba#>
powermt help [<command>]
powermt load [file=<filename>]
powermt manage dev=<path>|<device> | class=<class>
powermt release
powermt remove hba=<hba#>|all | dev=<path>|<device>|all [class=<class>|all]
[force]
powermt restore [hba=<hba#>|all] dev=<path>|<device>|all [class=<class>|all]
powermt save [file=<filename>]
powermt set all_paths_dead_retry_timeout={default|<#seconds>} [class=<class>|all]
powermt set autostandby={on|off|reinitialize}
[trigger={prox|iopf}]
powermt set autostandby iopflimit=<value>
powermt set autostandby agingperiod={<#days>|<#hours>h|<#hours>H}
powermt set auto_host_registration={on|off}
powermt set mode={active|standby} [hba=<hba#>|all]
[dev=<path>|<device>|all] [class=<class>|all] [force]
powermt set path_latency_monitor={on|off}
powermt set path_latency_threshold=<#seconds>|<#milliseconds>ms
powermt set path_retry_timeout={default|<#seconds>} [class=<class>|all]
powermt set perfmon={on [interval=<#seconds>] | off}
powermt set periodic_autorestore={on|off} [class=<class>|all]
powermt set policy={ad|co|lb|li|re|rr|so|si}
[dev=<device>|all] [class=<class>|all]
powermt set port_disable={on|off} dev=<device>
powermt set reactive_autorestore={on|off} [class=<class>|all]
powermt set streamio_threshold=<threshold_count>
[dev=<device>|all] [class=<class>|all]
powermt set port_mode={active|standby} dev=<path> [force]
powermt unmanage dev=<path>|<device> | class=<class>
powermt update lun_names
powermt version
[root@ora27 ~]#
更多信息
power check
功能:檢查 PowerPath 配置
平台:所有 PowerPath 平台
存儲系統:所有存儲系統
格式: powermt check
[class=symm|clariion|ess|hitachi|hpxp|hphsx|invista|all][force][reconfig]
注釋:對路徑進行檢查,並在需要的情況下從 PowerPath 配置中中刪除標記為 dead 的路徑。
如果路徑標記為 dead 或路徑配置信息中的序列號與本地設備序列號不符,則出現如下提示用戶刪除路徑:
Warning: storage_system I/O path path_name is dead.
Do you want to remove it (y/n/a/q)?
y :刪除 dead path , 並繼續檢查剩余路徑;
n :不刪除 dead path ,但繼續檢查剩余路徑;
a :刪除 dead path 以及后續所有標記為 dead 的路徑;
q :不刪除 dead path 並退出該命令。已刪除路徑保持刪除狀態。
參數:
class=symm|clariion|ess|hitachi|hpxp|hphsx|invista|all :限制命令檢查指定存儲類型,默認為 all ;
force :禁止出現確認提示並刪除所有標記為 dead 的路徑;
hba=hba#|all :限制檢查指定的 HBA 。默認為 all ;
dev=path|device|all :限制檢查指定的 path ,或指定 device 的所有 path 。默認為 all 。
reconfig :重新配置不匹配路徑。該命令只對 Windows 和 Solaris 有效。
powermt check_registration
功能:檢查 license 信息
平台:所有 PowerPath 平台
存儲系統:所有存儲系統
格式: powermt check_registration
注釋:檢查主機上 PowerPath license 信息:有效、過期、無效或沒有 license 。
powermt config
功能:為邏輯設備配置路徑
平台: UNIX 和 Linux 平台
存儲系統:所有存儲系統
格式: powermt config
注釋:將檢測到的所有 Symmetrix 和 Clariion 邏輯磁盤設備配置為 PowerPath 磁盤設備並將它們加入 PowerPath 配置,同時對所支持的第三方存儲系統邏輯設備。
該命令同時將所有檢測到的路徑配置給 PowerPath 磁盤設備並將這些路徑加到 PowerPath 配置中。
之前配置的路徑成為 dead path 時該命令不會將其刪除。
powermt disable hba
功能:禁用 HBA 端口
平台: AIX 和 Solaris 的光纖通道, HP-UX 的 iSCSI 和光纖通道, Linux 的 iSCSI 和光纖通道
存儲系統:所有存儲系統
格式: powermt disable hba=hba
注釋:禁用指定 HBA 配置的所有路徑。停止端口上所有 I/O ,關閉端口配置的所有磁盤設備。
用戶在更換 HBA 停止其上的 I/O 時需執行此命令。禁用 HBA 端口后,所有通過 HBA 端口配置的路徑在命令 powermt display dev=device 的輸出中被打上 Dead 標簽。
注意如下限制條件:
· 禁用的 HBA 在主機重啟后將不再存在;
· 如果 PowerPath 負載均衡和 failover 策略為 bf 或 nr 時此命令會返回失敗。
查看 HBA 狀態為禁用或激活,使用命令 powermt display hba_mode 。
參數:
hba=hba : 使用主機上 HBA ID 來禁用指定 HBA 端口,例如: 1280 。
powermt display
功能:監控 HBA 和磁盤設備
平台:所有 PowerPath 平台
存儲系統:所有存儲系統
格式:
powermt display [paths|ports]
[class=symm|clariion|ess|hitachi|hpxp|hphsx|invista|all]
powermt display [ports] [dev=device|all]
[class=symm|clariion|ess|hitachi|hpxp|hphsx|invista|all]
參數:
paths :每一行顯示一條路徑信息
[root@irora27 ~]# powermt display paths
Symmetrix logical device count=26
==============================================================================
----- Host Bus Adapters --------- ------ Storage System ----- - I/O Paths -
### HW Path ID Interface Total Dead
==============================================================================
4 lpfc 000498700534 FA 2e:00 26 0
4 lpfc 000498700534 FA 1e:00 26 0
5 lpfc 000498700534 FA 2g:00 26 0
5 lpfc 000498700534 FA 1g:00 26 0
[root@irora27 ~]#
行顯示一條端口信息
[root@irora27 ~]# powermt display ports
Storage class = Symmetrix
==============================================================================
----------- Storage System --------------- -- I/O Paths -- --- Stats ---
ID Interface Wt_Q Total Dead Q-IOs Errors
==============================================================================
000498700534 FA 2g:00 256 26 0 0 0
000498700534 FA 1g:00 256 26 0 0 0
000498700534 FA 2e:00 256 26 0 0 0
000498700534 FA 1e:00 256 26 0 0 0
[root@irora27 ~]#
dev=device|all :顯示指定磁盤設備信息, all 顯示所有磁盤設備。
class=symm|clariion|ess|hitachi|hpxp|hphsx|invista|all :列出指定存儲系統信息, all 顯示所有存儲系統。默認為 all 。
[root@ora27 ~]# powermt display dev=all |head -n42
Pseudo name=emcpowera
Symmetrix ID=000498700534
Logical device ID=036D
Device WWN=60000970000498700534533030333644
state=alive; policy=SymmOpt; queued-IOs=0
==============================================================================
--------------- Host --------------- - Stor - -- I/O Path -- -- Stats ---
### HW Path I/O Paths Interf. Mode State Q-IOs Errors
==============================================================================
5 lpfc sdck FA 2g:00 active alive 0 0
5 lpfc sdbo FA 1g:00 active alive 0 0
4 lpfc sdas FA 2e:00 active alive 0 0
4 lpfc sdw FA 1e:00 active alive 0 0
Pseudo name=emcpowerb
Symmetrix ID=000498700534
Logical device ID=02F1
Device WWN=60000970000498700534533030324631
state=alive; policy=SymmOpt; queued-IOs=0
==============================================================================
--------------- Host --------------- - Stor - -- I/O Path -- -- Stats ---
### HW Path I/O Paths Interf. Mode State Q-IOs Errors
==============================================================================
5 lpfc sdcj FA 2g:00 active alive 0 0
5 lpfc sdbn FA 1g:00 active alive 0 0
4 lpfc sdar FA 2e:00 active alive 0 0
4 lpfc sdv FA 1e:00 active alive 0 0
Pseudo name=emcpowerc
Symmetrix ID=000498700534
Logical device ID=02ED
Device WWN=60000970000498700534533030324544
state=alive; policy=SymmOpt; queued-IOs=0
==============================================================================
--------------- Host --------------- - Stor - -- I/O Path -- -- Stats ---
### HW Path I/O Paths Interf. Mode State Q-IOs Errors
==============================================================================
5 lpfc sdci FA 2g:00 active alive 0 0
5 lpfc sdbm FA 1g:00 active alive 0 0
4 lpfc sdaq FA 2e:00 active alive 0 0
4 lpfc sdu FA 1e:00 active alive 0 0
[root@ora27 ~]#
powermt display hba_mode
功能:監控 HBA 模式
平台: UNIX 和 Linux 平台
存儲系統:所有存儲系統
格式: powermt display hba_mode
注釋:顯示主機上配置所有 HBA 信息。列出 HBA 的激活或禁用狀態。
[root@irora27 ~]# powermt display hba_mode
Symmetrix logical device count=26
==============================================================================
----- Host Bus Adapters --------- ------ I/O Paths ----- Stats
### HW Path Summary Total Dead Q-IOs Mode
==============================================================================
4 lpfc optimal 52 0 0 Enabled
5 lpfc optimal 52 0 0 Enabled
[root@irora27 ~]#
powermt display port_mode
功能:顯示存儲系統端口模式
平台: UNIX 和 Linux 平台
存儲系統:所有存儲系統
格式: powermt display port_mode dev=device
注釋:顯示主機上配置所有端口模式信息。列出 HBA 的激活或禁用狀態。
參數:
dev=device : 指定需要查看的磁盤設備端口。磁盤設備名需為 native 設備名。
[root@irora27 ~]# powermt display port_mode
Storage class = Symmetrix
==============================================================================
----------- Storage System --------------- -- I/O Paths -- --- Stats ---
ID Interface Wt_Q Total Dead Q-IOs Mode
==============================================================================
000498700534 FA 2g:00 256 26 0 0 Enabled
000498700534 FA 1g:00 256 26 0 0 Enabled
000498700534 FA 2e:00 256 26 0 0 Enabled
000498700534 FA 1e:00 256 26 0 0 Enabled
[root@irora27 ~]#
powermt enable hba
功能:激活 HBA 端口
平台: AIX 和 Solaris 的光纖通道, HP-UX 的 iSCSI 和光纖通道, Linux 的 iSCSI 和光纖通道
存儲系統:所有存儲系統
格式: powermt enable hba=hba
注釋:激活之前禁用的 HBA 端口。運行此命令恢復指定 HBA 端口及其磁盤設備的 I/O 。如果 PowerPath 負載均衡及 failover 模式為 bf 或 nr 則命令會返回失敗。
參數:
hba=hba 激活指定 hba 端口。
powermt load
功能:加載用戶配置
平台:所有 PowerPath 平台
存儲系統:所有存儲系統
格式: powermt load
[class=symm|clariion|ess|hitachi|hpxp|hphsx|invista|all]
[file=pathname]
注釋:將以下內容從已保存的配置文件讀出並應用於當前配置: PowerPath 磁盤設備策略和優先級;寫閥值設定和寫隊列深度;周期性自動還原設定和路徑模式。
如果配置是由 powermt save 命令保存在默認文件名,在系統啟動時將會自動加載該配置,( AIX 除外,總是在啟動時加載默認配置);如果沒有使用默認文件名,配置不會在啟動時自動加載,用戶需使用 powermt load 命令手動加載配置。
參數:
class=symm|clariion|ess|hitachi|hpxp|hphsx|invista|all :將命令限制在指定存儲系統,默認為 all 。
file=pathname :保存配置文件的全路徑名。
powermt manage
功能:將磁盤設備或存儲系統放入 PowerPath 管理
平台: UNIX 和 Linux 平台
存儲系統:所有存儲系統
格式: powermt manage {dev=device|
class={symm|clariion|hitachi|hpxp|hphsx|invista|ess}}
注釋:默認情況下,所有存儲系統都在 PowerPath 管理下。用戶可使用 powermt unmanage 使存儲系統不受 PowerPath 管理。當存儲系統在 PowerPath 管理下默認其所有邏輯磁盤設備都由 PowerPath 管理。使用 powermt unmanage 命令之后可使用此命令恢復 PowerPath 對磁盤設備的管理。
參數:
dev=device : 指定需由 PowerPath 管理的邏輯磁盤設備路徑名。
class=symm|clariion|hitachi|hpxp|hphsx|invista|ess :指定需由 PowerPath 管理的存儲系統名。
powermt release
功能:釋放偽磁盤設備名供重用
平台: Linux 平台
存儲系統:所有存儲系統
格式: powermt release
注釋:在多次添加和刪除 LUN 配置之后, Linux 主機和 PowerPath 能夠發現所有設備,但 PowerPath 已經用完磁盤設備的偽設備名時,運行此命令。
powermt remove
功能:從 PowerPath 管理中刪除路徑
平台:所有 PowerPath 平台
存儲系統:所有存儲系統
格式: powermt remove
[class=symm|clariion|ess|hitachi|hpxp|hphsx|invista|all]
[force] hba=hba#|all | dev=path|device|all
注釋:從 PowerPath 配置路徑列表中刪除指定路徑。此命令不刪除路徑涉及的磁盤設備。只要邏輯設備在系統中可見,就可用 powermt config 命令對邏輯設備進行配置。
在所有平台上,如果 native 路徑是打開狀態,那么此命令無法將其刪除,例如,一個文件系統加載在路徑磁盤設備上,或一個應用程序已將該路徑磁盤設備打開。此命令刪除所有指定並且不是打開狀態的路徑。
如果 PowerPath 磁盤設備是打開的,此命令不會刪除該磁盤設備以及該設備的最后一條路徑。
從 PowerPath 配置中永久刪除一條路徑:
\1. 運行 powermt check 或 powermt remove ;
\2. 物理上刪除該路徑;
\3. 刪除與路徑和 / 或磁盤設備相關的操作系統對象;
\4. 運行 powermt save 。
參數:
class=symm|clariion|ess|hitachi|hpxp|hphsx|invista|all :將命令限制在指定存儲系統,默認為 all 。
force :不彈出確認對話並刪除所有指定路徑,包括邏輯設備的最后一條路徑。
hba=hba#|all :移除指定 HBA 的路徑,默認為 all 。
dev=path|device|all :移除指定路徑,或連接指定磁盤設備的路徑,默認為 all 。
powermt restore
功能:恢復路徑
平台:所有 PowerPath 平台
存儲系統:所有存儲系統
格式: powermt restore
[class=symm|clariion|ess|hitachi|hpxp|hphsx|invista|all]
[hba=hba#|all] [dev=path|device|all]
注釋:此命令測試並恢復指定路徑,發出測試 I/O 並針對測試結果作出反應如下:
· 如果 live 路徑通過測試,則此命令不做任何操作;
· 如果 dead 路徑通過測試,此命令將其標識為 alive 狀態; PowerPath 此時可以使用該路徑;此外,同一 HBA 和 / 或存儲系統端口上的其他路徑也將被測試。
· 如果 live 路徑測試失敗,此命令將其標識為 dead 並打印告警。此外,共享 HBA 和端口的其他路徑也可能標示為 dead 並被測試。
· 如果 dead 路徑測試失敗,此命令會打印告警。
此外,該命令還會嘗試復活 dead 卷:
參數:
class=symm|clariion|ess|hitachi|hpxp|hphsx|invista|all :將命令限制在指定存儲系統,默認為 all 。
hba=hba#|all :恢復指定 HBA 的路徑,默認為 all 。
dev=path|device|all :恢復指定路徑,或連接指定磁盤設備的路徑,默認為 all 。
powermt save
功能:保存用戶配置
平台:所有 PowerPath 平台
存儲系統:所有存儲系統
格式: powermt save [file=pathname]
注釋:默認情況下,此命令保存 powermt.custom 文件中的 PowerPath 配置。用戶可指定其他文件名。對邏輯設備,命令記錄它的序列號,策略,優先級,寫閥值和隊列,以及偽設備名。對路徑,命令記錄它的模式。對存儲系統,此命令記錄它的周期性自動還原設定。
配置被保存后可用 powermt load 命令加載。
參數:
file=pathname :保存配置的文件路徑名。
如果配置保存在默認文件名,之前的配置文件都會被覆蓋。
無論何時用戶對主機硬件作出改動,都要運行此命令來更新 PowerPath 配置。
powermt set mode
功能:設置路徑模式
平台:所有 PowerPath 平台
存儲系統:所有存儲系統
格式: powermt set mode=active|standby
[class=symm|clariion|ess|hitachi|hpxp|hphsx|invista|all]
[hba=hba#|all] [dev=path|device|all]
注釋:將路徑設置為 active 或 standby 狀態。
參數:
mode=active|standby :決定路徑能否傳送 I/O ,或是保留。
class=symm|clariion|ess|hitachi|hpxp|hphsx|invista|all :將命令限制在指定存儲系統,默認為 all 。
hba=hba#|all :設置指定 HBA 的路徑,默認為 all 。
dev=path|device|all :設置指定路徑,或連接指定磁盤設備的路徑的模式,默認為 all 。
powermt set policy
功能:設置負載均衡和 failover 策略
平台:所有 PowerPath 平台
存儲系統:所有存儲系統
格式: powermt set policy=li|lb|rr|re
[class=symm|clariion|ess|hitachi|hpxp|hphsx|invista|all]
[dev=device|all]
powermt set policy=si [dev=device|all]
powermt set policy=so|nr [dev=device|all]
powermt set policy=bf|co [dev=device|all]
powermt set policy=ad|nr
參數:
policy=ad|bf|co|lb|li|nr|re|rr|si|so : ad(adaptive), bf(basic failover), co(CLARIION optimization), lb(least blocks), li(least I/O), nr(no redirect), re(request), rr(round robin), si(streamIO), so(Symmetrix optimization)
class=symm|clariion|ess|hitachi|hpxp|hphsx|invista|all :將命令限制在指定存儲系統,默認為 all 。
dev=device|all :將命令限制在指定磁盤設備,默認為 all 。
參考
PowerPath 5.2 and 5.3 CLI Reference Guide