sureshanaparti commented on code in PR #9873:
URL: https://github.com/apache/cloudstack/pull/9873#discussion_r1841986114


##########
engine/orchestration/src/main/java/com/cloud/vm/VirtualMachineManagerImpl.java:
##########
@@ -2124,8 +2124,8 @@ private void advanceStop(final VMInstanceVO vm, final 
boolean cleanUpEvenIfUnabl
         } else {
             HostVO host = _hostDao.findById(hostId);
             if (!cleanUpEvenIfUnableToStop && vm.getState() == State.Running 
&& host.getResourceState() == ResourceState.PrepareForMaintenance) {
-                logger.debug("Host is in PrepareForMaintenance state - Stop VM 
operation on the VM id: {} is not allowed", vm.getId());
-                throw new CloudRuntimeException("Stop VM operation on the VM 
id: " + vm.getId() + " is not allowed as host is preparing for maintenance 
mode");
+                logger.debug("Host is in PrepareForMaintenance state - Stop VM 
operation on the VM: {} is not allowed", vm);
+                throw new CloudRuntimeException(String.format("Stop VM 
operation on the VM id%s is not allowed as host is preparing for maintenance 
mode", vm));

Review Comment:
   ```suggestion
                   throw new CloudRuntimeException(String.format("Stop VM 
operation on the VM %s is not allowed as host is preparing for maintenance 
mode", vm));
   ```



-- 
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