29 October 2013 Jarret Lavallee

Recently I was working with a customer to install a new 3PAR array and migrate VMs to it. The 3PAR array will work with the default settings, but it has multiple best practices that should be followed to ensure the best performance and reliability. The best practices can be found in the HP 3PAR VMware ESX Implementation Guide. The main points are as follows.

  • Use Persona 11 for VMware LUNs on HP 3PAR OS 3.1.2 and above
  • Add a SATP rule to the ESX host to allow the following
    • Setting the default Path Selection Policy (PSP) to Round Robin (VMW_PSP_RR)
    • Setting the default Round Robin IOPS option to 1 instead of 1000
    • Setting the default SATP for 3PAR as ALUA (VMW_SATP_ALUA)

The best practice for the array is to add a new SATP rule on each host to allocate the correct SATP for the 3PAR LUNs. The other way would be to change the default PSP for the SATP which we covered in this post. Since we want to change the IOPS property and ensure that the new LUNs are claimed properly we will create the new SATP rule. The command for creating this SATP rule for host persona 11 is as follow.

# esxcli storage nmp satp rule add -s "VMW_SATP_ALUA" -P "VMW_PSP_RR" -O iops=1 -c "tpgs_on" -V "3PARdata" -M "VV" -e "HP 3PAR Custom iSCSI/FC/FCoE ALUA Rule"

For host persona 6 the following command would be run.

# esxcli storage nmp satp rule add -s "VMW_SATP_DEFAULT_AA" -P "VMW_PSP_RR" -O iops=1 -c "tpgs_off" -V "3PARdata" -M "VV" -e "HP 3PAR Custom iSCSI/FC/FCoE ALUA Rule"

The difference between the rules is that host persona 11 is ALUA, where as host persona 6 is Active/Active. This post explains ALUA in further detail.

Logging into each ESXi host to create the rule does not seem like a good use of time, so I went looking for some better ways of creating these rules with out having to do it manually. There are multiple ways of adding these rules including Host Profiles, PowerCli, vCLI

I went searching around for a solution for PowerCli and found this article, it talks about the best practices on the 3PAR and adds some PowerCli scripts to configure these for the 3PAR. Unfortunately the article gives a PowerCli Script that changes the properties on each LUN instead of adding the SATP rule to the ESXi host. While this will work for the existing LUNs, we want it to be the default on all new LUNs as well, so we want a global change rather than a LUN specific change. So I did a little digging into the PowerCli Get-Esxcli command and found the syntax for the command. This article gives some example PowerCli scripts using Get-Esxcli. Unfortunately I did not find an example with the syntax for the command that I wanted, so I went to the command line and queried the Get-Esxcli command for the esxcli storage nmp satp rule add command. We can see the options below.

boolean add(boolean boot, string claimoption, string description, string device, string driver, boolean force, string model, string option, string psp, string pspoption, string satp, string transport, string type, string vendor)

So we need to fill in the appropriate values for our SATP rule and send in $null for the options we want to omit. I came up with the following command to add the rule as per the best practices.

PowerCLI C:\> $esxcli.storage.nmp.satp.rule.add($null,"tpgs_on","HP 3PAR Custom iSCSI/FC/FCoE ALUA Rule",$null,$null,$null,"VV",$null,"VMW_PSP_RR","iops=1","VMW_SATP_ALUA",$null,$null,"3PARdata")
true

As you can see in the example above, it returned true when I ran the command. I do not really trust this, so I need to confirm that the rule actually exists. Let’s verify that the rule was put in place. The command below will look for any SATP rules that have 3PAR in the description.

PowerCLI C:\> $esxcli.storage.nmp.satp.rule.list() | where {$_.description -like "*3par*"}


ClaimOptions : tpgs_on
DefaultPSP   : VMW_PSP_RR
Description  : HP 3PAR Custom iSCSI/FC/FCoE ALUA Rule
Device       :
Driver       :
Model        : VV
Name         : VMW_SATP_ALUA
Options      :
PSPOptions   : iops=1
RuleGroup    : user
Transport    :
Vendor       : 3PARdata

Great that worked, but I have no interest in running this manually on each host, so I wrote up a small script to add it to every host. Please note that I am not an expert in PowerCLi, so there may be some much better ways to implement this script. Let me know if you have a better script and I will post it up here. Note that this script does not do any error checking. If the rule exists, it will try to add it and will fail because the rule already exists.

#Variables
$cluster = "NYC Production"

foreach($esx in Get-Cluster $cluster | Get-VMHost){
    $esxcli = Get-EsxCli -VMHost $esx
    # List HP SATP rules
    # $esxcli.storage.nmp.satp.rule.list() | where {$_.description -like "*HP*"}
    # Create A new satp rule for 3PAR
    $result = $esxcli.storage.nmp.satp.rule.add($null,"tpgs_on","HP 3PAR Custom iSCSI/FC/FCoE ALUA Rule",$null,$null,$null,"VV",$null,"VMW_PSP_RR","iops=1","VMW_SATP_ALUA",$null,$null,"3PARdata")
    # List 3PAR Rules
    # $esxcli.storage.nmp.satp.rule.list() | where {$_.description -like "*3par*"}
     Write-Host "Host:", $esx.Name, "Result", $result
}

Running this basic script worked for this environment. All LUNs were claimed properly and with the correct SATP, PSP, and PSP properties.


blog comments powered by Disqus