Wednesday, April 11, 2012

Change storage pathing in ESX5

In ESX4 I used a script to cycle through the available datastore paths and set the connection type to round robin. In ESX5 it changed a bit, so this is the updated script

param([string] $server = $(throw "Server param required")

if ($user -eq $null)
{connect-viserver $server}
{connect-viserver $server -User $user -Password $pass}

$esxcli = Get-EsxCli
$ | group-Object -Property Device | where {$_.count -ge 4} |  %{ $$null, $_.Name, "VMW_PSP_RR")}

disconnect-viserver $server -confirm:$false

No comments: