VMware Cloud Community
VinkenB
Contributor
Contributor
Jump to solution

How to set Multipathing policies in the ESX 4 COS?

In ESX 3.5 I use the command "esxcfg-mpath --policy=rr --lun=vmhba1:0:1" to set the round-robin multipathing policy.

But the esxcfg-mpath options have changed in ESX 4, so you can't set the policy anymore.

I have experimented with vimsh and found the following command: "vimsh hostsvc/storage/multipath_lun_setpolicy lunId policy prefer", but I have difficulties with the syntax.

I tried "vimsh hostsvc/storage/multipath_lun_setpolicy vmhba1:0:1 VMW_PSP_RR 0", but vimsh keeps telling me that "The object or item referred to could not be found".

So, does anybody know a command to set (round-robin) multipathing policies in the ESX 4 COS?

0 Kudos
1 Solution

Accepted Solutions
glynnd1
Expert
Expert
Jump to solution

I believe this is the command you want

esxcli nmp device setpolicy -- device

eg

esxcli nmp device setpolicy -- device naa.1234567890987654321 VMW_PSP_RR

Remember vmhba1:0:1 is the volume, but a path to the volume...

View solution in original post

0 Kudos
5 Replies
glynnd1
Expert
Expert
Jump to solution

I believe this is the command you want

esxcli nmp device setpolicy -- device

eg

esxcli nmp device setpolicy -- device naa.1234567890987654321 VMW_PSP_RR

Remember vmhba1:0:1 is the volume, but a path to the volume...

0 Kudos
ThibautL
Contributor
Contributor
Jump to solution

FYI, this is how you can change all your LUNs to Round Robin policy without any reboot :

Type in this command (this one will not change anything in your config) :

esxcli nmp device list | awk '/^naa/{print "esxcli nmp device setpolicy --device "$0" --psp VMW_PSP_RR" };'

It will just create the commands to set it.

Just check the result and paste it to apply Round Robin on all you LUNs. This is a non-disruptive operation.

Issue a esxcli nmp device list to see if everything went fine.

0 Kudos
glynnd1
Expert
Expert
Jump to solution

Nice work.

0 Kudos
Itzikr
Enthusiast
Enthusiast
Jump to solution

Thanks!

how can i do the same to an ESX4i (assuming im using the vSphere RCLI or the VMA)

Itzik

Itzik Reich
0 Kudos
livinma
Contributor
Contributor
Jump to solution

Excellent command.. What I am now trying to do is utilize the output into a file and then call it via a script so that I can change all the path policies at once. I am not familiar with scripting but taking it one step at a time. I am trying to pipe the output into a file but keep receiving a error "no such file or directory".

I am using the following command:

esxcli nmp device list | awk '/^naa/ {print "esxcli nmp device setpolicy --device "$0" --psp VMW_PSP_RR" };' >> file.txt

I also tried it with 1 pipe but no luck. Any suggestions.

0 Kudos