Create PSP rule for HPE 3PAR

Create PSP rule for HPE 3PAR

There are a few best practices when implementing a 3PAR into a vSphere environment. One of these is the creation of a custom PSP-rule. With this set, all 3PAR volumes are automatically configured according to best practices when they get mounted. In this post I will show ways to create this rule. 

[Update] Because HPE Primera uses same vendor and model description as 3PAR, the information in this post works for Primera too! 

These are the arguments you need to create the rule:

  • Storage Array Type Plug-in (SATP): VMW_SATP_ALUA
  • Path Selection Policy (PSP): VMW_PSP_RR
  • IOps based PSP-Option: iops=1
  • Claiming option: tpgs_on
  • Vendor: 3PARdata
  • Model: VV
  • Description

The classic way is by using esxcli in ESXi. You can use direct console, SSH or vMA to run esxcli.

  • Create rule
    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 Rule"
  • The check rule after creation, run
    esxcli storage nmp satp rule list | grep "3PARdata

An other way is to use PowerCLI. With PowerCLI you can use get-esxcli to do the job. Cmdlet get-esxcli is available in two versions (V1 and V2 since vSphere 5.0). When using V1, arguments are recognized by location in the command. With V2 arguments are named (as hashtable).

Use these commands to use V1:

  • Create esxcli-Instance
    $esxcli = Get-VMHost | Get-EsxCli
  • Check rule
    esxcli.storage.nmp.satp.rule.list() | where {$_.vendor -eq "3PARdata"}
  • Create rule
    $esxcli.storage.nmp.satp.rule.add($null, "tpgs_on", "HP 3PAR Custom Rule", $null, $null, $null, "VV", "iops=1", "VMW_PSP_RR", $null, "VMW_SATP_ALUA", $null, $null, "3PARdata")
  • If you have to remove the rule, run:
    $esxcli.storage.nmp.satp.rule.remove($null, "tpgs_on", "HP 3PAR Custom Rule", $null, $null, "VV", "iops=1", "VMW_PSP_RR", $null, "VMW_SATP_ALU
    A", $null, $null, "3PARdata")

Use these commands to use V2:

  • Create esxcli-Instance
    $esxcli2 = Get-VMHost | Get-EsxCli -v2
  • Create the list of available arguments for the command you need. Adding a rule is just an example for this workflow.
    $rule_args = $esxcli2.storage.nmp.satp.rule.add.CreateArgs()
  • Fill the values
    $rule_args.pspoption="iops=1"
    $rule_args.description="HP 3PAR Custom Rule"
    $rule_args.vendor="3PARdata"
    $rule_args.model="VV"
    $rule_args.satp="VMW_SATP_ALUA"
    $rule_args.psp="VMW_PSP_RR"
    $rule_args.claimoption="tpgs_on"
  • Create rule
    $esxcli2.storage.nmp.satp.rule.add.Invoke($rule_args)
  • Alternatively you can shorten to just this command
    $esxcli2.storage.nmp.satp.rule.add.Invoke(@{"satp"="VMW_SATP_ALUA"; "vendor"="3PARdata"; "psp"="VMW_PSP_RR"; "model"="VV"; "pspoption"="iops=1"; "description"="HP 3PAR Custom Rule"; "claimoption"="tpgs_on"})
  • If you have to remove the rule, run:
    $esxcli2.storage.nmp.satp.rule.remove.Invoke($rule_args)
  • Check if rule exists
    $esxcli2.storage.nmp.satp.rule.list.Invoke() | where {$_.vendor -eq "3PARdata"}

Notes

  • For more information about implementing HPE 3PAR in vSphere environment, read HPE Implementation Guide.
  • If you need to create rules for other arrays, check this post to find the data you need for creation.

2 responses to “Create PSP rule for HPE 3PAR”

  1. […] create PSP rules using PowerCLI, look here (example for creating 3PAR […]

  2. […] Here I will show commands for a Nimble array as example. To find necessary information for your storage see my post here. For a more detailed example of creating PSP rule see my post for 3PAR (an active/active array) here. […]

Leave a Reply

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