Saturday, March 5, 2016

VMware PowerCLI set multipath policy for all the luns present on physical Host

$hstn=Get-VMHost tech-jockey-host* |select name

clear
foreach($hsst in $hstn)
{
$vvv=Get-VMHost -name $hsst.name  | Get-ScsiLun |select CanonicalName,MultipathPolicy
foreach($vm in $vvv)
{

if($vm.MultipathPolicy -eq "MostRecentlyUsed")
{
write-host $vm.CanonicalName," | "$vm.MultipathPolicy
Get-VMHost -name $hsst.name  | Get-ScsiLun -CanonicalName  $vm.CanonicalName | Set-ScsiLun -MultipathPolicy RoundRobin
}
}
}

No comments:

Post a Comment

Thanks for showing interest in tech-jockey.

Content of this blog has been moved to GITHUB

Looking at current trends and to make my content more reachable to people, I am moving all the content of my blog https://tech-jockey.blogsp...