@@ -165,7 +165,7 @@ public List<StoragePoolAllocator> getStoragePoolAllocators() {
165165 }
166166
167167 public void setStoragePoolAllocators (List <StoragePoolAllocator > storagePoolAllocators ) {
168- this . _storagePoolAllocators = storagePoolAllocators ;
168+ _storagePoolAllocators = storagePoolAllocators ;
169169 }
170170
171171 protected List <HostAllocator > _hostAllocators ;
@@ -175,7 +175,7 @@ public List<HostAllocator> getHostAllocators() {
175175 }
176176
177177 public void setHostAllocators (List <HostAllocator > hostAllocators ) {
178- this . _hostAllocators = hostAllocators ;
178+ _hostAllocators = hostAllocators ;
179179 }
180180
181181 @ Inject
@@ -221,7 +221,7 @@ public List<DeploymentPlanner> getPlanners() {
221221 }
222222
223223 public void setPlanners (List <DeploymentPlanner > planners ) {
224- this . _planners = planners ;
224+ _planners = planners ;
225225 }
226226
227227 protected List <AffinityGroupProcessor > _affinityProcessors ;
@@ -231,7 +231,7 @@ public List<AffinityGroupProcessor> getAffinityGroupProcessors() {
231231 }
232232
233233 public void setAffinityGroupProcessors (List <AffinityGroupProcessor > affinityProcessors ) {
234- this . _affinityProcessors = affinityProcessors ;
234+ _affinityProcessors = affinityProcessors ;
235235 }
236236
237237 @ Override
@@ -1142,9 +1142,9 @@ protected Pair<Map<Volume, List<StoragePool>>, List<Volume>> findSuitablePoolsFo
11421142 List <StoragePool > suitablePools = new ArrayList <StoragePool >();
11431143 StoragePool pool = null ;
11441144 if (toBeCreated .getPoolId () != null ) {
1145- pool = (StoragePool )this . dataStoreMgr .getPrimaryDataStore (toBeCreated .getPoolId ());
1145+ pool = (StoragePool )dataStoreMgr .getPrimaryDataStore (toBeCreated .getPoolId ());
11461146 } else {
1147- pool = (StoragePool )this . dataStoreMgr .getPrimaryDataStore (plan .getPoolId ());
1147+ pool = (StoragePool )dataStoreMgr .getPrimaryDataStore (plan .getPoolId ());
11481148 }
11491149
11501150 if (!pool .isInMaintenance ()) {
@@ -1156,7 +1156,7 @@ protected Pair<Map<Volume, List<StoragePool>>, List<Volume>> findSuitablePoolsFo
11561156 if (plan .getDataCenterId () == exstPoolDcId && plan .getPodId () == exstPoolPodId && plan .getClusterId () == exstPoolClusterId ) {
11571157 canReusePool = true ;
11581158 } else if (plan .getDataCenterId () == exstPoolDcId ) {
1159- DataStore dataStore = this . dataStoreMgr .getPrimaryDataStore (pool .getId ());
1159+ DataStore dataStore = dataStoreMgr .getPrimaryDataStore (pool .getId ());
11601160 if (dataStore != null && dataStore .getScope () != null && dataStore .getScope ().getScopeType () == ScopeType .ZONE ) {
11611161 canReusePool = true ;
11621162 }
@@ -1259,9 +1259,14 @@ protected Pair<Map<Volume, List<StoragePool>>, List<Volume>> findSuitablePoolsFo
12591259 }
12601260 }
12611261
1262- if (suitableVolumeStoragePools .values () != null ) {
1263- poolsToAvoidOutput .removeAll (suitableVolumeStoragePools .values ());
1262+ HashSet <Long > toRemove = new HashSet <Long >();
1263+ for (List <StoragePool > lsp : suitableVolumeStoragePools .values ()) {
1264+ for (StoragePool sp : lsp ) {
1265+ toRemove .add (sp .getId ());
1266+ }
12641267 }
1268+ poolsToAvoidOutput .removeAll (toRemove );
1269+
12651270 if (avoid .getPoolsToAvoid () != null ) {
12661271 avoid .getPoolsToAvoid ().addAll (poolsToAvoidOutput );
12671272 }
0 commit comments