Skip to content

Commit f0186a6

Browse files
author
Julien Hervot de Mattos Vaz
committed
Apply suggestions
1 parent 2f2dafa commit f0186a6

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

engine/storage/src/main/java/org/apache/cloudstack/storage/allocator/AbstractStoragePoolAllocator.java

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ protected List<StoragePool> reorderPoolsByCapacity(DeploymentPlan plan, List<Sto
145145
storageType = "shared";
146146
}
147147

148-
logger.debug(
148+
logger.info(
149149
"Filtering storage pools by capacity type [{}] as the first storage pool of the list, with name [{}] and ID [{}], is a [{}] storage.",
150150
capacityType, storagePool.getName(), storagePool.getUuid(), storageType
151151
);
@@ -207,10 +207,10 @@ protected List<StoragePool> reorderPoolsByNumberOfVolumes(DeploymentPlan plan, L
207207
@Override
208208
public List<StoragePool> reorderPools(List<StoragePool> pools, VirtualMachineProfile vmProfile, DeploymentPlan plan, DiskProfile dskCh) {
209209
if (pools == null) {
210-
logger.debug("There are no pools to reorder; returning null.");
210+
logger.info("There are no pools to reorder; returning null.");
211211
return null;
212212
}
213-
logger.debug("Reordering [{}] pools", pools.size());
213+
logger.info("Reordering [{}] pools", pools.size());
214214
Account account = null;
215215
if (vmProfile.getVirtualMachine() != null) {
216216
account = vmProfile.getOwner();
@@ -219,7 +219,7 @@ public List<StoragePool> reorderPools(List<StoragePool> pools, VirtualMachinePro
219219
pools = reorderStoragePoolsBasedOnAlgorithm(pools, plan, account);
220220

221221
if (vmProfile.getVirtualMachine() == null) {
222-
logger.debug("The VM is null, skipping pool reordering by disk provisioning type.");
222+
logger.info("The VM is null, skipping pool reordering by disk provisioning type.");
223223
return pools;
224224
}
225225

@@ -233,7 +233,7 @@ public List<StoragePool> reorderPools(List<StoragePool> pools, VirtualMachinePro
233233

234234
List<StoragePool> reorderStoragePoolsBasedOnAlgorithm(List<StoragePool> pools, DeploymentPlan plan, Account account) {
235235
String volumeAllocationAlgorithm = VolumeOrchestrationService.VolumeAllocationAlgorithm.value();
236-
logger.debug("Using volume allocation algorithm {} to reorder pools.", volumeAllocationAlgorithm);
236+
logger.info("Using volume allocation algorithm {} to reorder pools.", volumeAllocationAlgorithm);
237237
if (volumeAllocationAlgorithm.equals("random") || volumeAllocationAlgorithm.equals("userconcentratedpod_random") || (account == null)) {
238238
reorderRandomPools(pools);
239239
} else if (StringUtils.equalsAny(volumeAllocationAlgorithm, "userdispersing", "firstfitleastconsumed")) {
@@ -256,7 +256,7 @@ void reorderRandomPools(List<StoragePool> pools) {
256256

257257
private List<StoragePool> reorderPoolsByDiskProvisioningType(List<StoragePool> pools, DiskProfile diskProfile) {
258258
if (diskProfile != null && diskProfile.getProvisioningType() != null && !diskProfile.getProvisioningType().equals(Storage.ProvisioningType.THIN)) {
259-
logger.debug("Reordering [{}] pools by disk provisioning type [{}].", pools.size(), diskProfile.getProvisioningType());
259+
logger.info("Reordering [{}] pools by disk provisioning type [{}].", pools.size(), diskProfile.getProvisioningType());
260260
List<StoragePool> reorderedPools = new ArrayList<>();
261261
int preferredIndex = 0;
262262
for (StoragePool pool : pools) {
@@ -273,7 +273,11 @@ private List<StoragePool> reorderPoolsByDiskProvisioningType(List<StoragePool> p
273273
logger.debug("Reordered list of pools by disk provisioning type [{}]: [{}]", diskProfile.getProvisioningType(), pools);
274274
return reorderedPools;
275275
} else {
276-
logger.debug("Reordering pools by disk provisioning type wasn't necessary.");
276+
if (diskProfile == null) {
277+
logger.info("Reordering pools by disk provisioning type wasn't necessary, since no disk profile was found.");
278+
} else {
279+
logger.debug("Reordering pools by disk provisioning type wasn't necessary, since the provisioning type is [{}].", diskProfile.getProvisioningType());
280+
}
277281
return pools;
278282
}
279283
}

0 commit comments

Comments
 (0)