If you use Fibre Channel or iSCSI storage devices, it is highly recommended to have multiple paths between your hosts and SAN and to use multipathing. Depending on the recommendations made by your storage vendor, you have to set the multipathing policy to either Fixed, Most Recently Used (MRU), or Round Robin (RR).
More information about multipathing policies can be found in VMware Knowledge Base article 1011340: Multipathing policies in ESXi 5.x and ESXi/ESX 4.x, http://kb.vmware.com/kb/1011340 .
You can use the Get-ScsiLun
cmdlet to retrieve the current multipathing policy for your LUNs:
PowerCLI C:> Get-VMHost -Name 192.168.0.133 | Get-ScsiLun | >> Where-Object {$_.LunType -eq 'disk'} | >> Select-Object -Property CanonicalName,LunType,MultipathPolicy CanonicalName LunType MultipathPolicy ------------- ------- --------------- naa.600a0b80001111550000f35b93e19350 disk MostRecentlyUsed naa.600a0b80001111550000a8adc7e19350 disk MostRecentlyUsed naa.600a0b80001111550000893247e29350 disk MostRecentlyUsed naa.600a0b80001111550000b6182ca14450 disk MostRecentlyUsed naa.600a0b80001111550000d2c418e29350 disk MostRecentlyUsed
If you want to modify the multipathing policy, you can use the Set-ScsiLun
cmdlet - MultipathPolicy
parameter to do so. The syntax of the Set-ScsiLun
cmdlet is as follows:
Set-ScsiLun [[-MultipathPolicy] <ScsiLunMultipathPolicy>]
[[-PreferredPath] <ScsiLunPath>] [-ScsiLun] <ScsiLun[]>
[-CommandsToSwitchPath <Int32>] [-BlocksToSwitchPath <Int32>]
[-NoCommandsSwitch] [-NoBlocksSwitch] [-WhatIf] [-Confirm]
[<CommonParameters>]
The -ScsiLun
parameter is required. The -MultipathPolicy
parameter has four valid parameter values:
Fixed
: This uses the preferred path whenever possibleRoundRobin
: This uses load balancingMostRecentlyUsed
: This uses the most recently used pathUnknown
: This is supported only when connected to vCenter Server 4.1/ESX 4.1In the following example, we will set the multipathing policy for all the disk LUNs of host 192.168.0.133
to Round Robin:
PowerCLI C:> Get-VMHost -Name 192.168.0.133 | Get-ScsiLun | >> Where-Object {$_.LunType -eq 'disk'} | >> Set-ScsiLun -MultipathPolicy RoundRobin | >> Select-Object -Property CanonicalName,LunType,MultipathPolicy CanonicalName LunType MultipathPolicy ------------- ------- --------------- naa.600a0b80001111550000f35b93e19350 disk RoundRobin naa.600a0b80001111550000a8adc7e19350 disk RoundRobin naa.600a0b80001111550000893247e29350 disk RoundRobin naa.600a0b80001111550000b6182ca14450 disk RoundRobin naa.600a0b80001111550000d2c418e29350 disk RoundRobin
3.145.83.150