VMware Cloud Community
capnfalkon
Contributor
Contributor

Remediating an ESXi host with PowerCLI

$baseline = "HPE 7.0U3f"
$vmhost = "HOSTNAME"

$baseline = Get-Baseline | Where-Object {$_.name -eq $baseline}
Attach-Baseline -Entity (get-vmhost $vmhost) -Baseline $baseline
$baseline | remediate-inventory -entity $vmhost -confirm:$false

 Error:

Update-Entity The operation for the entity "HOSTNAME" failed with the following message: "The operation is not supported on the selected inventory objects. Check the events for the objects select ed for the operation."

What could I be missing?

Remediation works perfectly fine manually.

Reply
0 Kudos
4 Replies
LucD
Leadership
Leadership

The first thing you could check is if OBN causes the issue.
Instead of providing the name (string) of the entity, provide the actual object (like you did in Attach-Baseline).

$baseline | Remediate-Inventory -Entity (Get-VMHost -Name $vmhost) -Confirm:$False


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

Reply
0 Kudos
capnfalkon
Contributor
Contributor

Unfortunately it's more of the same even with that change.

However, I did spot the following error in the events:

 Cannot remediate host HOSTNAME because it is a part of a HA admission control enabled cluster.

 

Reply
0 Kudos
LucD
Leadership
Leadership

Did you stop/start your PowerCLI session in between?


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

Reply
0 Kudos
capnfalkon
Contributor
Contributor

Ha.

Funny thing is Admission Control is already disabled...

 

Tags (1)
Reply
0 Kudos