how can I ack and clear the alarm for vms that currently has an alarm on it
To acknowledge all alarms you can do
$alarmMgr = Get-View AlarmManager
Get-VM | where {$_.ExtensionData.TriggeredAlarmState} | %{ $vm = $_
$vm.ExtensionData.TriggeredAlarmState | %{ $alarmMgr.AcknowledgeAlarm($_.Alarm,$vm.ExtensionData.MoRef) } }
The "Reset to green" option doesn't exist for all alarms, only for event-based alarms.
And the SetAlarmStatus method, that is behind this Reset to green option, is not a public API I'm afraid.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Hello
Are we still not able to clear the alarms on vms?
Name MemberTyp
---- ---------
AcknowledgeAlarm Method
AreAlarmActionsEnabled Method
CreateAlarm Method
EnableAlarmActions Method
Equals Method
GetAlarm Method
GetAlarmState Method
GetHashCode Method
GetType Method
SetViewData Method
ToString Method
UpdateViewData Method
WaitForTask Method
Client Property
DefaultExpression Property
Description Property
MoRef Property
No, I'm afraid not
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference