spec.setName("VmPowerStateAlarm");
spec.setDescription("Monitor VM state and send email " +
"and power it on if VM powers off");
spec.setEnabled(true);
AlarmSetting as = new AlarmSetting();
as.setReportingFrequency(0); //as often as possible
as.setToleranceRange(0);
spec.setSetting(as);
alarmMgr.createAlarm(vm, spec);