|
25 | 25 | import javax.inject.Inject; |
26 | 26 | import javax.naming.ConfigurationException; |
27 | 27 |
|
28 | | -import com.cloud.utils.exception.CloudRuntimeException; |
29 | 28 | import org.apache.cloudstack.framework.config.dao.ConfigurationDao; |
30 | 29 | import org.apache.cloudstack.utils.reflectiontostringbuilderutils.ReflectionToStringBuilderUtils; |
31 | 30 | import org.springframework.stereotype.Component; |
@@ -130,8 +129,8 @@ public List<Host> allocateTo(VirtualMachineProfile vmProfile, DeploymentPlan pla |
130 | 129 | // FirstFitAllocator should be used for user VMs only since it won't care whether the host is capable of routing or not |
131 | 130 | return new ArrayList<>(); |
132 | 131 | } |
133 | | - |
134 | | - logger.debug("Looking for hosts in zone [{}], pod [{}], cluster [{}]", dcId, podId, clusterId); |
| 132 | + String paramAsStringToLog = String.format("zone [%s], pod [%s], cluster [%s]", dcId, podId, clusterId); |
| 133 | + logger.debug("Looking for hosts in {}", paramAsStringToLog); |
135 | 134 |
|
136 | 135 | String hostTagOnOffering = offering.getHostTag(); |
137 | 136 | String hostTagOnTemplate = template.getTemplateTag(); |
@@ -203,8 +202,8 @@ public List<Host> allocateTo(VirtualMachineProfile vmProfile, DeploymentPlan pla |
203 | 202 |
|
204 | 203 |
|
205 | 204 | if (clusterHosts.isEmpty()) { |
206 | | - logger.error("No suitable host found for vm [{}] with tags [{}].", vmProfile, hostTagOnOffering); |
207 | | - throw new CloudRuntimeException(String.format("No suitable host found for vm [%s].", vmProfile)); |
| 205 | + logger.warn("No suitable host found for VM [{}] with tags {} in {}.", vmProfile, hostTagOnOffering, paramAsStringToLog); |
| 206 | + return null; |
208 | 207 | } |
209 | 208 | // add all hosts that we are not considering to the avoid list |
210 | 209 | List<HostVO> allhostsInCluster = _hostDao.listAllUpAndEnabledNonHAHosts(type, clusterId, podId, dcId, null); |
|
0 commit comments