mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
Fix error message if specific host does not have capacity (#9218)
This commit is contained in:
parent
b3c3f91718
commit
517cddcb15
@ -5409,7 +5409,12 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir
|
||||
final ServiceOfferingVO offering = serviceOfferingDao.findById(vm.getId(), vm.getServiceOfferingId());
|
||||
Pair<Boolean, Boolean> cpuCapabilityAndCapacity = _capacityMgr.checkIfHostHasCpuCapabilityAndCapacity(destinationHost, offering, false);
|
||||
if (!cpuCapabilityAndCapacity.first() || !cpuCapabilityAndCapacity.second()) {
|
||||
String errorMsg = "Cannot deploy the VM to specified host " + hostId + "; host has cpu capability? " + cpuCapabilityAndCapacity.first() + ", host has capacity? " + cpuCapabilityAndCapacity.second();
|
||||
String errorMsg;
|
||||
if (!cpuCapabilityAndCapacity.first()) {
|
||||
errorMsg = String.format("Cannot deploy the VM to specified host %d, requested CPU and speed is more than the host capability", hostId);
|
||||
} else {
|
||||
errorMsg = String.format("Cannot deploy the VM to specified host %d, host does not have enough free CPU or RAM, please check the logs", hostId);
|
||||
}
|
||||
s_logger.info(errorMsg);
|
||||
if (!AllowDeployVmIfGivenHostFails.value()) {
|
||||
throw new InvalidParameterValueException(errorMsg);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user