Skip to content

Commit

Permalink
alert: Send alert for ha'ed vm's
Browse files Browse the repository at this point in the history
When ha is performed on vm's send the alert for it so that
its for admins to know which vm's got ha'ed else its time
consuming to get those details from logs
  • Loading branch information
Rakesh Venkatesh committed Nov 4, 2021
1 parent 0ad7424 commit ae80614
Showing 1 changed file with 2 additions and 0 deletions.
Expand Up @@ -608,7 +608,9 @@ protected Long restart(final HaWorkVO work) {

VMInstanceVO started = _instanceDao.findById(vm.getId());
if (started != null && started.getState() == VirtualMachine.State.Running) {
String message = String.format("HA on VM: %s", started.getHostName());
s_logger.info("VM is now restarted: " + vmId + " on " + started.getHostId());
_alertMgr.sendAlert(alertType, vm.getDataCenterId(), vm.getPodIdToDeployIn(), message, message);
return null;
}

Expand Down

0 comments on commit ae80614

Please sign in to comment.