-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Enable the second gear

Purpose

I was accessing from vSphere4 servers a DELL MD3000 storage using two different network links set up each to use a different vlan, in order to have multiple paths to connect to it. This is commonly called Multipathing.

Assuming that you configured your vSphere4 servers to access the storage using the two vlans, the default policy that VMware uses is the Most Recently Used Path Selection. This means that if all my vSphere4 servers used the vlan #1 to connect to the storage, they will stick to it.

The goal of this howto is to change the policy used to connect to the storage, setting it on Round Robin so that the vSphere4 uses both links to connect to the storage.

How to do it

This modification can easily been done using the vSphere client, in (assuming you’re managing your vSphere4 servers from a vCenter server) “inventory->hosts and clusters->Storage adapters”, select the iSCSI LUN and then manage its path.

A small productivity problem appears when you have to apply the modification on a lot of vSphere4 servers and a lot of LUNs. This can take a while until the modification is done.

Changing the configuration using the command line

Fetching the list of connected LUNs can be done the following way:

esxcli nmp device list
=>	naa.6001ec9000f1074f00000f234b86335f
	    Device Display Name: DELL iSCSI Disk (naa.6001ec9000f1074f00000f234b86335f)
	    Storage Array Type: VMW_SATP_LSI
	    Storage Array Type Device Config: 
	    Path Selection Policy: VMW_PSP_MRU
	    Path Selection Policy Device Config: Current Path=vmhba32:C0:T0:L14
	    Working Paths: vmhba32:C0:T0:L14

	naa.6001ec9000f1074f00000e2f4b81bc8f
	    Device Display Name: DELL iSCSI Disk (naa.6001ec9000f1074f00000e2f4b81bc8f)
	    Storage Array Type: VMW_SATP_LSI
	    Storage Array Type Device Config: 
	    Path Selection Policy: VMW_PSP_MRU
	    Path Selection Policy Device Config: Current Path=vmhba32:C0:T0:L7
	    Working Paths: vmhba32:C0:T0:L7

	naa.6001ec9000f1074f00000e2b4b81bc61
	    Device Display Name: DELL iSCSI Disk (naa.6001ec9000f1074f00000e2b4b81bc61)
	    Storage Array Type: VMW_SATP_LSI
	    Storage Array Type Device Config: 
	    Path Selection Policy: VMW_PSP_MRU
	    Path Selection Policy Device Config: Current Path=vmhba32:C0:T0:L5
	    Working Paths: vmhba32:C0:T0:L5
	...

We can see in the previous command output that the LUNs are currently accessed using the VMW_PSP_MRU (MRU stands for Most Recently Used) path selection policy. Ok, now let’s just keep the LUNs iqn :

esxcli nmp device list | awk -F'(' '/DELL iSCSI/{gsub(")",""); print $2}'
=>	naa.6001ec9000f1074f00000f234b86335f
	naa.6001ec9000f1074f00000e2f4b81bc8f
	naa.6001ec9000f1074f00000e2b4b81bc61
	naa.6001ec9000f1074f00000e394b81bd0a
	naa.6001ec9000f1074f00000f314b8633f8
	naa.6001ec9000f1074f00000f294b86339a
	naa.6001ec9000f1074f00000e2d4b81bc78
	naa.6001ec9000f1074f00000ca54b73f627
	naa.6001ec9000f1074f00000e354b81bcdc
	naa.6001ec9000f1074f00000f254b863374
	naa.6001ec9000f1074f00000ced4b748cf9
	naa.6001ec9000f1074f000009c34b73d5ca
	naa.6001ec9000f1074f00000f2d4b8633cf
	naa.6001ec9000f1074f00000e314b81bca5
	naa.6001ec9000f1074f00000f274b863387
	naa.6001ec9000f1074f00000f334b86342d
	naa.6001ec9000f1074f00000e334b81bcc4
	naa.6001ec9000f1074f00000f2b4b8633b8
	naa.6001ec9000f1074f00000e374b81bcf1
	naa.6001ec9000f1074f00000f2f4b8633e7
	naa.6001ec9000f1074f000009124b739748
	naa.6001ec9000f1074f00000e294b81bc43

To list the available path selection policies on your vSphere4 host, just type the following :

esxcli nmp psp list
=>	Name           Description                        
	VMW_PSP_MRU    Most Recently Used Path Selection  
	VMW_PSP_RR     Round Robin Path Selection         
	VMW_PSP_FIXED  Fixed Path Selection

Let’s just try with one LUN, see what his current configuration is, change it and have a look on his configuration afterwards.

esxcli nmp psp getconfig --device naa.6001ec9000f1074f00000e374b81bcf1
=>	Current Path=vmhba33:C0:T0:L11
esxcli nmp device setpolicy --device naa.6001ec9000f1074f00000e374b81bcf1 --psp VMW_PSP_RR
esxcli nmp psp getconfig --device naa.6001ec9000f1074f00000e374b81bcf1
=>	{policy=rr,iops=1000,bytes=10485760,useANO=0;lastPathIndex=none}

Well, it’s ok ! now let’s do this on all LUNs :

for i in `esxcli nmp device list | awk -F'(' '/DELL iSCSI/{gsub(")",""); print $2}'`; 
do 
	esxcli nmp device setpolicy --psp VMW_PSP_RR --device $i; 
done	

Article originally posted on my old website at this url

-----BEGIN PGP SIGNATURE-----
Comment: GPGTools - http://gpgtools.org

iQIcBAEBCAAGBQJW5eRHAAoJEBeKS2x6xuR7kawQAIa/O9GHms7z9q9uuaqw3BzV
HHBbjYLxhTFt8FkGBrLQS+1ZsTnSda1hpbnV65G53p3ajKONmyLU+OhRBBdAB4ke
F6FGoMJB/IuXL21+BdLTRCKitdNDbouQBLQgI8fOw6fvRorV+GcS9BM2VrQFNpy6
Pig81YN7S6Lysegg4+XNcthL6ny2+1ABlJ7Rx6eQpXfLAoQOvH6yQ1v6D41qJmiE
1exunAfUljKfAUwmx5Ah2GKfOFoUQdMxC8+ZX/FKgGRKapi+fBcAkxycQe9Otq6X
pVfaMfU+LHlPazLbOBqApw1acq7KZ5Srk39Ot3Fg5vWmQP4ZlMpo04tkrVRV660a
b7NqHHotAPVmXrH64m5flUdKgCx6f5Kg2jpiKO1khuKQSFziu5KSEpmZbaMHc9Ih
B9mO1YEJLHPdcrNWdOwl65Lzem2h5fpdQo7Un5W8Q79Rm0xOoSVVo6lvhMZe+TZX
ewSYPaSiYufbleyjdL2K95IlabLPl/bup25FoQN50ydAR+Gd9RuKQlmu3UgBjcrh
SHpOtN/EZeOoRHRJjavC39oyA0ViE4cGhep9acf9yxaUnl06nqc+eksmRZ15DPIa
gwSWUpW6dZ8v7WMHnVDWE2Ut1o5lzrJ0lnYClpuciW+Y7CLeR6drQeomY9hh7bvB
lnBkZqjl5LVQt4n1GVHb
=GozV
-----END PGP SIGNATURE-----

Hint: To validate signature, please view page source and copy html code between BEGIN PGP Signed message and END PGP Signature anchors.

Created the 2010-05-13

Share this


Article content

Resources

10 last blog posts

Related to this article

blog comments powered by Disqus