Github user pedro-martins commented on a diff in the pull request:

    https://github.com/apache/cloudstack/pull/1252#discussion_r53579947
  
    --- Diff: 
engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java ---
    @@ -1472,6 +1473,12 @@ private void advanceStop(final VMInstanceVO vm, 
final boolean cleanUpEvenIfUnabl
                     _workDao.update(work.getId(), work);
                 }
                 return;
    +        } else {
    +            HostVO host = _hostDao.findById(hostId);
    +            if (!cleanUpEvenIfUnableToStop && vm.getState() == 
State.Running && host.getResourceState() == 
ResourceState.PrepareForMaintenance) {
    +                s_logger.debug("Host in PrepareForMaintenance state - 
Failed to stop VM with id: " + vm.getId());
    --- End diff --
    
    hello @sureshanaparti.
    
    How about you extract the content in the 'if' at line 1478 to an 
"isHostPreparingForMaintenance" method or something like that? it will explain 
better the if content, and you can do a test case to this method too
    
    Ty.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to