catch runtime exception

This commit is contained in:
edison 2010-12-23 11:58:25 -08:00
parent b437b8b977
commit 0d612c4d85
1 changed files with 5 additions and 2 deletions

View File

@ -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);