VMware Cloud Community
tomtom901
Commander
Commander

MPIO command line

Hi all,

I am trying to get MPIO configured on vSphere 5. I've got some commands that are working for vSphere 4, and I've noticed that they work different under vSphere 5. In order to prevent mistakes, could someone give me a clue about what commands are needed for vSphere 5.

Command line in vSphere 4:

Round robin params first device

esxcli nmp roundrobin setconfig --type "iops" --iops 1 --device `esxcli nmp device list | grep ^eui | head -n 1 `

Round robin params second device

esxcli nmp roundrobin setconfig --type "iops" --iops 1 --device `esxcli nmp device list | grep ^eui  |head -n 2 | tail -n 1

Startup script:

# Fixing iSCSI MPIO throughtput limited to 1G. esxcli nmp device list | grep  ^eui  | while read device ; do esxcli nmp roundrobin setconfig --type "iops" --iops 1 --device ${device}

done

Thanks in advance!

0 Kudos
5 Replies
Slingsh0t
Enthusiast
Enthusiast

The PowerCLI way:

$vmhost = "<HOST_GOES_HERE>"; foreach ($device in (get-vmhostdisk -vmhost $vmhost | ?{$_.DeviceName -match "naa.60"})) { (get-esxcli -vmhost $vmhost).storage.nmp.psp.roundrobin.deviceconfig.set($null,$device.ScsiLun,1,"iops") }

Otherwise in the script above you can see the direct esxcli drill down list: esxcli storage nmp psp roundrobin deviceconfig set then enter all your stuff in there.

0 Kudos
tomtom901
Commander
Commander

So, with this PowerCLI (reminds me a bit of PowerShell.. lol) and in the $vmhost variable the management IP I can get the result that I need for MPIO?

Thanks!

0 Kudos
Slingsh0t
Enthusiast
Enthusiast

If by result you mean will it set the iops to 1 on all targets with a name including "naa.60" with the psp of roundrobin selected, then yes, thats what it wil do Smiley Happy

Just chuck in the hostname in the variable bit and make sure roundrobin has been selected for path selection.

You could also run this which will update every host at the same time (in a non-prod platform of course):

foreach ($device in (get-vmhostdisk -vmhost (get-vmhost) | ?{$_.DeviceName -match "naa.60"})) { (get-esxcli -vmhost $vmhost).storage.nmp.psp.roundrobin.deviceconfig.set($null,$device.ScsiLun,1,"iops") }
0 Kudos
tomtom901
Commander
Commander

Would the hostname be preferred input over IP? I've also sent you a PM concerning some questions.

0 Kudos
Slingsh0t
Enthusiast
Enthusiast

When using PowerCLI, you'll need to connect to the vCenter server first.  You will need to refer to the host names as the way they appear in your vSphere client.

0 Kudos