VMware Cloud Community
chayes
Contributor
Contributor
Jump to solution

Database table location of "Datastore Path Selection" and valid value input for Round Robin

Long story, am working to programmictally change device paths to the equivalent to "Round Robin (VMware)" as seen in vCenter -- Volume Properties -->Manage Paths -->Policy Path Selection.

Am having trouble getting the value to change through scripts. Am thinking that it requires the value as expected in the vcenter datamodel. Have yet to find it by inspecting the tables

Thanks in advance

0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

The accepted values on the -MultipathPolicy parameter are: Fixed, MostRecentlyUsed, RoundRobin, Unknown

This changes all policies to roundrobin on a specific host

Get-VMHost <esx-hostname> | Get-ScsiLun -LunType disk |  Set-ScsiLun -MultipathPolicy "roundrobin"

____________

Blog: LucD notes

Twitter: lucd22


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

View solution in original post

0 Kudos
2 Replies
LucD
Leadership
Leadership
Jump to solution

The accepted values on the -MultipathPolicy parameter are: Fixed, MostRecentlyUsed, RoundRobin, Unknown

This changes all policies to roundrobin on a specific host

Get-VMHost <esx-hostname> | Get-ScsiLun -LunType disk |  Set-ScsiLun -MultipathPolicy "roundrobin"

____________

Blog: LucD notes

Twitter: lucd22


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

0 Kudos
Troy_Clavell
Immortal
Immortal
Jump to solution

here's what I use, seems to work pretty well for us

Get-ScsiLun -VmHost (Get-VMHost) -LunType disk |  Set-ScsiLun -MultipathPolicy "roundrobin"

or you can try

$Mypolicy = "rr"
 
Get-Datastore | where {$_.Type -eq "VMFS"} | %{(Get-View $_.ID).Info.Vmfs.Extent[0].DiskName} |%{
  $diskname = $_
  Get-VMHost | %{Get-View (Get-View $_.ID).configmanager.storageSystem} | %{
    $mpathpolicy = New-Object vmware.vim.HostMultipathInfoLogicalUnitPolicy
    $mpathpolicy.policy = $Mypolicy
    $_.SetMultipathLunPolicy($diskname,$mpathpolicy)
  }
}

0 Kudos