VMware Cloud Community
BenLiebowitz
Expert
Expert
Jump to solution

Update-Entity with Multiple Baselines

I'm trying to patch some hosts via a script I wrote.  However, the syntax I used in the past isn't working here. 

get-baseline -name *critical* | update-entity -entity $HOST -ClusterEnableParallelRemediation:$false -ClusterDisableHighAvailability:$true -confirm:$false

In the past, this picked up both the critical and non-critical host patch baselines, however this time it's only picking up the critical one. 

I read that update-entity can be passed multiple baselines, but even when I switched and tried using below, it isn't working. 

Update-Entity -entity $HOST -baseline {get-baseline | where {$_.Name -match "critical"}) -ClusterEnableParallelRemediation:$false -ClusterDisableHighAvailability:$true -confirm:$false

I thought about creating a baseline group and putting them both in there, but when i did that and did a get-baseline for the group, it doesn't find it.

Appreciate any help!

Thanks!

Ben Liebowitz, VCP vExpert 2015, 2016, & 2017 If you found my post helpful, please mark it as helpful or answered to award points.
Reply
0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

Just tried that, and for me it seems to work.

When I do

Get-PatchBaseline -Name "*critical*" |

Update-Entity -Entity esx1.local.lab -Confirm:$false -Verbose

I see both baselines

update-entity.jpg

You did check that both baselines are connected to the ESXi node?

Which PowerCLI version of the VMware.VumAutomation are you using?
And against which Update Manager/vSphere version?


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

View solution in original post

Reply
0 Kudos
6 Replies
LucD
Leadership
Leadership
Jump to solution

Just tried that, and for me it seems to work.

When I do

Get-PatchBaseline -Name "*critical*" |

Update-Entity -Entity esx1.local.lab -Confirm:$false -Verbose

I see both baselines

update-entity.jpg

You did check that both baselines are connected to the ESXi node?

Which PowerCLI version of the VMware.VumAutomation are you using?
And against which Update Manager/vSphere version?


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

Reply
0 Kudos
BenLiebowitz
Expert
Expert
Jump to solution

vSphere 6.0 Update 2 (version for VUM).

VMware PowerCLI 6.5.1 build 5377412

This is the error I received.  Not very descriptive.

update-entity : 10/31/2017 11:28:17 AM  Update-Entity           The operation for the

entity "HOST" failed with the following message: "There

are errors during the remediation operation. Check the events and log files

for details."

At E:\ps1\vmware\VUM_HostUpdate.ps1:85 char:53

+ ... ritical"} | update-entity -entity $HOST -ClusterEnableParallelRemedi ...

+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [Update-Entity], ExtendedFault

    + FullyQualifiedErrorId : Client20_TaskServiceImpl_CheckServerSideTaskUpda

   tes_OperationFailed,VMware.VumAutomation.Commands.RemediateInventory

Ben Liebowitz, VCP vExpert 2015, 2016, & 2017 If you found my post helpful, please mark it as helpful or answered to award points.
Reply
0 Kudos
LucD
Leadership
Leadership
Jump to solution

Just to make sure, that ESXi node is in maintenance mode?
And the HA, provided the ESXi node is part of a cluster, is set to allow patching, and you set the ClusterDisableHighAvailability switch.

Did you check the vpxd logs?

Any additional info in there?

Update: I just saw you used the ClusterDisableHighAvailability switch


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

BenLiebowitz
Expert
Expert
Jump to solution

My script puts the host into Maintenance mode first, scans the host for compliance, then remediates. 

I didn't delve into the vpxd log yet.  I've had success using this method in the past.  I'll test again in a few and check the logs.

I was just wondering if there was a different method or a way to use Baseline Groups via PowerCLI. 

Ben Liebowitz, VCP vExpert 2015, 2016, & 2017 If you found my post helpful, please mark it as helpful or answered to award points.
Reply
0 Kudos
LucD
Leadership
Leadership
Jump to solution

No, not that I know off.
As I showed earlier, for me it works, but that was against a VCSA 6.5U1


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

BenLiebowitz
Expert
Expert
Jump to solution

Very strange.  I ran it again on another host and although I got an error in the PowerShell window, the patches were applied properly.  I'll take it! Smiley Happy

Thanks!

Ben Liebowitz, VCP vExpert 2015, 2016, & 2017 If you found my post helpful, please mark it as helpful or answered to award points.
Reply
0 Kudos