rafaelweingartner commented on a change in pull request #2493:
CLOUDSTACK-10326: Prevent hosts fall into Maintenance when there are running
VMs on it
URL: https://github.com/apache/cloudstack/pull/2493#discussion_r175036445
##########
File path: server/src/com/cloud/resource/ResourceManagerImpl.java
##########
@@ -1296,7 +1296,8 @@ public boolean checkAndMaintain(final long hostId) {
if (host.getType() != Host.Type.Storage) {
final List<VMInstanceVO> vos = _vmDao.listByHostId(hostId);
final List<VMInstanceVO> vosMigrating =
_vmDao.listVmsMigratingFromHost(hostId);
- if (vos.isEmpty() && vosMigrating.isEmpty()) {
+ final List<VMInstanceVO> failedMigratedVms =
_vmDao.listRunningVmsByHostAndLastHostSameId(hostId);
+ if (vos.isEmpty() && vosMigrating.isEmpty() &&
failedMigratedVms.isEmpty()) {
Review comment:
This also allows at least some unit testing....
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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