Skip to content

Commit 7d46b2e

Browse files
committed
Merge pull request apache#895 from SudharmaJain/cs-8911
CLOUDSTACK-8911: VM start job got stuck in loop looking for suitable host VM instance creation job get stuck in the loop, when VMs require local storage there are host that reached max guest limit and remain hosts does have storage available. This happens because the hosts that reach the max guest limit were not getting added to the avoid list and hence the cluster. Verified the fix on my local setup. Repro Steps: 1. Take an environment with single cluster and 2 hosts. 2. change the max guest limit for the hypervisor such that on one host max guest limit should reach. 3. change thresholds so that other host should not have enough storage. If required create a VM for sufficient bigger disk. 4. Now deploy a VM with local storage. 5. cluster will never be put in the avoid set and job will keep looking for suitable host. 6. once we increase the max guest limit, VM will deploy or will fail if there is a lack of storage. * pr/895: CLOUDSTACK-8911: VM start job got stuck in loop looking for suitable host Signed-off-by: Remi Bergsma <github@remi.nl>
2 parents 535ab51 + 2d34036 commit 7d46b2e

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

‎server/src/com/cloud/agent/manager/allocator/impl/FirstFitAllocator.java‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,7 @@ protected List<Host> allocateTo(DeploymentPlan plan, ServiceOffering offering, V
297297
s_logger.debug("Host name: " + host.getName() + ", hostId: " + host.getId() +
298298
" already has max Running VMs(count includes system VMs), skipping this and trying other available hosts");
299299
}
300+
avoid.addHost(host.getId());
300301
continue;
301302
}
302303

@@ -305,6 +306,7 @@ protected List<Host> allocateTo(DeploymentPlan plan, ServiceOffering offering, V
305306
ServiceOfferingDetailsVO groupName = _serviceOfferingDetailsDao.findDetail(serviceOfferingId, GPU.Keys.pciDevice.toString());
306307
if(!_resourceMgr.isGPUDeviceAvailable(host.getId(), groupName.getValue(), offeringDetails.getValue())){
307308
s_logger.info("Host name: " + host.getName() + ", hostId: "+ host.getId() +" does not have required GPU devices available");
309+
avoid.addHost(host.getId());
308310
continue;
309311
}
310312
}

0 commit comments

Comments
 (0)