@@ -124,18 +124,24 @@ public List<StoragePool> allocateToPool(DiskProfile dskCh, VirtualMachineProfile
124124 protected List <StoragePool > reorderPoolsByCapacity (DeploymentPlan plan , List <StoragePool > pools ) {
125125 Long zoneId = plan .getDataCenterId ();
126126 Long clusterId = plan .getClusterId ();
127- short capacityType ;
128127
129128 if (CollectionUtils .isEmpty (pools )) {
130129 return null ;
131130 }
132131
133- if (pools .get (0 ).getPoolType ().isShared ()) {
132+ short capacityType = Capacity .CAPACITY_TYPE_LOCAL_STORAGE ;
133+ String storageType = "local" ;
134+ StoragePool storagePool = pools .get (0 );
135+ if (storagePool .isShared ()) {
134136 capacityType = Capacity .CAPACITY_TYPE_STORAGE_ALLOCATED ;
135- } else {
136- capacityType = Capacity .CAPACITY_TYPE_LOCAL_STORAGE ;
137+ storageType = "shared" ;
137138 }
138139
140+ s_logger .debug (String .format (
141+ "Filtering storage pools by capacity type [%s] as the first storage pool of the list, with name [%s] and ID [%s], is a [%s] storage." ,
142+ capacityType , storagePool .getName (), storagePool .getUuid (), storageType
143+ ));
144+
139145 List <Long > poolIdsByCapacity = capacityDao .orderHostsByFreeCapacity (zoneId , clusterId , capacityType );
140146
141147 logger .debug (String .format ("List of pools in descending order of available capacity [%s]." , poolIdsByCapacity ));
@@ -221,6 +227,8 @@ public List<StoragePool> reorderPools(List<StoragePool> pools, VirtualMachinePro
221227 }
222228
223229 List <StoragePool > reorderStoragePoolsBasedOnAlgorithm (List <StoragePool > pools , DeploymentPlan plan , Account account ) {
230+ s_logger .debug (String .format ("Using allocation algorithm [%s] to reorder pools." , allocationAlgorithm ));
231+
224232 if (allocationAlgorithm .equals ("random" ) || allocationAlgorithm .equals ("userconcentratedpod_random" ) || (account == null )) {
225233 reorderRandomPools (pools );
226234 } else if (StringUtils .equalsAny (allocationAlgorithm , "userdispersing" , "firstfitleastconsumed" )) {
0 commit comments