User guide
Technical white paper | HP Enterprise Virtual Array Storage and VMware vSphere 4.x and 5.x configuration best practices
56
Appendix B: Miscellaneous scripts/commands
This appendix provides scripts/utilities/commands for the following actions:
• Change the default PSP for VMW_SATP_ALUA.
• Set the I/O path policy and attributes for each Vdisk.
• Configure the disk SCSI timeout for Windows and Linux guests.
Changing the default PSP
This command changes the default PSP for VMW_SATP_ALUA:
For ESX 4.x:
esxcli nmp satp setdefaultpsp -s VMW_SATP_ALUA -P VMW_PSP_RR
For ESXi 5.x:
esxcli storage nmp satp set -s VMW_SATP_ALUA -P VMW_PSP_RR
Setting the I/O path policy and attributes
14
This script automatically sets the I/O path policy to round robin and also sets the I/O path attributes for each Vdisk:
Note
This script should only be used for environments with EVA Vdisks connected to vSphere 4.x/5.x servers.
For ESX 4.x
for i in 'esxcli nmp device list | grep ^naa.600';do esxcli nmp device setpolicy
-P VMW_PSP_RR -d $i;esxcli nmp roundrobin setconfig -t iops -I 1 -d $i; done
For ESXi 5.x
for i in 'esxcli storage nmp device list | grep ^naa.600';do esxcli storage nmp
device set -P VMW_PSP_RR -d $i;esxcli storage nmp psp roundrobin deviceconfig set
-t iops -I 1 -d $i;done
Configuring the disk SCSI timeout for Windows and Linux guests
Change the disk SCSI timeout setting to 60 seconds.
Windows guest
For a VM running Windows Server 2003
15
or earlier, change the value of the
HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services/Disk/TimeoutValue registry setting to 3c (that is, 60 expressed
in hexadecimal form).
A reboot is required for this change to take effect.
Linux guest
Use one of the following commands to verify that the SCSI disk timeout has been set to a minimum of 60 seconds:
cat /sys/bus/scsi/devices/W:X:Y:Z/timeout
or
cat /sys/block/sdX/device/timeout
14
When cutting and pasting the scripts referenced beware of hidden characters that may cause the scripts to fail. Allows copy in a text editor that will strip
hidden characters before running this script.
15
In Windows Server 2008, the SCSI timeout defaults to 60 seconds.