Blog

PowerCli script to enhance ESXi host for EMC Xtreme IO

I am working with a customer at the moment who will be upgrading their xTreme IO to v4 which is destructive upgrade and means all the data will be lost. As this is a boot from SAN environment that means we will need to rebuild all of the hosts, but EMC have a number of recommendations to set certain variables and configure some settings, to make the application of these changes simpler I have written a script to apply them per host on a cluster basis. I created the script to run from within powercli so I would have already connected to the vCenter at this point but if you just want to run the script add the variables to login to vcenter and the disconnected etc.

 

 

$hosts = get-cluster "clustername" | get-vmhost | sort name
foreach ($VMhost in $hosts){
$esxcli = get-esxcli -vmhost $VMhost
#SATP rule - create a SATP rule to change paths after each IO
$esxcli.storage.nmp.satp.rule.add($null,"tpgs_off","XtremIO Active/Active",$null,$null,$null,"XtremApp",$null,"VMW_PSP_RR","iops=1","VMW_SATP_DEFAULT_AA",$null,$null,"XtremIO")
#Advanced settings Consecutive IOs and max IO size
$VMhost | get-AdvancedSetting -Name "disk.SchedQuantum" | set-AdvancedSetting -Value "64" -Confirm:$false
$VMhost | get-AdvancedSetting -Name "disk.diskmaxiosize" | set-AdvancedSetting -Value "4096" -Confirm:$false
#VAAI
$VMhost | get-AdvancedSetting -Name "datamover.hardwareacceleratedmove" | set-AdvancedSetting -Value "1" -Confirm:$false
$VMhost | get-AdvancedSetting -Name "datamover.hardwareacceleratedinit" | set-AdvancedSetting -Value "1" -Confirm:$false
$VMhost | get-AdvancedSetting -Name "vmfs3.hardwareacceleratedlocking" | set-AdvancedSetting -Value "1" -Confirm:$false
# VAAI XCOPY transfer size
$VMhost | get-AdvancedSetting -Name "DataMover.MaxHWTransferSize" | set-AdvancedSetting -Value "0256" -Confirm:$false
#Per naa device Set the SchedNumReqOutstanding
$esxcli.storage.core.device.set($null,"naa.xxxxxxxxxxx", $null, $null, $null, $null, $null, 256, $null)
$esxcli.storage.core.device.set($null,"naa.xxxxxxxxxxx", $null, $null, $null, $null, $null, 256, $null)
$esxcli.storage.core.device.set($null,"naa.xxxxxxxxxxx", $null, $null, $null, $null, $null, 256, $null)
$esxcli.storage.core.device.set($null,"naa.xxxxxxxxxxx", $null, $null, $null, $null, $null, 256, $null)
$esxcli.storage.core.device.set($null,"naa.xxxxxxxxxxx", $null, $null, $null, $null, $null, 256, $null)
$esxcli.storage.core.device.set($null,"naa.xxxxxxxxxxx", $null, $null, $null, $null, $null, 256, $null)
$esxcli.storage.core.device.set($null,"naa.xxxxxxxxxxx", $null, $null, $null, $null, $null, 256, $null)
$esxcli.storage.core.device.set($null,"naa.xxxxxxxxxxx", $null, $null, $null, $null, $null, 256, $null)
$VMhost | restart-VMHost -confirm:$false
}

Leave a Comment

Your email address will not be published. Required fields are marked *