近来对IDC机房的服务器进行改造,为了提高IDC机房的服务器利用效率,决定采用Vmware虚拟化方案,在对服务器进行VSphere虚拟化迁移后发现业务服务器运行速度并没有在物理机上的时候的速度快,在网上找过相关的方案并咨询相关的技术人员,大家建议使用SSD硬盘做为Esxi的主机缓存方案。
自从vSphere 5.0发布后,VMware明确表明新版本的vSphere支持使用SSD做主机缓存,这样一来vSphere的主机速度会在之前的基础上大幅提升。
配置过程下面将介绍安装和配置SSD硬盘为vSphere主机缓存的主要过程:
将vSphere进入维护模式,然后远程将vSphere主机关机,然后切断主机电源,将SSD硬盘装到主机上,然后开机;
进入维护模式
通过vSphere连接到Exsi主机,点击然后切换到右面的“配置”选项卡中。点击“软件”一栏中的“主机缓存配置”,然后在界面中选择需要配置的SSD硬盘, 右键点击”属性“将“分配存储空间”前的复选框选中,然后确定这样就可以实现用SSD硬盘为Exsi主机应用加速。
主机缓存配置
分配主机缓存空间
问题处理在添加SSD时,出现Esxi主机无法识别SSD硬盘, 将SSD硬盘识别为普通的硬盘, 以下是相关的处理过程:
(1). 登录到Esxi主机, 打开Esxi命令行(Enable SSH)模式;
(2). 通过SSH客户端,登录到Esxi 主机;
(3). 执行如下命令来查看ESXi 5.x识别到的设备列表,执行如下命令
# 查看Esxi主机中的设备列表 ~ bash 4.3$ esxcli storage nmp device list mpx.vmhba1:C0:T2:L0 Device Display Name: Local VMware Disk (mpx.vmhba1:C0:T2:L0) Storage Array Type: VMW_SATP_LOCAL Storage Array Type Device Config: SATP VMW_SATP_LOCAL does not support device configuration. Path Selection Policy: VMW_PSP_FIXED Path Selection Policy Device Config: {preferred=vmhba1:C0:T2:L0;current=vmhba1:C0:T2:L0} Path Selection Policy Device Custom Config: Working Paths: vmhba1:C0:T2:L0 Is Local SAS Device: false Is USB: false Is Boot USB Device: false mpx.vmhba1:C0:T1:L0 Device Display Name: Local VMware Disk (mpx.vmhba1:C0:T1:L0) Storage Array Type: VMW_SATP_LOCAL Storage Array Type Device Config: SATP VMW_SATP_LOCAL does not support device configuration. Path Selection Policy: VMW_PSP_FIXED Path Selection Policy Device Config: {preferred=vmhba1:C0:T1:L0;current=vmhba1:C0:T1:L0} Path Selection Policy Device Custom Config: Working Paths: vmhba1:C0:T1:L0 Is Local SAS Device: false Is USB: false Is Boot USB Device: false mpx.vmhba1:C0:T0:L0 Device Display Name: Local VMware Disk (mpx.vmhba1:C0:T0:L0) Storage Array Type: VMW_SATP_LOCAL Storage Array Type Device Config: SATP VMW_SATP_LOCAL does not support device configuration. Path Selection Policy: VMW_PSP_FIXED Path Selection Policy Device Config: {preferred=vmhba1:C0:T0:L0;current=vmhba1:C0:T0:L0} Path Selection Policy Device Custom Config: Working Paths: vmhba1:C0:T0:L0 Is Local SAS Device: false Is USB: false Is Boot USB Device: false mpx.vmhba32:C0:T0:L0 Device Display Name: Local NECVMWar CD-ROM (mpx.vmhba32:C0:T0:L0) Storage Array Type: VMW_SATP_LOCAL Storage Array Type Device Config: SATP VMW_SATP_LOCAL does not support device configuration. Path Selection Policy: VMW_PSP_FIXED Path Selection Policy Device Config: {preferred=vmhba32:C0:T0:L0;current=vmhba32:C0:T0:L0} Path Selection Policy Device Custom Config: Working Paths: vmhba32:C0:T0:L0 Is Local SAS Device: false Is USB: false Is Boot USB Device: false记录要修改的硬盘 VMW_SATP_XXXX 和 naa.xxxxxxxxxx 的值.
(4). 在需要将之配置为SSD盘的设备上,执行如下命令
~ bash 4.3$ esxcli storage nmp satp rule add -s VMW_SATP_LOCAL --device mpx.vmhba1:C0:T1:L0 --option="enable_ssd"命令参数说明:
s – The SATP for which a new rule will be added.
d – Set the device when adding SATP claim rules.
o – Set the option string when adding a SATP claim rule.
(5). 最后回收一下设备,执行如下命令:
~ bash 4.3$ esxcli storage core claiming reclaim -d mpx.vmhba1:C0:T1:L0如果无法claim设备,可能是设备存在unclaim状态,可以通过以下命令对设备进行unclaim操作, 操作后再重新加载claim规则:
# Unclaim Device ~ bash 4.3$ esxcli storage core claiming unclaim --type device -d mpx.vmhba1:C0:T1:L0 # Reload Claim Rules ~ bash 4.3$ esxcli storage core claimrule load ~ bash 4.3$ esxcli storage core claimrule run若无法回收设备,请安全重启即可。