VMware Cloud Community
JPM00
Contributor
Contributor

"Set-ScsiLun -CommandsToSwitchPath" system wide or not?

In the help for Set-ScsiLUN it says that "Modifying this setting affects all ScsiLun devices that are connected to the same ESX host." but it doesn't seem like this is actually happening.

I have a host with 61 FC datastores and if I do a Get-ScsiLUN I can see that some LUNs have CommandsToSwitchPath set to 1 and some have it at the default of 1000

I used Set-ScsiLUN against a single LUN with " -CommandsToSwitchPath 1" and expected to see all of them update, but if I run Get-ScsiLUN again, I still have a mix of 1000 and 1.  Is this the expected behavior?

 

Reply
0 Kudos
8 Replies
LucD
Leadership
Leadership

This parameter only makes sense when using the RoundRobin MultiPathPolicy.
Are all your LUNs set to RoundRobin?


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

Reply
0 Kudos
JPM00
Contributor
Contributor

Yes, all of the FC connected LUNs are already set to RoundRobin.  The only devices from Get-ScsiLUN that are not are local boot devices

 

Reply
0 Kudos
LucD
Leadership
Leadership

I had a closer look at that parameter and it seems it sets the ESXi advanced parameter Disk.SPCmdsToSwitch.
But it looks like that advanced parameter isn't used anymore since v4.

This seems to correspond with the remarks made for the NoCommandSwitch and NoBlocksSwitch parameters.


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

Reply
0 Kudos
JPM00
Contributor
Contributor

So it is completely intert at this point?

I'm trying to replicate the effects of this command:

for i in `esxcfg-scsidevs -c |awk '{print $1}' | grep naa.600`; do esxcli storage nmp psp roundrobin deviceconfig set --type=iops --iops=1 --device=$i; done

I could do a Get-EsxCli command that is based on a reply of yours from last year found here:

https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Changing-default-pathing-policy-with-p...

 

I find the Set-ScsiLun to be much easier to read, but if it isn't actually changing anything at this point, then I guess esxcli through powershell is my only option.

Reply
0 Kudos
LucD
Leadership
Leadership

Yes, I'm afraid that Get-EsxCli is your only option.

On the positive side, LUN related commands are way faster through Get-EsxCli method than through the Set-Scsi* cmdlets.


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

Reply
0 Kudos
JPM00
Contributor
Contributor

Will you be reporting a bug to the PowerCLI team to remove/depreciate/clarify this?

Reply
0 Kudos
LucD
Leadership
Leadership

I don't work for VMware, but I can mention it to some on the PowerCLI Team.
You could also open an SR to report this issue.


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

Reply
0 Kudos
JPM00
Contributor
Contributor

I just tested the powercli
Get-VMhost myhost.lab.com | Get-ScsiLun -LunType Disk | Where-Object {$_.CanonicalName -like 'naa.*' -and $_.MultipathPolicy -like 'RoundRobin' -and $_.CommandsToSwitchPath -ne 1} | Set-ScsiLun -CommandsToSwitchPath 1

and when I verify it with the esxcli commands directly on the host, it does look like it is changing the "IOOperation Limit: " value properly, so I can keep using the command, but the full help is not accurate that it impacts all ScsiLUN devices on the host, as changing it on one LUN does not change it on the others.  But if I give it all of the LUNs that aren't set correctly, then it does set the values as expected.

Reply
0 Kudos