Creating an Alarm
You create an alarm with the
AlarmManager.CreateAlarm
method.
In the simplest case, you specify the trigger condition in the
AlarmSpec.expression
property and
the action to perform in the
AlarmSpec.action
property. When
the expression evaluates to
true
, the alarm performs the
action.
Figure 1
shows the
CreateAlarm
method.
CreateAlarm Method Inputs and Outputs

The following steps show how to create an alarm.
- Obtain a managed object reference to theAlarmManagerassociated with the vCenter Server.
- Obtain a managed object reference of the entity on which you want to set theAlarm.
- Create anAlarmSpecdata object and specify the alarm details in its properties. See Defining Alarms Using the AlarmSpec Data Object.
- CallAlarmManager.CreateAlarm, passing in the references and theAlarmSpecdata object. The system returns a managed object reference to theAlarm(see Figure 1).
The state of an alarm is contained in an
AlarmState
data object.