anuragaw commented on a change in pull request #3425: [WIP DO NOT MERGE] Better
tracking host maintanence success and failure
URL: https://github.com/apache/cloudstack/pull/3425#discussion_r350034559
##########
File path: server/src/main/java/com/cloud/resource/ResourceManagerImpl.java
##########
@@ -1286,12 +1288,31 @@ public Host maintain(final PrepareForMaintenanceCmd
cmd) {
throw new InvalidParameterValueException("Unable to find host with
ID: " + hostId + ". Please specify a valid host ID.");
}
- if (_hostDao.countBy(host.getClusterId(),
ResourceState.PrepareForMaintenance, ResourceState.ErrorInMaintenance) > 0) {
- throw new InvalidParameterValueException("There are other servers
in PrepareForMaintenance OR ErrorInMaintenance STATUS in cluster " +
host.getClusterId());
+ final ResourceState hostState = host.getResourceState();
+ if (hostState == ResourceState.Maintenance || hostState ==
ResourceState.PrepareForMaintenance ||
Review comment:
Done
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services