配置命令来源自Broadcom的VMware架构师William Lam
注意:以下仅为参考,更改配置前最好先咨询VMware原厂
下面只是一些ESXi FC多路径管理和优化的配置建议
ESXi FC路径管理优化
为了保证路径稳定性,在transient error发生时,避免切换到错误较多的路径:
#esxcfg-advcfg -s 0 /NmpManageDegradedPaths
#esxcfg-advcfg -s 0 /HppManageDegradedPaths
当 transient error 达到 20% 时,禁用路径状态切换至 degraded:
#esxcfg-advcfg -s 0 /Misc/NmpDegradedPathThresholdPer
#esxcfg-advcfg -s 0 /Misc/HppDegradedPathThresholdPer
为了让ESXi更快检测到路径恢复,建议将重新查询周期从默认的20秒降至5秒:
#esxcfg-advcfg -s 5 /Nmp/NmpSatpAluaCmdRetryTime
这个参数默认配置为20,最大可以调整为50,最小为0。
查看当前配置:
#esxcfg-advcfg -g /Nmp/NmpSatpAluaCmdRetryTime
![](https://vmlib.com/wp-content/uploads/2025/02/image-13.png)
ESXi FC设备重置优化
如果设备多次丢失连接且无法自动恢复,建议缩短 reset period (默认30秒,建议调整为10秒):
#esxcfg-advcfg -s 10 /Disk/ResetPeriod
若问题持续,可手动禁用 All-Paths-Down (APD) 处理 (具体可参考 VMware 官方文档):
#esxcfg-advcfg -s 0 /Misc/APDHandlingEnable
NativeMultipathPlugin (NMP) 配置优化
为避免性能下降,建议对 路径切换策略 设定 IOPS 或 Bytes 阈值 (详细信息可参考 VMware 官方文档):
- IOPS 设定 (推荐值:100 或 200):
#esxcli storage nmp psp roundrobin deviceconfig set --type=iops --iops=<100or200> --device=eui.<LUN_number>
- Bytes 设定 (推荐值:1024 或 2048):
# esxcli storage nmp psp roundrobin deviceconfig set --type=bytes --bytes=<1024or2048> --device=eui.<LUN_number>
批量配置LUN设备
如果系统包含大量LUN,可使用Shell脚本进行批量配置:
批量设置 IOPS:
for i in esxcfg-scsidevs -c |awk '{print $1}' | grep eui.
; do esxcli storage nmp psp roundrobin deviceconfig set --type=iops --iops=<100or200> --device=$i; done
批量设置 Bytes:
for i in esxcfg-scsidevs -c |awk '{print $1}' | grep eui.
; do esxcli storage nmp psp roundrobin deviceconfig set --type=bytes --bytes=<1024or2048> --device=$i; done
![](https://vmlib.com/wp-content/uploads/2025/02/image-14-1024x383.png)
本文介绍了如何优化ESXi FC多路径配置,以提高存储系统的稳定性和性能。通过调整路径管理、设备重置周期和NativeMultipathPlugin (NMP) 配置,可以有效避免路径切换引起的性能波动,并保证在发生transient error时的系统稳定性。这些配置不仅适用于一般的FC存储环境,也能够在高负载的虚拟化平台中提供更高的容错能力。
如果您在使用ESXi的过程中遇到性能瓶颈或路径管理相关问题,可以参考本文中的配置命令进行优化。建议在修改配置之前,先咨询VMware原厂或专业技术支持,确保配置与系统环境的兼容性。