mirror of https://github.com/apache/cloudstack.git
catch runtime exception
This commit is contained in:
parent
b437b8b977
commit
0d612c4d85
|
|
@ -376,8 +376,6 @@ public class VirtualMachineManagerImpl implements VirtualMachineManager, Cluster
|
|||
if (!stateTransitTo(vm, Event.StartRequested, null)) {
|
||||
throw new ConcurrentOperationException("Unable to start vm " + vm + " due to concurrent operations");
|
||||
}
|
||||
|
||||
VirtualMachineProfileImpl<T> vmProfile = new VirtualMachineProfileImpl<T>(vm, template, offering, null, params, hyperType);
|
||||
|
||||
ExcludeList avoids = new ExcludeList();
|
||||
int retry = _retry;
|
||||
|
|
@ -388,6 +386,8 @@ public class VirtualMachineManagerImpl implements VirtualMachineManager, Cluster
|
|||
stateTransitTo(vm, Event.OperationRetry, dest.getHost().getId());
|
||||
}
|
||||
|
||||
VirtualMachineProfileImpl<T> vmProfile = new VirtualMachineProfileImpl<T>(vm, template, offering, null, params, hyperType);
|
||||
|
||||
for (DeploymentPlanner planner : _planners) {
|
||||
dest = planner.plan(vmProfile, plan, avoids);
|
||||
if (dest != null) {
|
||||
|
|
@ -419,6 +419,9 @@ public class VirtualMachineManagerImpl implements VirtualMachineManager, Cluster
|
|||
s_logger.warn("Insufficient capacity ", e);
|
||||
avoids.add(e);
|
||||
continue;
|
||||
} catch (RuntimeException e) {
|
||||
stateTransitTo(vm, Event.OperationFailed, dest.getHost().getId());
|
||||
return null;
|
||||
}
|
||||
|
||||
vmGuru.finalizeVirtualMachineProfile(vmProfile, dest, context);
|
||||
|
|
|
|||
Loading…
Reference in New Issue