ESXi

 View Only
  • 1.  How to set Multipathing policies in the ESX 4 COS?

    Posted Jun 05, 2009 07:43 PM

    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?



  • 2.  RE: How to set Multipathing policies in the ESX 4 COS?
    Best Answer

    Posted Jun 06, 2009 02:35 AM

    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...



  • 3.  RE: How to set Multipathing policies in the ESX 4 COS?

    Posted Aug 13, 2009 01:52 PM

    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.



  • 4.  RE: How to set Multipathing policies in the ESX 4 COS?

    Posted Aug 14, 2009 01:42 AM

    Nice work.



  • 5.  RE: How to set Multipathing policies in the ESX 4 COS?

    Posted Sep 23, 2009 10:50 AM

    Thanks!

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

    Itzik



  • 6.  RE: How to set Multipathing policies in the ESX 4 COS?

    Posted Nov 06, 2009 04:39 PM

    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.