mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
bug 8463: Decrease the resource_count if vm fails to Start and goes to ERROR state.
status 8463: resolved fixed
This commit is contained in:
parent
2a6bef2750
commit
a3b1609199
@ -2081,11 +2081,11 @@ public class UserVmManagerImpl implements UserVmManager, UserVmService, Manager
|
||||
if (group != null) {
|
||||
boolean addToGroup = addInstanceToGroup(Long.valueOf(id), group);
|
||||
if (!addToGroup) {
|
||||
throw new CloudRuntimeException("Unable to assing Vm to the group " + group);
|
||||
throw new CloudRuntimeException("Unable to assign Vm to the group " + group);
|
||||
}
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
throw new CloudRuntimeException("Unable to assing Vm to the group " + group);
|
||||
throw new CloudRuntimeException("Unable to assign Vm to the group " + group);
|
||||
}
|
||||
|
||||
return vm;
|
||||
|
||||
4
server/src/com/cloud/vm/VirtualMachineManagerImpl.java
Normal file → Executable file
4
server/src/com/cloud/vm/VirtualMachineManagerImpl.java
Normal file → Executable file
@ -62,6 +62,7 @@ import com.cloud.capacity.CapacityManager;
|
||||
import com.cloud.cluster.ClusterManager;
|
||||
import com.cloud.configuration.Config;
|
||||
import com.cloud.configuration.ConfigurationManager;
|
||||
import com.cloud.configuration.ResourceCount.ResourceType;
|
||||
import com.cloud.configuration.dao.ConfigurationDao;
|
||||
import com.cloud.consoleproxy.ConsoleProxyManager;
|
||||
import com.cloud.dc.DataCenter;
|
||||
@ -619,7 +620,8 @@ public class VirtualMachineManagerImpl implements VirtualMachineManager, StateLi
|
||||
}
|
||||
|
||||
if (dest == null) {
|
||||
throw new InsufficientServerCapacityException("Unable to create a deployment for " + vmProfile, DataCenter.class, plan.getDataCenterId());
|
||||
_accountMgr.decrementResourceCount(vm.getAccountId(), ResourceType.user_vm);
|
||||
throw new InsufficientServerCapacityException("Unable to create a deployment for " + vmProfile, DataCenter.class, plan.getDataCenterId());
|
||||
}
|
||||
|
||||
long destHostId = dest.getHost().getId();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user