VMware Cloud Community
tdubb123
Expert
Expert

reset and clear alarms for vms

how can I ack and clear the alarm for vms that currently has an alarm on it

3 Replies
LucD
Leadership
Leadership

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

tdubb123
Expert
Expert

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

Reply
0 Kudos
LucD
Leadership
Leadership

No, I'm afraid not


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

Reply
0 Kudos