Quick Reference: Path Selection Policy (PSP) Modification via esxcli

Figured I’d write out some of the PSP modification commands I used today so I’d have them for future reference. You can have them too, there’s probably like 10,000 different posts on this already, but this one is mine so I can find it faster. : D

vSphere 4.0 Command-Line Interface Installation and Reference

Page 85 has information specific to changing the path.

Also: Obtaining LUN pathing information for ESX and ESXi Hosts

Also: Command-Line Management in vSphere 5 for Service Console Users

First and foremost, the vSphere Command-Line Interface reference guide does a way better job than me. This is just what I use on a somewhat normal basis, with the differences between 4.0 4.1 and 5.0 5.1 highlighted.

List all paths on 4.0 or 4.1
esxcli nmp path list
List all path for a specific device on 4.0 or 4.1
esxcli nmp device list –device <device ID AKA naa.60060260d0902d002c7449ced32ceaaa>
List all devices on 4.0 or 4.1
esxcli nmp device list
List all unique device PSPs with counts on 4.0 or 4.1
esxcli nmp device list | grep “Path Selection Policy:” | sort  |uniq –c

image
List all unique working Paths with counts on 4.0 or 4.1
esxcli nmp device list | grep “Working Paths:” |sort |uniq -c
Set pathing policy with 4.0 or 4.1
esxcli nmp device setpolicy –psp VMW_PSP_RR –device <device ID AKA naa.60060160d0902d002c7449ced32ce111>

List all paths on 5.0 or 5.1
esxcli storage nmp path list
List all path for a specific device on 5.0 or 5.1
esxcli storage nmp device list –device <device ID AKA naa.60060260d0902d002c7449ced32ceaaa>
List all devices on 5.0 or 5.1
esxcli storage nmp device list
List all unique device PSPs with counts on 5.0 or 5.1
esxcli storage nmp device list | grep “Path Selection Policy:” | sort |uniq –c
List all unique working Paths with counts on 5.0 or 5.1
esxcli storage nmp device list | grep “Working Paths:” |sort |uniq –c
Set pathing policy with 5.0 or 5.1
esxcli storage nmp device set –psp VMW_PSP_RR –device <device ID AKA naa.60060160d0902d002c7449ced32ce111>

Quickly set pathing policy for all LUNs on 5.0 or 5.1
for i in `ls /vmfs/devices/disks/ | grep naa | grep -v “:”`;
do esxcli storage nmp device set –device $i –psp VMW_PSP_RR; done

Set the default active active Storage Array Type Plugin to Round Robin
esxcli storage nmp satp set -s VMW_SATP_DEFAULT_AA -P VMW_PSP_RR

Screen Shot 2012-11-01 at 1.31.02 PM

Advertisements
Posted in ESXi, VMware

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

Papers
People
Map

Enter your email address to follow this blog and receive notifications of new posts by email.

Join 32 other followers

%d bloggers like this: