VMware Cloud Community
hharold
Enthusiast
Enthusiast
Jump to solution

Update Manager PowerCLI - Parallel Remediation

Hi all,

I am trying to get a pretty much automated script to work to upgrade / remediate dozens of ESXi clusters.

We would like to use the Parallel remediation option, to do some parallel remediation :

$cluster | Remediate-Inventory -Baseline $baselines -ClusterEnableParallelRemediation:$true  

From within the GUI we can limt the number of concurrently remediated hosts to a fix number of hosts.

I would like to use this option to limit it to half of the number hosts in a cluster.

But I cannot find the option to use within PowerCLI....

Any one know wheteher this option is available and/or usable from within PowerCLI ?

Thanks and kind regards,

Harold

@hharold

0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

Afaik there is no such option with the cmdlet.

But you could remidiate your servers in batches.

Suppose you have an array with all your server objects, then you could do a loop

$nrParallel = 4 
$array = $cluster | Get-VMHost
$endLoop
= [math]::Floor($array.Count/$nrParallel) if($array.Count%$nrParallel -eq 0){     $endLoop -= 1
}
foreach($i in (0..$endLoop)){     Remediate-Inventory -Entity $array[($i * $nrParallel)..((($i + 1) * $nrParallel) - 1)] -Baseline $baselines -ClusterEnableParallelRemediation:$true  }

Try it out first with the -WhatIf parameter

Update: small correction to the logic


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

View solution in original post

0 Kudos
3 Replies
LucD
Leadership
Leadership
Jump to solution

Afaik there is no such option with the cmdlet.

But you could remidiate your servers in batches.

Suppose you have an array with all your server objects, then you could do a loop

$nrParallel = 4 
$array = $cluster | Get-VMHost
$endLoop
= [math]::Floor($array.Count/$nrParallel) if($array.Count%$nrParallel -eq 0){     $endLoop -= 1
}
foreach($i in (0..$endLoop)){     Remediate-Inventory -Entity $array[($i * $nrParallel)..((($i + 1) * $nrParallel) - 1)] -Baseline $baselines -ClusterEnableParallelRemediation:$true  }

Try it out first with the -WhatIf parameter

Update: small correction to the logic


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

0 Kudos
hharold
Enthusiast
Enthusiast
Jump to solution

Hi Luc,

this works !
Super method, didnt came to my mind.

Thanks again.

Kind regards,

Harold

@hharold

0 Kudos
David9876
Enthusiast
Enthusiast
Jump to solution

Sorry for bumping such an old thread.

Is the syntax for let Update Manager to decide how many do to in parallel?

i.e. Enable Parallel Remediation for hosts selected in clusters

      - option Automatically determine the max number of concurrent remediated hosts in a cluster

0 Kudos