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?
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...
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...
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.
Nice work.
Thanks!
how can i do the same to an ESX4i (assuming im using the vSphere RCLI or the VMA)
Itzik
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.