背景:
有时候,交换机因为不知名原因导致无法远程,这个时候又需要对交换机的端口进行操作,该怎么办呢,这个时候就可以通过命令控制ib交换机端口down/up,这个也便于批量down口
操作流程:
一、先通过iblinkinfo命令找到对应交换机的pid:
Switch: 0x0008f10500204815 Mellanox 4036E # 4036E-S1-234-10:
二、找到需要操作端口的交换机pid之后就可以对其进行操作了
#对应交换机的3口 down
[yanyaofeng@gz-cs-gpu-3-8 ~]$ ibportstate -G 0x0008f10500204815 3 disable
Initial Switch PortInfo:
# Port info: Lid 6 port 3
LinkState:.......................Active
PhysLinkState:...................LinkUp
Lid:.............................32
SMLid:...........................18453
LMC:.............................0
LinkWidthSupported:..............1X or 4X
LinkWidthEnabled:................1X or 4X
LinkWidthActive:.................4X
LinkSpeedSupported:..............2.5 Gbps or 5.0 Gbps or 10.0 Gbps
LinkSpeedEnabled:................2.5 Gbps or 5.0 Gbps or 10.0 Gbps
LinkSpeedActive:.................10.0 Gbps
Disable may be irreversible
After PortInfo set:
# Port info: Lid 6 port 3
LinkState:.......................Down
PhysLinkState:...................Disabled
Lid:.............................32
SMLid:...........................18453
LMC:.............................0
LinkWidthSupported:..............1X or 4X
LinkWidthEnabled:................1X or 4X
LinkWidthActive:.................4X
LinkSpeedSupported:..............2.5 Gbps or 5.0 Gbps or 10.0 Gbps
LinkSpeedEnabled:................2.5 Gbps or 5.0 Gbps or 10.0 Gbps
LinkSpeedActive:.................2.5 Gbps
总结:
方法还是往往会比困难多,思维多发散,从不同角度去洞察问题,解决问题。