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.

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"}
Advertisements
Create PSP rule for HPE 3PAR

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s