Dear all scripting professionals,
I would like to write a simple PowerCLI script to make the acknowledge of the alarm on VMs and clear them. I found some Cmdlets which might be useful on my requirement but I don't know how to use it in correct way.
Here is the Cmdlet I found
Please advise me by using PowerCLI method to reset the alarm. I have to handle over 300 VMs alarm.
Thanks in advanced.
Have a look at 1. Re: reset and clear alarms for vms
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Is this still not the case in vSphere 6??
HA restart alerts riddling our vCenter after patching on windows 2013 servers, acknowledging the alerts doesn't really change anything and i really want to run a foreach vm script with a where statement to find alarm-51....
$vm = get-vm "MyVM"
$vm |?{ $_.extensiondata.triggeredalarmstate.alarm.value -eq "alarm-51"} | %{(Get-View AlarmManager).AcknowledgeAlarm($_.ExtensionData.TriggeredAlarmState.Alarm, $_.ExtensionData.MoRef)}
I'm afraid not, and afaik it will not be in the public API methods in 6.5 either.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Unfortunately, clearing alarms is still not possible... you can only acknowledge them since the API to clear is not available.
You can however workaround this issue by disabling the alarm and then re-enabling it, this will clear the alarm for all objects. vCenter will also clear the alarm for all objects for you when the alarm is disabled.
For example, clearing VM MAC Conflict:
then once done, re-enable:
Note that this will clear the Alarm for all the entities for which it was fired, not just one.
Just so everyone is aware of that.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
vim.alarm.AlarmFilterSpec)
thanks HugoP that was good solution to kill a bunch of alarms on VMs from a restore of a failed vCenter
-RichPo