Dell PowerStore pstcli: Volume Provisioning Guide - 夜莺博客

Dell PowerStore pstcli: Volume Provisioning Guide

PowerStore keeps a REST API at the centre of the product and exposes the same object model through pstcli, so anything you do in the GUI can be scripted from a shell. The action/object pattern (create /volume, show /host) is consistent across the array, which makes it quick to learn and easy to automate. This guide walks a full provisioning sequence and the verification steps that confirm the host actually sees the LUN.

Connecting

pstcli -d 10.20.30.40 -u admin -p 'MyPassword' -header
# interactive shell with the same session
pstcli -d 10.20.30.40 -u admin -p 'MyPassword'

If login fails, confirm the management IP is reachable, the admin account is not locked, and the array's management interface is up. pstcli: command not found means the CLI package is not installed or its directory is not in PATH.

Creating a volume

pstcli -d 10.20.30.40 -u admin -p 'MyPassword' volume create -name vol-prod-db01 -size 1073741824
pstcli -d 10.20.30.40 -u admin -p 'MyPassword' volume show
pstcli -d 10.20.30.40 -u admin -p 'MyPassword' volume -id 12345 show

Size is specified in bytes, so script the arithmetic rather than typing zeros – one missing zero is a 100 GB volume that was supposed to be 1 TB. PowerStore provisions thin by default, which is what you want for most workloads; thick provisioning is the exception, for latency-sensitive databases where you do not want allocation happening during writes.

Hosts and initiators

pstcli -d 10.20.30.40 -u admin -p 'MyPassword' host create -name esx-prod-01 -os_type "VMware ESXi" -initiators "20:00:00:25:b5:01:ac:0c"
pstcli -d 10.20.30.40 -u admin -p 'MyPassword' host_group create -name grp-db -host_ids "host-5f8c2a1b-4e9d-11ed-a8c0-005056"
pstcli -d 10.20.30.40 -u admin -p 'MyPassword' host show
pstcli -d 10.20.30.40 -u admin -p 'MyPassword' host_group show

Use WWNs for Fibre Channel and IQNs for iSCSI, and match the OS type to the platform – it drives the initiator persona. For clusters, create the host group and put the mappings at the group level so every node sees the same LUNs and LUN IDs; inconsistent mapping across cluster nodes is the most common cause of "multipath sees half the paths".

Mapping the volume

pstcli -d 10.20.30.40 -u admin -p 'MyPassword' volume -id 12345 map -host_id host-5f8c2a1b-4e9d-11ed-a8c0-005056 -logical_unit_number 99
pstcli -d 10.20.30.40 -u admin -p 'MyPassword' volume -id 12345 show
pstcli -d 10.20.30.40 -u admin -p 'MyPassword' host_volume_mapping show

Pin explicit LUN numbers rather than letting the array choose: LUN 0 is already taken on many hosts, and a stable mapping survives rescan and reboots. After mapping, rescan the host:

# Linux
rescan-scsi-bus.sh -a
multipath -ll

# VMware
esxcli storage core adapter rescan --all

Snapshots and protection policies

pstcli -d 10.20.30.40 -u admin -p 'MyPassword' snapshot create -name snap-db01-preupgrade -volume_id 12345
pstcli -d 10.20.30.40 -u admin -p 'MyPassword' snapshot_rule create -name daily-30d -interval PT24H -keep_rule "max_count=30"
pstcli -d 10.20.30.40 -u admin -p 'MyPassword' protection_policy create -name pol-gold -snapshot_rule_ids "rule-123"

Snapshot rules define the cadence and retention; protection policies bundle rules and remote replication so a volume can be declared "gold" or "silver" instead of hand-configured. Assign the policy at provisioning time – retrofitting protection to a fleet of volumes is the kind of work that gets skipped.

Automation notes

  • Prefer the REST API (/api/rest/volume, /api/rest/host) for integrations: authenticate, store the token, then issue JSON calls. Both interfaces act on the same object IDs, so a GUI lookup gives you the ID you need in a script.
  • Always show after create: the create response returns the new object ID, but the state may need a moment to reach OK.
  • Keep a naming convention that encodes environment, application and purpose; the array will not enforce it for you.
  • Check capacity and performance metrics before filling a pool – thin volumes can oversubscribe an appliance faster than expected.

Related: NVMe over TCP setup, HPE 3PAR peer persistence, and LVM thin provisioning.

原文链接:https://dell.com/support/manuals/en-us/powerstore-9200t/pwrstr-cliug/the-create-action-command