VMJimAZ
Contributor
Contributor

Set-SCSILUN -CommandsToSwitchPath Errors

I am trying to set the CommandsToSwitchPath property with PowerCLI and getting an error.  Internet searches have been no help...

Here is the command:

get-vmhost <servername> | Get-ScsiLun -CanonicalName eui.0017380001b90040 | Set-ScsiLun -CommandsToSwitchPath 10

This is the error:

Set-ScsiLun : 5/4/2011 3:07:21 PM    Set-ScsiLun        Disk.SPCmdsToSwitch' is invalid or exceeds the maximum number o
f characters permitted.
At line:1 char:99
+ get-vmhost servername | Get-ScsiLun -CanonicalName eui.0017380001b90040 | Set-ScsiLun <<<<  -CommandsToS
witchPath 50
    + CategoryInfo          : NotSpecified: (:) [Set-ScsiLun], InvalidName
    + FullyQualifiedErrorId : Client20_MoServiceImpl_Invoke_ViError,VMware.VimAutomation.ViCore.Cmdlets.Commands.Host.
   SetScsiLun

The LUN is alread set to the RoundRobin multipath policy.  At this point, I'm open to suggestons...

Thanks for any assistance.

-James

0 Kudos
9 Replies
LucD
Leadership
Leadership

Which PowerCLI build are you using ?

Get-PowerCLIVersion


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
logiboy123
Expert
Expert

CommandsToSwitchPathSpecify the maximum number of I/O requests to be issued on a given path before the system tries to select a different path. Modifying this setting affects all ScsiLun devices that are connected to the same ESX host. The default value is 50. Setting this parameter to zero (0) disables switching based on commands.

See the following article for sytanx usage of the command.

http://www.vmware.com/support/developer/windowstoolkit/wintk40u1/html/Set-ScsiLun.html

0 Kudos
VMJimAZ
Contributor
Contributor

I don't remember the build number and I'm away rom the console at the moment. It is version 4.1.1 and I verified the build matched the latest build on the downloads page earlier today.

-James

0 Kudos
LucD
Leadership
Leadership

The CommandsToSwitchPath parameter uses the Disk.SPCmdsToSwitch advanced configuration parameter under the covers.

I have the impression that this parameter is only available on ESX(i) 3.5 hosts and not on ESX(i) 4.x hosts.

If you try to set the parameter with the esxcfg-advcfg command on an ESX(i) 4.x host you seem to get the same error.

Perhaps someone from VMW can confirm this ?


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
VMJimAZ
Contributor
Contributor

Okay, here is the actual esxcli command I am trying to reproduce in PowerCLI.  Should have put this in the first post...

esxcli nmp psp setconfig --device <device naa or eui number> --config "policy=iops;iops=10"

This is a per disk setting so I think I'm on the wrong path with the 'CommandsToSwitchPath' property as this is a per host setting.

Is this property of the disk devices available to the vStorage API?

-James

0 Kudos
LucD
Leadership
Leadership

You should use the Get-EsxCli cmdlet in that case.

Something like this (sets the IOPS to 10)

$esxcli = Get-EsxCli
$esxcli.nmp.device.list() | where {$_.device -like "naa.600*"}| %{
    $configBefore = $esxcli.nmp.roundrobin.getconfig($_.device)
    $esxcli.nmp.roundrobin.setconfig(0,$configbefore.device,[long]10,"iops",$false)
}

You'll have to update the device name mask of course.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

VMJimAZ
Contributor
Contributor

Luc,

I was just looking at this cmdlet and was looking for some details on the API for the esxcli.  Do you know the title of a document that would give me the details on the methods and properties for the nmp.psp and nmp.roundrobin namespaces?

Thanks for your help!

-James

0 Kudos
LucD
Leadership
Leadership

Hi James,

Pavel did a nice document on the use of Get-EsxCli.

There is a good blog post from Arnim on the cmdlet.

And there are some threads in this community on the subject.

But that is it afaik.

I suspect the next PowerCLI build will move this cmdlet from experimental to fully supported.

And since it's May, this new PowerCLI build should be imminent 🙂

Luc.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

VMJimAZ
Contributor
Contributor

Thank you Luc, you've been a big help!

-James

0 Kudos