mirror of
https://github.com/apache/cloudstack.git
synced 2025-12-17 19:14:40 +01:00
CLOUDSTACK-3451 Parallel deployment - Xenserver - When deploying 30 Vms in parallel, some of the Vm deployment fails when “applying dhcp entry/applying userdata and password entry on router” and retry eventually happens when they succeed.
Changes: - Passing the avoid set generated by the first pass of deployment to the second try. - The second try is done, when the first pass that uses a reserved plan fails to deploy on the reserved host, to search over the entire zone again
This commit is contained in:
parent
694b90f7fa
commit
463a3aba71
@ -115,6 +115,7 @@ public class VMEntityManagerImpl implements VMEntityManager {
|
|||||||
@Inject
|
@Inject
|
||||||
protected AffinityGroupVMMapDao _affinityGroupVMMapDao;
|
protected AffinityGroupVMMapDao _affinityGroupVMMapDao;
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public VMEntityVO loadVirtualMachine(String vmId) {
|
public VMEntityVO loadVirtualMachine(String vmId) {
|
||||||
// TODO Auto-generated method stub
|
// TODO Auto-generated method stub
|
||||||
@ -197,7 +198,6 @@ public class VMEntityManagerImpl implements VMEntityManager {
|
|||||||
if (s_logger.isDebugEnabled()) {
|
if (s_logger.isDebugEnabled()) {
|
||||||
s_logger.debug("Cannot finalize the VM reservation for this destination found, retrying");
|
s_logger.debug("Cannot finalize the VM reservation for this destination found, retrying");
|
||||||
}
|
}
|
||||||
|
|
||||||
exclude.addHost(dest.getHost().getId());
|
exclude.addHost(dest.getHost().getId());
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -228,8 +228,14 @@ public class VMEntityManagerImpl implements VMEntityManager {
|
|||||||
_accountDao.findById(vm.getAccountId()), reservedPlan);
|
_accountDao.findById(vm.getAccountId()), reservedPlan);
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
// Retry the deployment without using the reservation plan
|
// Retry the deployment without using the reservation plan
|
||||||
|
DataCenterDeployment plan = new DataCenterDeployment(0, null, null, null, null, null);
|
||||||
|
|
||||||
|
if (reservedPlan.getAvoids() != null) {
|
||||||
|
plan.setAvoids(reservedPlan.getAvoids());
|
||||||
|
}
|
||||||
|
|
||||||
_itMgr.start(vm, params, _userDao.findById(new Long(caller)), _accountDao.findById(vm.getAccountId()),
|
_itMgr.start(vm, params, _userDao.findById(new Long(caller)), _accountDao.findById(vm.getAccountId()),
|
||||||
null);
|
plan);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// no reservation found. Let VirtualMachineManager retry
|
// no reservation found. Let VirtualMachineManager retry
|
||||||
|
|||||||
@ -784,10 +784,11 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac
|
|||||||
HypervisorGuru hvGuru = _hvGuruMgr.getGuru(vm.getHypervisorType());
|
HypervisorGuru hvGuru = _hvGuruMgr.getGuru(vm.getHypervisorType());
|
||||||
|
|
||||||
boolean canRetry = true;
|
boolean canRetry = true;
|
||||||
|
ExcludeList avoids = null;
|
||||||
try {
|
try {
|
||||||
Journal journal = start.second().getJournal();
|
Journal journal = start.second().getJournal();
|
||||||
|
|
||||||
ExcludeList avoids = null;
|
|
||||||
if (planToDeploy != null) {
|
if (planToDeploy != null) {
|
||||||
avoids = planToDeploy.getAvoids();
|
avoids = planToDeploy.getAvoids();
|
||||||
}
|
}
|
||||||
@ -1025,6 +1026,10 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (planToDeploy != null) {
|
||||||
|
planToDeploy.setAvoids(avoids);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (startedVm == null) {
|
if (startedVm == null) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user