// Create the alarm for VHM
String SERENGETI_UUID = rootFolder.getName(); /* should be the name of the folder clusters get deployed into */
String ALARM_CLEARED_MSG = "all health issues previously reported by Big Data Extensions are in remission";
EventAlarmExpression raiseExpression = new EventAlarmExpressionImpl();
raiseExpression.setEventType(new TypeNameImpl("vim.event.EventEx"));
raiseExpression.setEventTypeId("com.vmware.vhadoop.vhm.vc.events.warning");
raiseExpression.setStatus(ManagedEntity.Status.yellow);
raiseExpression.setObjectType(new TypeNameImpl("vim.VirtualMachine"));
EventAlarmExpression clearExpression = new EventAlarmExpressionImpl();
clearExpression.setEventType(new TypeNameImpl("vim.event.EventEx"));
clearExpression.setEventTypeId("com.vmware.vhadoop.vhm.vc.events.info");
clearExpression.setComparisons(new EventAlarmExpressionImpl.ComparisonImpl[] {
new EventAlarmExpressionImpl.ComparisonImpl("message", "endsWith", ALARM_CLEARED_MSG)
});
clearExpression.setStatus(ManagedEntity.Status.green);
clearExpression.setObjectType(new TypeNameImpl("vim.VirtualMachine"));
OrAlarmExpression or = new OrAlarmExpressionImpl();
or.setExpression(new AlarmExpression[] {raiseExpression, clearExpression});
AlarmTriggeringAction alarmAction = new AlarmTriggeringActionImpl();