GabrielBrascher commented on a change in pull request #5664:
URL: https://github.com/apache/cloudstack/pull/5664#discussion_r776785893



##########
File path: server/src/main/java/com/cloud/ha/HighAvailabilityManagerImpl.java
##########
@@ -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());

Review comment:
       I like the idea of enhancing the alerts.
   What do you think of changing from `Ha on VM: VM Name` to `Ha Starting VM: 
VM Name (i-2-13477-VM)`.
   
   Thus, making it `String.format("HA on VM: %s (%s)", started.getHostName(), 
started.getInstanceName());`.

##########
File path: server/src/main/java/com/cloud/ha/HighAvailabilityManagerImpl.java
##########
@@ -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());

Review comment:
       Taking the opportunity, what do you think of enhancing also the INFO log 
message?
   
   As a suggestion, it could be logged something as the following:
   ```
   HA is now restarting VM instance {id: "123", name: "VM Name", uuid: 
"1234.....abc", type="User"} on Host [{id: "1", name: "host.name", uuid: 
"ABC...123", type="Routing"}]
   ```
   With the following code changes:
   
   ```suggestion
                   HostVO hostVmHasStarted = 
_hostDao.findById(started.getHostId());
                   s_logger.info(String.format("HA is now restarting %s on %s", 
started, hostVmHasStarted));
   ```




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to