@@ -124,7 +124,7 @@ public class FirstFitPlanner extends AdapterBase implements DeploymentClusterPla
124124
125125 protected String allocationAlgorithm = "random" ;
126126 protected String globalDeploymentPlanner = "FirstFitPlanner" ;
127- protected String [] implicitHostTags ;
127+ protected String [] implicitHostTags = new String [ 0 ] ;
128128
129129 @ Override
130130 public List <Long > orderClusters (VirtualMachineProfile vmProfile , DeploymentPlan plan , ExcludeList avoid ) throws InsufficientServerCapacityException {
@@ -214,11 +214,11 @@ private void reorderClustersBasedOnImplicitTags(List<Long> clusterList, int requ
214214 Long uniqueTags ;
215215 for (Long clusterId : clusterList ) {
216216 uniqueTags = (long ) 0 ;
217- List <Long > hostList = capacityDao .listHostsWithEnoughCapacity (requiredCpu , requiredRam , clusterId , Host .Type .Routing .toString ());
218- if (!hostList .isEmpty () && implicitHostTags .length > 0 ) {
219- uniqueTags = new Long (hostTagsDao .getDistinctImplicitHostTags (hostList , implicitHostTags ).size ());
220- uniqueTags = uniqueTags + getHostsByCapability (hostList , Host .HOST_UEFI_ENABLE );
221- }
217+ List <Long > hostList = capacityDao .listHostsWithEnoughCapacity (requiredCpu , requiredRam , clusterId , Host .Type .Routing .toString ());
218+ if (!hostList .isEmpty () && implicitHostTags .length > 0 ) {
219+ uniqueTags = new Long (hostTagsDao .getDistinctImplicitHostTags (hostList , implicitHostTags ).size ());
220+ uniqueTags = uniqueTags + getHostsByCapability (hostList , Host .HOST_UEFI_ENABLE );
221+ }
222222 UniqueTagsInClusterMap .put (clusterId , uniqueTags );
223223 }
224224 Collections .sort (clusterList , new Comparator <Long >() {
0 commit comments